Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Blocker: no. This can wait. Do fix step 6 in the same release as the monitoring agent (#26 to #30).
Defect
- The script does not use
set -euo pipefail. curl -sdoes not use-f. On a 404 error, the script saves the error page as the tarball. Then, the script shows "Failed to extract". This message does not tell the real cause.- The script runs
apt-get install grepwithoutapt-get update. GNU grep on Ubuntu always supports-P. Thus, this step is not necessary. - When the script stops because of a rate limit, it does not remove its temporary file.
- The script uses
grepto parse JSON. - The script does not compare the download with a checksum.
- On a server with the monitoring agent,
/usr/local/bin/flyis a link to~fly/.fly/bin/fly. The script moves the new binary to/usr/local/bin/fly.mvreplaces the link with a separate file.
Cost
- Some errors show an incorrect cause. Thus, installation problems are hard to find.
- A command that fails does not always stop the script.
- On a server with the agent, the server then has two binaries.
fly updateupdates the separate file, and the agent continues with the old binary.
Benefit of the fix
- Each error stops the script with a correct message.
- The script does not leave temporary files.
- The script examines the download before it installs the binary (with enhancement: Examine release downloads with checksums #9).
- On a server with the agent, the CLI and the agent use the same binary.
Fix
- Add
set -euo pipefail. - Use
curl -fsSLfor each download. - Remove the
grep -Pinstallation step. - Add a
trapthat removes the temporary files. - Compare the download with
checksums.txt(refer to enhancement: Examine release downloads with checksums #9). ci: run make check on every change and publish releases with gh #25 publishes it. - If
/usr/local/bin/flyis a link, install to the target of the link, and keep the owner of the target.
Why this can wait
- The script operates correctly on Ubuntu at this time.
- The FlyWP installer, not this script, installs the agent. Fix step 6 is necessary only when a person runs this script on a server with the agent.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
fix(install): make install.sh reliable, and install through the agent…
fix(install): never let root write in the folder of the agent user
fix(install): make install.sh reliable, and never let root write in t…
[-]Make install.sh more reliable[/-][+]enhancement: Make install.sh more reliable[/+]