-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
caddycmd: Add upgrade command #3972
Conversation
Replaces the current Caddy executable with a new one from the build server. Honors custom builds, as long as plugins are registered on the Caddy website. Requires permissions to replace current executable, of course. This is an experimental command that may get changed or removed later.
I suppose we could extend this to add and remove plugins too: Or maybe that should be a separate subcommand: Or even just: Ready, vote! |
I think this might make sense:
I think letting people lock to a specific version is helpful in case they know there's a breaking change ahead that they can't upgrade to just yet, but want to swap out a plugin. |
I'm leaning toward separate subcommands since I think upgrading Caddy and changing out its modules are different, separate actions, that probably shouldn't be performed together... |
Before doing anything else, this should check that the current binary is writable. Otherwise the user may need to do
Right, which is why I suggest adding I don't like the idea of adding too many subcommands. I prefer having fewer with options for related ones. |
I think there should be a way for distros to disable this functionality with e.g. a build tag. Distros manage packages via a package manager und the user should not easily be able to desync the binary with the package. Packages might deploy more files, for instance services, documentation, …. |
@francislavoie I'll probably add a
I don't know, man... software wants to be free. I'm not thrilled with package managers so I'm not interested in giving them more control over a user's choices. |
You are the maintainer, so that's fine. :) |
Going to merge this so people can start trying it more easily |
I was getting stuck/frustrated on another feature I have planned for Caddy 2.4, so I took a quick break and threw this together, from my own personal wishlist which I expressed in a tweet recently: https://twitter.com/mholt6/status/1349186705002151937
The
caddy upgrade
command replaces the current Caddy executable with a new one from the build server. It honors custom builds, as long as all the plugins are registered on the Caddy website. Of course, this requires permissions to replace current executable. You might have to runsudo caddy upgrade
.This is very experimental but I figure we can merge this in sooner or later and have people try it out and offer feedback.
There's more we could do here, like allowing the user to customize versions and/or just download the binary without replacing the current one, and/or just print the download URL, even.
Please give it a try!
Here's my log, for illustration: