Skip to content
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

puppet: Use certbot package timer, not our own cron job. #20512

Merged
merged 1 commit into from
Dec 9, 2021

Conversation

alexmv
Copy link
Collaborator

@alexmv alexmv commented Dec 8, 2021

The certbot package installs its own systemd timer (and cron job,
which disabled itself if systemd is enabled) which updates
certificates. This process races with the cron job which Zulip
installs -- the only difference being that Zulip respects the
certbot.auto_renew setting, and that it passes the deploy hook.
This means that occasionally nginx would not be reloaded, when the
systemd timer caught the expiration first.

Remove the custom cron job and certbot-maybe-renew script, and
reconfigure certbot to always reload nginx after deploying, using
certbot directory hooks.

Since certbot.auto_renew can't have an effect, remove the setting.
In turn, this removes the need for --no-zulip-conf to
setup-certbot. --deploy-hook is similarly removed, as running
deploy hooks to restart nginx is now the default; pass
--no-directory-hooks in standalone mode to not attempt to reload
nginx. The other property of --deploy-hook, of skipping symlinking
into place, is given its own flog.

Testing plan: Untested.

@alexmv alexmv force-pushed the certbot-race branch 3 times, most recently from e5b63c4 to cc2321d Compare December 9, 2021 05:29
The certbot package installs its own systemd timer (and cron job,
which disabled itself if systemd is enabled) which updates
certificates.  This process races with the cron job which Zulip
installs -- the only difference being that Zulip respects the
`certbot.auto_renew` setting, and that it passes the deploy hook.
This means that occasionally nginx would not be reloaded, when the
systemd timer caught the expiration first.

Remove the custom cron job and `certbot-maybe-renew` script, and
reconfigure certbot to always reload nginx after deploying, using
certbot directory hooks.

Since `certbot.auto_renew` can't have an effect, remove the setting.
In turn, this removes the need for `--no-zulip-conf` to
`setup-certbot`.  `--deploy-hook` is similarly removed, as running
deploy hooks to restart nginx is now the default; pass
`--no-directory-hooks` in standalone mode to not attempt to reload
nginx.  The other property of `--deploy-hook`, of skipping symlinking
into place, is given its own flog.
@timabbott
Copy link
Sponsor Member

lgtm. I think ideally we'd add a small "Upgrade notes" entry saying that the certbot_enable flag has been removed, since we now configure Certbot's built-in cron job to renew the Zulip certificates when it runs rather than running our own cron job.

@timabbott
Copy link
Sponsor Member

Are we planning to backport this to 4.x? If so, we probably want that upgrade notes entry to just be in the 4.9 section.

@alexmv
Copy link
Collaborator Author

alexmv commented Dec 9, 2021

This does seem important enough to backport.

@alexmv alexmv added the backport candidate Items we should consider backporting to the bug fix release series. label Dec 9, 2021
@alexmv alexmv merged commit 01e8f75 into zulip:main Dec 9, 2021
@alexmv alexmv deleted the certbot-race branch December 9, 2021 21:47
alexmv added a commit to zulip/docker-zulip that referenced this pull request Dec 10, 2021
The change in flag name is necessary after zulip/zulip#20512.
@andersk andersk removed the backport candidate Items we should consider backporting to the bug fix release series. label Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants