test / test (push) Canceled after 0s
C-A1, C-Q4, D-guide:258, :291, :722. certbot's live/<host>/*.pem are relative links into ../../archive/<host>/ (eff-certbot docs, "Where are my certificates?": point a server at them "or create symlinks"). The guide had `ln -s /etc/letsencrypt/live/<host> certs` and the nginx fragment mounted live/<host> alone: inside the container the links led into a directory it did not have - postfix-config.sh's [ -f ] false, no copy, Postfix without a certificate - and the panel's backup, reading certs/ through /selfpost-deploy, skipped links silently. Now certs/fullchain.pem and certs/privkey.pem are links to /etc/letsencrypt/live/<host>/, and /etc/letsencrypt is mounted read-only at the same path: a commented line in deploy/docker-compose.yml for the Apache scenario, mounted in the nginx fragment (./nginx/certbot-etc). The guide's steps add certbot's own commands for a server that is not root - chmod 0755 live archive, chgrp 998 + chmod 0640 the key, which certbot keeps on renewal - so the panel reads them (Health, backup). Postfix's side follows links already ([ -f ], cp, cmp, openssl). The vhost comment says the same. The backup table: links are followed by the panel's backup; a stopped tar stores them as links unless -h (GNU tar). internal/backup: addTree follows, for certs/ only, a link to a regular file and archives that file under the link's name; a link to nothing reachable is an error naming it and the mount. Tests: TestCertsLinksAreFollowed (certs/ -> live/ -> archive/, the archive holds the files; the tree gone, Check names the dangling link; Linux). Stand (2026-10-15, make e2e, exit 0): the stand mounts ./letsencrypt at /etc/letsencrypt; new certbot_layout_followed puts a new pair into letsencrypt/archive/, relative links in live/, absolute links in certs/, recreates the container: 465 serves the new serial, Health names no renewal waiting, and the full backup holds certs/*.pem as regular files with the archive's bytes. go vet and go test ./... pass on the server (24 packages); the Linux-only tests of this session run there and pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
2.0 KiB
Plaintext
43 lines
2.0 KiB
Plaintext
# Example host Apache vhost for the SelfPost panel (default scenario). Install
|
|
# on the host running Apache — NOT inside the SelfPost container. Requires
|
|
# mod_ssl and mod_proxy/mod_proxy_http enabled (`a2enmod ssl proxy proxy_http`).
|
|
#
|
|
# Certificates: obtain with the Apache certbot plugin against THIS vhost
|
|
# (`certbot --apache -d mail.example.com`). Certbot edits this file in place to
|
|
# add the SSLCertificateFile/SSLCertificateKeyFile directives and a :80 -> :443
|
|
# redirect vhost, and renews in the background via its own timer. The resulting
|
|
# PEM files land at
|
|
# /etc/letsencrypt/live/mail.example.com/{fullchain,privkey}.pem on the host,
|
|
# as links into ../../archive/. Link certs/fullchain.pem and certs/privkey.pem
|
|
# to them and mount /etc/letsencrypt read-only at the same path (see
|
|
# ../docker-compose.yml and docs/guide.md, "Reverse proxy") so Postfix can
|
|
# present the very same certificate on 465/587. Mounting live/mail.example.com
|
|
# alone gives the container links into a directory it does not have. One
|
|
# certificate, two consumers — no separate cert just for the panel.
|
|
|
|
<VirtualHost *:443>
|
|
ServerName mail.example.com
|
|
|
|
# Filled in by `certbot --apache`; shown here for clarity.
|
|
# SSLEngine on
|
|
# SSLCertificateFile /etc/letsencrypt/live/mail.example.com/fullchain.pem
|
|
# SSLCertificateKeyFile /etc/letsencrypt/live/mail.example.com/privkey.pem
|
|
|
|
ProxyPreserveHost On
|
|
ProxyPass "/" "http://127.0.0.1:8080/"
|
|
ProxyPassReverse "/" "http://127.0.0.1:8080/"
|
|
|
|
# The panel is plain HTTP behind the proxy; it never terminates TLS itself.
|
|
# Cookies are still marked Secure by the panel because the browser only ever
|
|
# sees this HTTPS vhost.
|
|
</VirtualHost>
|
|
|
|
<VirtualHost *:80>
|
|
ServerName mail.example.com
|
|
# certbot's http-01 challenge needs this on plain :80; everything else
|
|
# redirects to HTTPS once certbot adds the RewriteRule/Redirect block.
|
|
RewriteEngine On
|
|
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
|
|
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
|
|
</VirtualHost>
|