setup caddy for ssl via dns with cloudflare

This commit is contained in:
2026-07-28 09:38:19 -05:00
parent 9659dcf9ef
commit 67527c2ef9
+5 -5
View File
@@ -67,11 +67,6 @@ in {
acme_dns cloudflare {env.CLOUDFLARE_API_TOKEN} acme_dns cloudflare {env.CLOUDFLARE_API_TOKEN}
''; '';
# make cloudflare token readable
systemd.services.caddy.serviceConfig = {
EnvironmentFile = sec."cloudflare/api_token_caddy".path;
};
# static page for hosting key files # static page for hosting key files
virtualHosts = { virtualHosts = {
"keys.${homelab.base_domain}" = lib.mkIf cfg.keys { "keys.${homelab.base_domain}" = lib.mkIf cfg.keys {
@@ -85,6 +80,11 @@ in {
}; };
}; };
# make cloudflare token readable
systemd.services.caddy.serviceConfig = {
EnvironmentFile = sec."cloudflare/api_token_caddy".path;
};
# enable acme for auto ssl certs with lets encrypt # enable acme for auto ssl certs with lets encrypt
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;