all: setup caddy to use DNS challenge
This commit is contained in:
parent
2413dd7935
commit
4b5463471a
1 changed files with 14 additions and 1 deletions
|
@ -1,9 +1,22 @@
|
||||||
{ inputs, pkgs, ... }: {
|
{ config, inputs, pkgs, ... }: {
|
||||||
|
sops = {
|
||||||
|
secrets = {
|
||||||
|
"digitalocean/token_file" = {
|
||||||
|
mode = "444";
|
||||||
|
owner = config.users.users.root.name;
|
||||||
|
group = config.users.users.root.group;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = inputs.caddy.packages.${pkgs.system}.caddy;
|
package = inputs.caddy.packages.${pkgs.system}.caddy;
|
||||||
email = "admin@acomputer.lol";
|
email = "admin@acomputer.lol";
|
||||||
|
globalConfig = ''
|
||||||
|
acme_dns digitalocean {env.DO_API_TOKEN}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
systemd.services.caddy.serviceConfig.EnvironmentFile = config.sops.secrets."digitalocean/token_file".path;
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue