Ddns: Move from container to support ipv6.

This commit is contained in:
Dmitry Voronin 2024-12-02 05:15:52 +03:00
parent 1badb122cb
commit 6ed75a8037
3 changed files with 22 additions and 60 deletions

View file

@ -1,59 +0,0 @@
{
config,
container,
lib,
...
}: let
cfg = config.container.module.ddns;
in {
options.container.module.ddns = {
enable = lib.mkEnableOption "the dynamic dns client.";
address = lib.mkOption {
default = "10.1.0.31";
type = lib.types.str;
};
storage = lib.mkOption {
default = "${config.container.storage}/ddns";
type = lib.types.str;
};
};
config = lib.mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [
"data"
];
containers.ddns = container.mkContainer cfg {
bindMounts = {
"/data" = {
hostPath = "${cfg.storage}/data";
isReadOnly = true;
};
};
config = { ... }: container.mkContainerConfig cfg {
services.cloudflare-dyndns = {
enable = true;
apiTokenFile = "/data/token";
deleteMissing = false;
ipv4 = true;
ipv6 = true;
proxied = false;
domains = let
domain = config.container.domain;
in [
domain
] ++ map (sub: "${sub}.${domain}") [
"cloud"
"git"
"mail"
"office"
"paste"
"play"
"vpn"
];
};
};
};
};
}

View file

@ -10,7 +10,6 @@
module = { module = {
change.enable = true; change.enable = true;
cloud.enable = true; cloud.enable = true;
ddns.enable = true;
dns.enable = true; dns.enable = true;
download.enable = true; download.enable = true;
frkn.enable = true; frkn.enable = true;

View file

@ -0,0 +1,22 @@
{ ... }: {
services.cloudflare-dyndns = {
enable = true;
apiTokenFile = "/storage/hot/container/ddns/data/token";
deleteMissing = false;
ipv4 = true;
ipv6 = true;
proxied = false;
domains = let
domain = "voronind.com";
in [
domain
] ++ map (sub: "${sub}.${domain}") [
"cloud"
"git"
"mail"
"office"
"paste"
"vpn"
];
};
}