Skip to content

Conversation

@alexmv
Copy link
Contributor

@alexmv alexmv commented Nov 26, 2025

In Zulip Server 4.9-0, we started unconditionally installing certbot, leading to /etc/letsencrypt always existing in the container, and breaking the symlinking of it into /data/, and certbot certificates in general.

Rework how certificates are obtained and stored. Certificates are now stored in subdirectories of /data/certs/, so that auto-generated certificates (either from certbot, or self-signed) cannot ever overwrite manual certificates. Only the data parts of /etc/letsencrypt are stored in the data volume; the general configuration aspects and hooks are left for Puppet to configure.

We swap certbot-deploy-hook for overwriting the /etc/letsencrypt/renewal-hooks/deploy/050-nginx.sh hook, leaving the other hooks (for symlinking, and restarting the email server) untouched. The core Zulip Server behaviour of symlinking the certbot certificates into /etc/ssl/ is left untouched; we deal with persistence and backup by dint of storing the /etc/letsencrypt in the data volume.

Fixes #381.
Fixes #489.


Requires zulip/zulip#36803.

In Zulip Server 4.9-0, we started unconditionally installing
`certbot`, leading to `/etc/letsencrypt` always existing in the
container, and breaking the symlinking of it into `/data/`, and
certbot certificates in general.

Rework how certificates are obtained and stored.  Certificates are now
stored in subdirectories of `/data/certs/`, so that auto-generated
certificates (either from certbot, or self-signed) cannot ever
overwrite manual certificates.  Only the data parts of
`/etc/letsencrypt` are stored in the data volume; the general
configuration aspects and hooks are left for Puppet to configure.

We swap `certbot-deploy-hook` for overwriting the
`/etc/letsencrypt/renewal-hooks/deploy/050-nginx.sh` hook, leaving the
other hooks (for symlinking, and restarting the email server)
untouched.  The core Zulip Server behaviour of symlinking the certbot
certificates into `/etc/ssl/` is left untouched; we deal with
persistence and backup by dint of storing the `/etc/letsencrypt` in
the data volume.

Fixes #381.
Fixes #489.
@alexmv alexmv force-pushed the certs branch 8 times, most recently from 99c3925 to 96f9f2e Compare November 27, 2025 03:36
@alexmv alexmv force-pushed the certs branch 8 times, most recently from 2ee285d to 22ca821 Compare November 27, 2025 04:51
Most Docker deployments are behind other proxies, and are not expected
to do TLS termination.  We remove the `DISABLE_HTTPS` environment
variable, and instead use a new `CERTIFICATES` var to combine
`DISABLE_HTTPS` and `SSL_CERTIFICATE_GENERATION` into one setting.
The default (empty) value generates and provides no certificates, but
"self-signed", "certbot", and "manual" are possible values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants