diff options
| author | Mel <mel@rnrd.eu> | 2026-09-06 21:12:57 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2026-09-06 21:44:46 +0200 |
| commit | ab3750e39438385d0fd2b596afc009be31ee9746 (patch) | |
| tree | 732f26f1a698949545156121385327ef6dc2e15a /modules | |
| parent | 87a20623ec14f8bed3f83bc93d739e6b081d4795 (diff) | |
| download | network-ab3750e39438385d0fd2b596afc009be31ee9746.tar.zst network-ab3750e39438385d0fd2b596afc009be31ee9746.zip | |
Disable CNAME support in Lego challenge for rnrd.eu
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/foundation/www/default.nix | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/modules/foundation/www/default.nix b/modules/foundation/www/default.nix index c84e7b4..ef1f8b0 100644 --- a/modules/foundation/www/default.nix +++ b/modules/foundation/www/default.nix @@ -37,15 +37,19 @@ let "favicon.png" = ../../../assets/favicon.png; }; - certificate = domain: dnsProvider: credentialFiles: { + certificate = domain: settings: { ${domain} = { domain = "*.${domain}"; extraDomainNames = [ domain ]; - - inherit dnsProvider credentialFiles; - }; + } // settings; }; + # our zones have wildcard cnames, which lego would follow to + # place the challenge somewhere else. keep it where it belongs. + noCnameFollowing = pkgs.writeText "lego-no-cname" '' + LEGO_DISABLE_CNAME_SUPPORT=true + ''; + # edge addresses of the cdn providers we use, to allow extraction # of the real addresses connecting to us. edgeAddresses = let @@ -124,17 +128,20 @@ in # our certificates are really only used with Nginx group = config.services.nginx.group; reloadServices = [ "nginx.service" ]; + environmentFile = noCnameFollowing; }; # yes, we generate both certificates, even if they are not # used by every machine, but as long as it doesn't cause # any problems... :) certs = mergeAttrsList [ - (certificate "rnrd.eu" "bunny" { - BUNNY_API_KEY_FILE = secrets.bunny-dns.path; + (certificate "rnrd.eu" { + dnsProvider = "bunny"; + credentialFiles.BUNNY_API_KEY_FILE = secrets.bunny-dns.path; }) - (certificate "rnrd.fyi" "cloudflare" { - CLOUDFLARE_DNS_API_TOKEN_FILE = secrets.cloudflare-dns.path; + (certificate "rnrd.fyi" { + dnsProvider = "cloudflare"; + credentialFiles.CLOUDFLARE_DNS_API_TOKEN_FILE = secrets.cloudflare-dns.path; }) ]; }; |
