ddns-trust-dns: use ddns from router rather than ipinfo.io

This commit is contained in:
colin 2022-12-19 08:24:11 +00:00
parent cd1aa0b376
commit 8169f7c6b2
2 changed files with 13 additions and 6 deletions

View File

@ -58,8 +58,8 @@
)];
serviceConfig.Type = "oneshot";
script = let
check-ip = "${pkgs.sane-scripts}/bin/sane-ip-check-router-wan";
sed = "${pkgs.gnused}/bin/sed";
curl = "${pkgs.curl}/bin/curl -4";
zone-dir = "/var/lib/trust-dns";
zone-out = "${zone-dir}/native.uninsane.org.zone";
diff = "${pkgs.diffutils}/bin/diff";
@ -72,10 +72,8 @@
in ''
set -ex
mkdir -p ${zone-dir}
ip=$(${curl} https://ipinfo.io/ip)
ip=$(${check-ip})
# TODO: validate that this is really our IP!
# - i could host a service in ovpns which replies to pings
${sed} s/%NATIVE%/$ip/ ${zone-template} > ${zone-out}.new
# see if anything changed

View File

@ -22,7 +22,7 @@ resholve.mkDerivation {
# this lets our scripts reference eachother.
# see: <https://github.com/abathur/resholve/issues/26>
"bin"
coreutils
coreutils-full
curl
duplicity
file
@ -57,10 +57,18 @@ resholve.mkDerivation {
fake = {
external = [
# https://github.com/abathur/resholve/issues/29
"umount"
# "umount"
# "/run/wrappers/bin/sudo"
"sudo"
];
};
fix = {
# this replaces umount with the non-setuid-wrapper umount.
# not sure if/where that lack of suid causes problems.
umount = true;
};
# prologue is broken; see <https://github.com/abathur/resholve/issues/89>
# prologue = "bin/prologue";
# list of programs which *can* or *cannot* exec their arguments
execer = with pkgs; [
@ -82,6 +90,7 @@ resholve.mkDerivation {
installPhase = ''
mkdir -p "$out/bin"
cp -R * "$out"/bin/
sed -i '3iPATH=$PATH:/run/wrappers/bin' $out/bin/*;
'';
meta = {