From a7d859681f5508a829115376d9dd993f3f137321 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 3 Aug 2026 10:27:49 +0300 Subject: frontends: give f3s hosts a standby. SAN instead of a separate cert f3s hosts don't get a distinct standby certificate/keypair; alias the primary cert's files under the standby name (relayd selects a keypair by SNI, so it needs matching filenames) and add standby. as a SAN on the primary cert. Every host now also gets www. as a SAN unconditionally, since public DNS publishes www for all of them. Co-Authored-By: Claude Sonnet 5 --- frontends/scripts/acme.sh.tpl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'frontends/scripts') diff --git a/frontends/scripts/acme.sh.tpl b/frontends/scripts/acme.sh.tpl index 3b3b35f..dd613fc 100644 --- a/frontends/scripts/acme.sh.tpl +++ b/frontends/scripts/acme.sh.tpl @@ -16,6 +16,15 @@ ensure_placeholder_cert () { fi } +alias_cert () { + source=$1 + alias=$2 + + ln -sf "/etc/ssl/$source.fullchain.pem" "/etc/ssl/$alias.crt" + ln -sf "/etc/ssl/$source.fullchain.pem" "/etc/ssl/$alias.fullchain.pem" + ln -sf "/etc/ssl/private/$source.key" "/etc/ssl/private/$alias.key" +} + handle_cert () { host=$1 host_ip=`host $host | awk '/has address/ { print $(NF) }'` @@ -48,7 +57,13 @@ handle_cert <%= $host %> if [ $? -eq 0 ]; then has_update=yes fi -<% unless ($host eq 'blowfish.buetow.org' or $host eq 'fishfinger.buetow.org') { -%> +<% if (grep { $_ eq $host } @$f3s_hosts) { -%> +# f3s standby names are SANs on the primary certificate. relayd selects a +# keypair by SNI name, so provide filename aliases for that shared certificate. +alias_cert <%= $host %> standby.<%= $host %> +<% } -%> +<% unless ($host eq 'blowfish.buetow.org' or $host eq 'fishfinger.buetow.org' + or grep { $_ eq $host } @$f3s_hosts) { -%> handle_cert standby.<%= $host %> if [ $? -eq 0 ]; then has_update=yes -- cgit v1.2.3