fix(caddy): switch dns provider from hetzner to cloudflare across all services
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
...
|
||||
}: {
|
||||
sops = {
|
||||
secrets."hetzner/api_key".owner = config.services.caddy.user;
|
||||
secrets."cloudflare/api_key".owner = config.services.caddy.user;
|
||||
templates = {
|
||||
"HETZNER_API_KEY.env".content = ''
|
||||
HETZNER_API_KEY=${config.sops.placeholder."hetzner/api_key"}
|
||||
"CLOUDFLARE_API_KEY.env".content = ''
|
||||
CLOUDFLARE_API_KEY=${config.sops.placeholder."cloudflare/api_key"}
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -15,11 +15,11 @@
|
||||
caddy = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
(hetzner) {
|
||||
(cloudflare) {
|
||||
tls {
|
||||
propagation_timeout -1
|
||||
propagation_delay 120s
|
||||
dns hetzner {env.HETZNER_API_KEY}
|
||||
dns cloudflare {env.CLOUDFLARE_API_KEY}
|
||||
resolvers 1.1.1.1
|
||||
}
|
||||
}
|
||||
@@ -31,17 +31,13 @@
|
||||
}
|
||||
}
|
||||
'';
|
||||
package = pkgs.caddy.withPlugins {
|
||||
plugins = ["github.com/caddy-dns/hetzner@v1.0.0"];
|
||||
hash = "sha256-Iwsu3s1qOwavcmmnd1w4GVeCkU1HhlWAJXMuc5NOc24=";
|
||||
};
|
||||
# package = pkgs.caddyWithHetzner;
|
||||
package = pkgs.caddyWithCloudflare;
|
||||
};
|
||||
};
|
||||
systemd.services.caddy = {
|
||||
after = ["sops-install-secrets.service"];
|
||||
serviceConfig = {
|
||||
EnvironmentFile = config.sops.templates."HETZNER_API_KEY.env".path;
|
||||
EnvironmentFile = config.sops.templates."CLOUDFLARE_API_KEY.env".path;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
};
|
||||
caddy = {
|
||||
virtualHosts."deluge.tsuba.darksailor.dev".extraConfig = ''
|
||||
import hetzner
|
||||
import cloudflare
|
||||
reverse_proxy localhost:8112
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
services.caddy = {
|
||||
virtualHosts."home.darksailor.dev".extraConfig = ''
|
||||
import hetzner
|
||||
import cloudflare
|
||||
reverse_proxy localhost:8123
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -33,15 +33,15 @@
|
||||
# };
|
||||
caddy = {
|
||||
# virtualHosts."jellyseerr.tsuba.darksailor.dev".extraConfig = ''
|
||||
# import hetzner
|
||||
# import cloudflare
|
||||
# reverse_proxy localhost:${builtins.toString config.services.jellyseerr.port}
|
||||
# '';
|
||||
virtualHosts."jellyfin.tsuba.darksailor.dev".extraConfig = ''
|
||||
import hetzner
|
||||
import cloudflare
|
||||
reverse_proxy localhost:8096
|
||||
'';
|
||||
virtualHosts."media.darksailor.dev".extraConfig = ''
|
||||
import hetzner
|
||||
import cloudflare
|
||||
reverse_proxy localhost:8096
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
};
|
||||
caddy = {
|
||||
virtualHosts."prowlarr.tsuba.darksailor.dev".extraConfig = ''
|
||||
import hetzner
|
||||
import cloudflare
|
||||
reverse_proxy localhost:9696
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -37,27 +37,27 @@
|
||||
};
|
||||
caddy.virtualHosts = {
|
||||
"sonarr.tsuba.darksailor.dev".extraConfig = ''
|
||||
import hetzner
|
||||
import cloudflare
|
||||
import auth
|
||||
reverse_proxy localhost:${builtins.toString config.services.sonarr.settings.server.port}
|
||||
'';
|
||||
"radarr.tsuba.darksailor.dev".extraConfig = ''
|
||||
import hetzner
|
||||
import cloudflare
|
||||
import auth
|
||||
reverse_proxy localhost:${builtins.toString config.services.radarr.settings.server.port}
|
||||
'';
|
||||
"lidarr.tsuba.darksailor.dev".extraConfig = ''
|
||||
import hetzner
|
||||
import cloudflare
|
||||
import auth
|
||||
reverse_proxy localhost:${builtins.toString config.services.lidarr.settings.server.port}
|
||||
'';
|
||||
"bazarr.tsuba.darksailor.dev".extraConfig = ''
|
||||
import hetzner
|
||||
import cloudflare
|
||||
import auth
|
||||
reverse_proxy localhost:${builtins.toString config.services.bazarr.listenPort}
|
||||
'';
|
||||
"prowlarr.tsuba.darksailor.dev".extraConfig = ''
|
||||
import hetzner
|
||||
import cloudflare
|
||||
import auth
|
||||
reverse_proxy tako.darksailor.dev:9696
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user