From c2070c71abfbe4ae10ee9d66c8af4d31bfc901c9 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Jan 2013 14:19:16 +0100 Subject: retiolum/hosts/ire: initial commit --- retiolum/hosts/ire | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 retiolum/hosts/ire (limited to 'retiolum') diff --git a/retiolum/hosts/ire b/retiolum/hosts/ire new file mode 100644 index 00000000..724158cb --- /dev/null +++ b/retiolum/hosts/ire @@ -0,0 +1,12 @@ +Address = 198.147.23.143 +Subnet = 10.243.231.66 +Subnet = 42:b912:0f42:a82d:0d27:8610:e89b:490c + +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEAwofjmP/XBf5pwsJlWklkSzI+Bo0I0B9ONc7/j+zpbmMRkwbWk4X7 +rVLt1cWvTY15ujg2u8l0o6OgEbIkc6rslkD603fv1sEAd0KOv7iKLgRpE9qfSvAt +6YpiSv+mxEMTpH0g36OmBfOJ10uT+iHDB/FfxmgGJx//jdJADzLjjWC6ID+iGkGU +1Sf+yHXF7HRmQ29Yak8LYVCJpGC5bQfWIMSL5lujLq4NchY2d+NZDkuvh42Ayr0K +LPflnPBQ3XnKHKtSsnFR2vaP6q+d3Opsq/kzBnAkjL26jEuFK1v7P/HhNhJoPzwu +nKKWj/W/k448ce374k5ycjvKm0c6baAC/wIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From 7c050acc2559c622b831d9193e2336c15f42de6d Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 31 Jan 2013 19:40:32 +0100 Subject: subnet conflict! commented albi10 Subnet --- retiolum/hosts/albi10 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'retiolum') diff --git a/retiolum/hosts/albi10 b/retiolum/hosts/albi10 index 5f152a1f..27ab9c8d 100644 --- a/retiolum/hosts/albi10 +++ b/retiolum/hosts/albi10 @@ -1,5 +1,5 @@ Address = 184.154.13.15 -Subnet = 10.243.0.10 +#Subnet = 10.243.0.10 Subnet = 42:aaa9:4ba3:8c43:bdd8:2cc8:29a0:e8e6/128 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEA0Jz5rQ7NpIQWwhDsrZHlJYAnC1k1onl2ln/6CJbdV9t3gG2hlx/9 -- cgit v1.2.3 From 6ad0524d41d01d1a416685cb67e293f574616316 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 31 Jan 2013 20:09:38 +0100 Subject: readded albi --- retiolum/hosts/albi10 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'retiolum') diff --git a/retiolum/hosts/albi10 b/retiolum/hosts/albi10 index 27ab9c8d..5f152a1f 100644 --- a/retiolum/hosts/albi10 +++ b/retiolum/hosts/albi10 @@ -1,5 +1,5 @@ Address = 184.154.13.15 -#Subnet = 10.243.0.10 +Subnet = 10.243.0.10 Subnet = 42:aaa9:4ba3:8c43:bdd8:2cc8:29a0:e8e6/128 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEA0Jz5rQ7NpIQWwhDsrZHlJYAnC1k1onl2ln/6CJbdV9t3gG2hlx/9 -- cgit v1.2.3 From 9e9fe7208e1db4cac7d9f1c1f6f0df3e19ea2a0c Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 31 Jan 2013 20:11:22 +0100 Subject: fixed Subnet-collision, moved alphalabs --- retiolum/hosts/alphalabs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'retiolum') diff --git a/retiolum/hosts/alphalabs b/retiolum/hosts/alphalabs index e7265e67..0906d835 100644 --- a/retiolum/hosts/alphalabs +++ b/retiolum/hosts/alphalabs @@ -1,6 +1,6 @@ Address = 10.9.0.10 Subnet = 42:0:0:0:0:0:0:a1fa/128 -Subnet = 10.243.0.10/32 +Subnet = 10.243.1.10/32 Compression = 9 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAvUAbMmmOFn+4kOvJAvmi0R/XCQa1YBlkjUvC6Pmt0Q8gV1DodXjB -- cgit v1.2.3 From b0fae17212d9b5897302ec997a104e542b64d667 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 31 Jan 2013 20:24:27 +0100 Subject: removed alphalabs address --- retiolum/hosts/alphalabs | 1 - 1 file changed, 1 deletion(-) (limited to 'retiolum') diff --git a/retiolum/hosts/alphalabs b/retiolum/hosts/alphalabs index 0906d835..a2e1032c 100644 --- a/retiolum/hosts/alphalabs +++ b/retiolum/hosts/alphalabs @@ -1,4 +1,3 @@ -Address = 10.9.0.10 Subnet = 42:0:0:0:0:0:0:a1fa/128 Subnet = 10.243.1.10/32 Compression = 9 -- cgit v1.2.3 From 4e540697f4fbd26c0ec047b763d2b0177008917e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 31 Jan 2013 20:35:35 +0100 Subject: //retiolum update_tinc_hosts: don't modify PATH Don't modify PATH but explicitly locate required executables (i.e. hosts), so no other executables from //retiolum/bin can sneak into update_tinc_hosts. --- retiolum/bin/update_tinc_hosts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'retiolum') diff --git a/retiolum/bin/update_tinc_hosts b/retiolum/bin/update_tinc_hosts index 7be30c2a..ce1be497 100755 --- a/retiolum/bin/update_tinc_hosts +++ b/retiolum/bin/update_tinc_hosts @@ -7,8 +7,12 @@ if test "${nosudo-false}" != true -a `id -u` != 0; then exit 23 # go to hell fi -DIRNAME=`dirname $0` -export PATH="`readlink -f $DIRNAME`:$PATH" +list_hosts="$( + basename="`readlink -f "$0"`" + bindir="`dirname "$basename"`" + echo "$bindir/hosts" +)" +hosts() { "$list_hosts"; } hosts="${hosts-/etc/hosts}" -- cgit v1.2.3 From 0b2528347d6ece0d6bac5b51982d78cdb002c8e8 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 31 Jan 2013 20:45:04 +0100 Subject: //retiolum update-retiolum-hosts: don't HUP/ALRM tincd --- retiolum/bin/update-retiolum-hosts | 2 -- 1 file changed, 2 deletions(-) (limited to 'retiolum') diff --git a/retiolum/bin/update-retiolum-hosts b/retiolum/bin/update-retiolum-hosts index 2a379459..e9fca25c 100755 --- a/retiolum/bin/update-retiolum-hosts +++ b/retiolum/bin/update-retiolum-hosts @@ -12,5 +12,3 @@ cd $(dirname $(readlink -f $0))/.. mkdir -p /etc/tinc/retiolum/hosts cp -v -r hosts/* /etc/tinc/retiolum/hosts -pkill -HUP tincd -pkill -ALRM tincd -- cgit v1.2.3 From 367edf6e568b9d9ac094693e2c6345f120e2a99c Mon Sep 17 00:00:00 2001 From: root Date: Thu, 31 Jan 2013 20:46:22 +0100 Subject: //retiolum update-retiolum-hosts: s/cp/rsync/ Now old hosts will be removed from /etc/tinc/retiolum/hosts. --- retiolum/bin/update-retiolum-hosts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'retiolum') diff --git a/retiolum/bin/update-retiolum-hosts b/retiolum/bin/update-retiolum-hosts index e9fca25c..214ac205 100755 --- a/retiolum/bin/update-retiolum-hosts +++ b/retiolum/bin/update-retiolum-hosts @@ -1,5 +1,5 @@ #! /bin/sh -set -eu +set -euf if test "${nosudo-false}" != true -a `id -u` != 0; then echo "we're going sudo..." >&2 @@ -11,4 +11,4 @@ fi cd $(dirname $(readlink -f $0))/.. mkdir -p /etc/tinc/retiolum/hosts -cp -v -r hosts/* /etc/tinc/retiolum/hosts +rsync -va --delete hosts/ /etc/tinc/retiolum/hosts/ -- cgit v1.2.3 From 453593943e41edc1b55372951af1e3b2768e59c0 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 31 Jan 2013 21:13:44 +0100 Subject: //retiolum patch-retiolum-hosts: allow --reverse --- retiolum/Makefile | 2 +- retiolum/bin/apply-custom-hosts-patches | 8 -------- retiolum/bin/patch-retiolum-hosts | 13 +++++++++++++ 3 files changed, 14 insertions(+), 9 deletions(-) delete mode 100755 retiolum/bin/apply-custom-hosts-patches create mode 100755 retiolum/bin/patch-retiolum-hosts (limited to 'retiolum') diff --git a/retiolum/Makefile b/retiolum/Makefile index f3424dea..b3a3c124 100755 --- a/retiolum/Makefile +++ b/retiolum/Makefile @@ -29,4 +29,4 @@ startup: hosts: bin/update-retiolum-hosts || :; - sudo bin/apply-custom-hosts-patches + sudo bin/patch-retiolum-hosts diff --git a/retiolum/bin/apply-custom-hosts-patches b/retiolum/bin/apply-custom-hosts-patches deleted file mode 100755 index 2b2fda80..00000000 --- a/retiolum/bin/apply-custom-hosts-patches +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/sh -set -euf - -patch=/etc/tinc/retiolum/hosts.patch - -if test -e $patch; then - patch -N -d /etc/tinc/retiolum/hosts -r - < $patch -fi diff --git a/retiolum/bin/patch-retiolum-hosts b/retiolum/bin/patch-retiolum-hosts new file mode 100755 index 00000000..69d7b92c --- /dev/null +++ b/retiolum/bin/patch-retiolum-hosts @@ -0,0 +1,13 @@ +#! /bin/sh +# +# Apply custom retiolum hosts patches, if any. +# +# usage: patch-retiolum-hosts [--reverse] +# +set -euf + +patch=/etc/tinc/retiolum/hosts.patch + +if test -e $patch; then + patch -N -d /etc/tinc/retiolum/hosts -r - "$@" < $patch +fi -- cgit v1.2.3 From f2992565ab8be0544ae328c3d11243131a3b7441 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 2 Feb 2013 00:19:20 +0100 Subject: //retiolum list-known-public-addresses: initial commit --- retiolum/bin/list-known-public-addresses | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 retiolum/bin/list-known-public-addresses (limited to 'retiolum') diff --git a/retiolum/bin/list-known-public-addresses b/retiolum/bin/list-known-public-addresses new file mode 100755 index 00000000..d157cea4 --- /dev/null +++ b/retiolum/bin/list-known-public-addresses @@ -0,0 +1,28 @@ +#! /bin/sh +# +# printf '%s %s\n' hostname IP-address for each known public retiolum address +# +set -eu + +cd /etc/tinc/retiolum/hosts + +grep --with-filename '^Address' * | +sed ' + # filter "%s %s %s\n" hostname var val + s/: */ / + s/ *= */ / + # filter "%s %s\n" hostname address + s/ Address \([a-zA-Z0-9.:_]*\) \?.*/ \1/ + T + # prepare hostname lookup + /:/!{/ [0-9.]*$/!{s/ / `dig +short /;s/$/` \&/}} + s/^/echo / + $s/$/\nwait/ + # perform hostname lookup +' | sh | sed ' + # drop private IPv4 addresses + / 10\./d + / 172\.\(1[6-9]\|2[0-9]\|3[01]\)\./d + / 192\.168\./d + # TODO drop private IPv6 addresses +' -- cgit v1.2.3 From c6f8c72d483fdcdf2ba4554ca7f578089df9f1c2 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 2 Feb 2013 01:22:08 +0100 Subject: //retiolum list-known-public-addresses: factorize --- retiolum/bin/list-known-public-addresses | 46 +++++++++++++++++--------------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'retiolum') diff --git a/retiolum/bin/list-known-public-addresses b/retiolum/bin/list-known-public-addresses index d157cea4..d8073791 100755 --- a/retiolum/bin/list-known-public-addresses +++ b/retiolum/bin/list-known-public-addresses @@ -4,25 +4,29 @@ # set -eu -cd /etc/tinc/retiolum/hosts +_list_hostname_address() { + cd /etc/tinc/retiolum/hosts + grep --with-filename '^Address' * | + sed -n ' + s/: */ / + s/ *= */ / + s/ Address \([a-zA-Z0-9.:_]*\) \?.*/ \1/p' +} +_lookup_address() { + sed ' + /:/!{/ [0-9.]*$/!{s/ / `dig +short /;s/$/` \&/}} + s/^/echo / + $s/$/\nwait/ + ' | sh +} +_filter_public() { + sed ' + # drop private IPv4 addresses + / 10\./d + / 172\.\(1[6-9]\|2[0-9]\|3[01]\)\./d + / 192\.168\./d + # TODO drop private IPv6 addresses + ' +} -grep --with-filename '^Address' * | -sed ' - # filter "%s %s %s\n" hostname var val - s/: */ / - s/ *= */ / - # filter "%s %s\n" hostname address - s/ Address \([a-zA-Z0-9.:_]*\) \?.*/ \1/ - T - # prepare hostname lookup - /:/!{/ [0-9.]*$/!{s/ / `dig +short /;s/$/` \&/}} - s/^/echo / - $s/$/\nwait/ - # perform hostname lookup -' | sh | sed ' - # drop private IPv4 addresses - / 10\./d - / 172\.\(1[6-9]\|2[0-9]\|3[01]\)\./d - / 192\.168\./d - # TODO drop private IPv6 addresses -' +_list_hostname_address | _lookup_address | _filter_public -- cgit v1.2.3 From e929315a0b734aab77a68bcfa41f24faf28b8896 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 2 Feb 2013 01:31:29 +0100 Subject: //retiolum list-known-public-addresses: add online filter --- retiolum/bin/list-known-public-addresses | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'retiolum') diff --git a/retiolum/bin/list-known-public-addresses b/retiolum/bin/list-known-public-addresses index d8073791..00d8d4b9 100755 --- a/retiolum/bin/list-known-public-addresses +++ b/retiolum/bin/list-known-public-addresses @@ -28,5 +28,11 @@ _filter_public() { # TODO drop private IPv6 addresses ' } +_filter_online() { + awk ' + {print"nc -zw 2 "$2" 655 2>/dev/null && echo "$1" "$2" &"} + END {print"wait"} + ' | sh +} -_list_hostname_address | _lookup_address | _filter_public +_list_hostname_address | _lookup_address | _filter_public | _filter_online -- cgit v1.2.3 From ae5b25d9c15b598460e44f2fc54168936abaca81 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 2 Feb 2013 01:50:33 +0100 Subject: //retiolum list-known-public-addresses: don't check if online --- retiolum/bin/list-known-public-addresses | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'retiolum') diff --git a/retiolum/bin/list-known-public-addresses b/retiolum/bin/list-known-public-addresses index 00d8d4b9..21b1c389 100755 --- a/retiolum/bin/list-known-public-addresses +++ b/retiolum/bin/list-known-public-addresses @@ -35,4 +35,4 @@ _filter_online() { ' | sh } -_list_hostname_address | _lookup_address | _filter_public | _filter_online +_list_hostname_address | _lookup_address | _filter_public -- cgit v1.2.3 From a5974cc70cd35e6c5daeecc09f8bde687975ba9c Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 3 Feb 2013 11:34:08 +0100 Subject: added Discordius (lassulus' Bruder) --- retiolum/hosts/Discordius | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 retiolum/hosts/Discordius (limited to 'retiolum') diff --git a/retiolum/hosts/Discordius b/retiolum/hosts/Discordius new file mode 100644 index 00000000..561b28ca --- /dev/null +++ b/retiolum/hosts/Discordius @@ -0,0 +1,11 @@ +Subnet = 10.243.144.246 +Subnet = 42:017a:4584:17e1:685a:3991:6533:067b + +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEAsOoWkyydyfW9ml7SBV8d+qXU8E1c4l0vEpdBnmOouZozo1bzzkH3 +bLn2DkZaOLCqVUC1twbeGi2a7tXHh4dLvkIcT38V3XbEwxHhMn7enpKr79GO/VFf +Lu8t5dLbmPFFTOEeC54ke8X4MdlMrUMuXiGspnl/vc1NBSJIVECl6zdqvZt/UTWA +vI7evk3F+Tf5dPATqSMdxE5506i2y/W6obwYwaXdPbyBsAQkgdTjfVUe2u0GKfld +/THprmZYTwlBEZ3YAf12OdfO1aRsDpbogpZs/rcnebScDj7myzh7FkLHdH9nIfxg +dfGxSBV7kRMwQmgfKjp/yETPjvRz0OMZoQIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From 5b87cdd1f83e8191f01ac9e9c3441e2a47874a20 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Feb 2013 13:10:05 +0100 Subject: retiolum/hosts/nomic2: test dummy --- retiolum/hosts/nomic2 | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 retiolum/hosts/nomic2 (limited to 'retiolum') diff --git a/retiolum/hosts/nomic2 b/retiolum/hosts/nomic2 new file mode 100644 index 00000000..63d83ff5 --- /dev/null +++ b/retiolum/hosts/nomic2 @@ -0,0 +1,10 @@ +Subnet = 10.243.0.111/32 +Subnet = 42:02d5:733f:d6da:c0f5:2bb7:2b18:09ed/128 +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEA4RATrMG+MJyNq77+qUqoXkBIpUeytIvUNXT5OdvU5v91Xo2eGI23 +NXiFtILDb1nEPB+L4vVWkUKRuPAy+ThgqgTH1vyugT6jRoRhWWmGmSn2GjaF+UxK +edTfGJqO0Iwn0kZsIFxXUibkmG5iRbJBoPXXz33VtNxOv2gZZ6klfv/pYWnrxmLm +RZXkE1H3Y0U2ulQEXvpexzVscfYmlAw7h0Ew4aaY2LK4spLLPjx9RdDgfwZOZdS+ +gi5cmi/qM71/o67/4XippR9+7GQ8YecbeoR4bcZpDNoDy1ri7HPPu/t6CiqsYVyg +jYGBm+IGbwI9hxGel2bXCVBGLE7gpN51TwIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3