-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Suggestion: renew else run mode #216
Comments
Hey there!
The issue here is that renewal is always possible as long as you do not run into rate limits.
What would you suggest? |
Renewal doesn't take place if executed with the The only way I can think to get a way to tell if it has been renewed would be to use the return code for the application. |
Well. Renewal only takes place if the number of days to the expiration day is less than the number supplied via |
Maybe exit code 0 = renewed successfully, 1 = no renewal but no error either, and >= 2 is an error... Although that's less convenient than just a boolean 'did or did not error'. |
If error codes are the route taken, avoiding the "standardzed" exit/error codes would probably be a good idea. What's about a status message to stdout (does current verbose log go to stderr?)? If needs be, a flag that shows no output apart from the status message. |
Yeah. I was more thinking something like 0 for normal execution and 3 if something changed. |
For me, "renew else run" would mean that I could combine both actions into one script. If cert exist & < 30 days, then renew. Hope that helps. Maybe call it "lego go" =) |
@xenolf Any news on this? Just ran into the issue myself, since I want to avoid restarting our VPN server if there are no new certs (using From the previously linked page:
|
I ended up doing this as a workaround. Seems to do the trick, but having something baked into
|
That is a bad idea that we used to have in nixpkgs: NixOS/nixpkgs#86184. Fixed in NixOS/nixpkgs@cc37d7e Related issue: #1192 |
This comment has been minimized.
This comment has been minimized.
Thanks @datafoo - Pretty sure I got the idea from that same file, so good to get the update. Yeah it'd definitely be nicer to check the expiration first. Ultimately I ended up just sticking to AWS certs rather than introducing letsencrypt certs. |
I hope you don't end up using exit codes. That would have a really bad smell to it, since I've never come across another tool that would report success (or no-op) with an error code. The way I see this should work is have an option to get the status out as JSON which you could parse easily with jq.
As further clarification, you could write all other log output into stderr, and the json into stdout, so pipeing to jq would always work ok. |
I hope they do, and I think you'll find they're more common than you think (remember, it's not an error code, it's an exit or return code):
borg backup:
Disagree. You're proposing installation of another tool (
Ugh, no, also disagree. |
It would be very useful to have the ability to renew if possible, otherwise issue the initial certificate. This would be useful when used with Docker as it would allow a container to create and renew certificates on a cron job easily. Additionally, when run with the
--days
argument it'd be helpful for there to be some way to clearly tell if the certificate has actually been renewed.The text was updated successfully, but these errors were encountered: