Expand dyndns to cover muliple domains
This commit is contained in:
@@ -6,9 +6,9 @@ in
|
||||
# auto domain update
|
||||
|
||||
options = with lib; {
|
||||
services.domeneshop-updater.target = mkOption {
|
||||
type = types.str; #TODO list of string
|
||||
#default = config.networking.fqdn;
|
||||
services.domeneshop-updater.targets = mkOption {
|
||||
type = with types; listOf str;
|
||||
#default = [ config.networking.fqdn ];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -30,7 +30,9 @@ in
|
||||
}
|
||||
DOMENESHOP_TOKEN="$( tomlq </var/lib/secrets/domeneshop.toml .secrets.DOMENESHOP_TOKEN --raw-output)"
|
||||
DOMENESHOP_SECRET="$(tomlq </var/lib/secrets/domeneshop.toml .secrets.DOMENESHOP_SECRET --raw-output)"
|
||||
curl https://"$DOMENESHOP_TOKEN":"$DOMENESHOP_SECRET"@api.domeneshop.no/v0/dyndns/update?hostname=${cfg.target}
|
||||
${lib.concatMapStringsSep "\n" (target: ''
|
||||
curl https://"$DOMENESHOP_TOKEN":"$DOMENESHOP_SECRET"@api.domeneshop.no/v0/dyndns/update?hostname=${target}
|
||||
'') cfg.targets}
|
||||
'';
|
||||
};
|
||||
in {
|
||||
|
||||
Reference in New Issue
Block a user