Future-proof `phylum update`
When phylum update is run, it will:
- Confirm that the user is on a platform that supports self-update (i.e,
aarch64-apple-darwin,x86_64-apple-darwin, orx86_64-unknown-linux). - Attempt an escape hatch update (details below)
- Perform the steps exactly as explained for a fresh install
here(i.e., download the zip, verify the signature, unzip it, and run./install.sh)
Escape hatch update
To ensure that phylum update continues to work in the future even if we change our install process and/or release layout again, I will add an "escape hatch". Here are the steps I propose for the escape hatch:
- Do an HTTP GET of
https://update.phylum.io/update.shandhttps://update.phylum.io/update.sh.minisig - If there is a 404 error or DNS error, go back to the normal install steps
- If files are return, verify the signature and run
update.shto perform the update.
Originally posted by @kylewillmon in https://github.com/phylum-dev/cli/issues/187#issuecomment-1087583649
That's a cool idea! It reminded me of an idea from the initial implementation. Years of breaking software update implementations led me to The Update Framework awhile back: https://theupdateframework.io/
It might be a bit heavy-handed for this use, but I think some of the principles there could be helpful if we're going to re-design how the update implementation works.