From 9e7b2099f102fc2da910951d65bdb88d1f236105 Mon Sep 17 00:00:00 2001 From: Ruben Hensen Date: Wed, 18 Nov 2026 10:42:04 +0100 Subject: [PATCH] node001: keep the mail certificate key on renewal Each renewal made a new key, so a TLSA record that pins the key went stale every 60 days. With --reuse-key the key stays, and one 3 1 1 record can describe it. Deploying this orders a new certificate once, with a new key, because NixOS hashes the lego flags. The TLSA record goes in after that. --- nix-infra-machine/nodes/node001.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nix-infra-machine/nodes/node001.nix b/nix-infra-machine/nodes/node001.nix index 718bba2..dc8b8e8 100644 --- a/nix-infra-machine/nodes/node001.nix +++ b/nix-infra-machine/nodes/node001.nix @@ -154,6 +154,13 @@ in "autodiscover.rubenhensen.nl" "rubenhensen.nl" ]; + # Keep the same key on renewal. The TLSA record in + # dns/domains/rubenhensen.nl.yaml pins this key, and senders that + # enforce DANE stop delivering when the two differ. Changing the + # names or the lego flags of this cert makes NixOS order a new one + # with a fresh key, so take the record out first and put the new + # hash back afterwards. + extraLegoRenewFlags = [ "--reuse-key" ]; }; };