2022-12-18 23:09:13 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2022-12-08 14:23:35 +00:00
|
|
|
|
2022-12-18 23:09:13 +00:00
|
|
|
# using manual ddns now
|
|
|
|
lib.mkIf false
|
2022-12-08 14:23:35 +00:00
|
|
|
{
|
|
|
|
systemd.services.ddns-afraid = {
|
|
|
|
description = "update dynamic DNS entries for freedns.afraid.org";
|
|
|
|
serviceConfig = {
|
2023-05-14 09:50:01 +00:00
|
|
|
EnvironmentFile = config.sops.secrets."ddns_afraid.env".path;
|
2022-12-08 14:23:35 +00:00
|
|
|
# TODO: ProtectSystem = "strict";
|
|
|
|
# TODO: ProtectHome = "full";
|
|
|
|
# TODO: PrivateTmp = true;
|
|
|
|
};
|
|
|
|
script = let
|
2022-12-08 14:30:17 +00:00
|
|
|
curl = "${pkgs.curl}/bin/curl -4";
|
2022-12-08 14:23:35 +00:00
|
|
|
in ''
|
|
|
|
${curl} "https://freedns.afraid.org/dynamic/update.php?$AFRAID_KEY"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
systemd.timers.ddns-afraid = {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
timerConfig = {
|
|
|
|
OnStartupSec = "2min";
|
|
|
|
OnUnitActiveSec = "10min";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|