ddns-trust-dns: use ddns from router rather than ipinfo.io
This commit is contained in:
parent
cd1aa0b376
commit
8169f7c6b2
|
@ -58,8 +58,8 @@
|
||||||
)];
|
)];
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
script = let
|
script = let
|
||||||
|
check-ip = "${pkgs.sane-scripts}/bin/sane-ip-check-router-wan";
|
||||||
sed = "${pkgs.gnused}/bin/sed";
|
sed = "${pkgs.gnused}/bin/sed";
|
||||||
curl = "${pkgs.curl}/bin/curl -4";
|
|
||||||
zone-dir = "/var/lib/trust-dns";
|
zone-dir = "/var/lib/trust-dns";
|
||||||
zone-out = "${zone-dir}/native.uninsane.org.zone";
|
zone-out = "${zone-dir}/native.uninsane.org.zone";
|
||||||
diff = "${pkgs.diffutils}/bin/diff";
|
diff = "${pkgs.diffutils}/bin/diff";
|
||||||
|
@ -72,10 +72,8 @@
|
||||||
in ''
|
in ''
|
||||||
set -ex
|
set -ex
|
||||||
mkdir -p ${zone-dir}
|
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
|
${sed} s/%NATIVE%/$ip/ ${zone-template} > ${zone-out}.new
|
||||||
|
|
||||||
# see if anything changed
|
# see if anything changed
|
||||||
|
|
|
@ -22,7 +22,7 @@ resholve.mkDerivation {
|
||||||
# this lets our scripts reference eachother.
|
# this lets our scripts reference eachother.
|
||||||
# see: <https://github.com/abathur/resholve/issues/26>
|
# see: <https://github.com/abathur/resholve/issues/26>
|
||||||
"bin"
|
"bin"
|
||||||
coreutils
|
coreutils-full
|
||||||
curl
|
curl
|
||||||
duplicity
|
duplicity
|
||||||
file
|
file
|
||||||
|
@ -57,10 +57,18 @@ resholve.mkDerivation {
|
||||||
fake = {
|
fake = {
|
||||||
external = [
|
external = [
|
||||||
# https://github.com/abathur/resholve/issues/29
|
# https://github.com/abathur/resholve/issues/29
|
||||||
"umount"
|
# "umount"
|
||||||
|
# "/run/wrappers/bin/sudo"
|
||||||
"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
|
# list of programs which *can* or *cannot* exec their arguments
|
||||||
execer = with pkgs; [
|
execer = with pkgs; [
|
||||||
|
@ -82,6 +90,7 @@ resholve.mkDerivation {
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p "$out/bin"
|
mkdir -p "$out/bin"
|
||||||
cp -R * "$out"/bin/
|
cp -R * "$out"/bin/
|
||||||
|
sed -i '3iPATH=$PATH:/run/wrappers/bin' $out/bin/*;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user