From 7e4133c6bf3edcefbb1ca3e94ad77c1696c477c7 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 12 Jan 2013 19:21:27 +0000 Subject: nfcgate: initial commit --- retiolum/hosts/nfcgate | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 retiolum/hosts/nfcgate diff --git a/retiolum/hosts/nfcgate b/retiolum/hosts/nfcgate new file mode 100644 index 00000000..e3936b07 --- /dev/null +++ b/retiolum/hosts/nfcgate @@ -0,0 +1,10 @@ +Subnet = 10.243.32.21 +Subnet = 42:9ca7:c370:a9d9:ee1b:623b:7fe6:5146 +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEApPJKpk2vFwG0GSjl/Sg2IMfala2bOYSnTDO13AHIuybfmNr3H3O7 +exJ/ALN5lqnVOU5pL9GyORnAEEeaVI+eGJmQJwTtQExoLo3o12YT+mDV8YFYVqo8 +ZYQqxLlNO1gNKNDHPlZoCmwtavmv8jqGyitjCT8ZHDHiGl/ugddNOwfFHcSM1a9c +rAM4+D3Qu8YCIC3txcww77UtbFZVBQDG3UxkGbqNeD7Je1QHyZxPs0Oqj3aIYHLP +MW4H4360dW8+3U12bwYU4viD/uyCflrFvI2nY47GzF2MakC7UeUEiVDw7U9627wq +ra6GQebx7NRZjg/pTy77uxj7RFIHRFyIEQIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From b6144a1e1b24a82d479741edd12fa3ad7a744c58 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 14 Jan 2013 00:50:08 +0000 Subject: nfcgate -> nfcgate_298dbf07 --- retiolum/hosts/nfcgate | 10 ---------- retiolum/hosts/nfcgate_298dbf07 | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 retiolum/hosts/nfcgate create mode 100644 retiolum/hosts/nfcgate_298dbf07 diff --git a/retiolum/hosts/nfcgate b/retiolum/hosts/nfcgate deleted file mode 100644 index e3936b07..00000000 --- a/retiolum/hosts/nfcgate +++ /dev/null @@ -1,10 +0,0 @@ -Subnet = 10.243.32.21 -Subnet = 42:9ca7:c370:a9d9:ee1b:623b:7fe6:5146 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEApPJKpk2vFwG0GSjl/Sg2IMfala2bOYSnTDO13AHIuybfmNr3H3O7 -exJ/ALN5lqnVOU5pL9GyORnAEEeaVI+eGJmQJwTtQExoLo3o12YT+mDV8YFYVqo8 -ZYQqxLlNO1gNKNDHPlZoCmwtavmv8jqGyitjCT8ZHDHiGl/ugddNOwfFHcSM1a9c -rAM4+D3Qu8YCIC3txcww77UtbFZVBQDG3UxkGbqNeD7Je1QHyZxPs0Oqj3aIYHLP -MW4H4360dW8+3U12bwYU4viD/uyCflrFvI2nY47GzF2MakC7UeUEiVDw7U9627wq -ra6GQebx7NRZjg/pTy77uxj7RFIHRFyIEQIDAQAB ------END RSA PUBLIC KEY----- diff --git a/retiolum/hosts/nfcgate_298dbf07 b/retiolum/hosts/nfcgate_298dbf07 new file mode 100644 index 00000000..e3936b07 --- /dev/null +++ b/retiolum/hosts/nfcgate_298dbf07 @@ -0,0 +1,10 @@ +Subnet = 10.243.32.21 +Subnet = 42:9ca7:c370:a9d9:ee1b:623b:7fe6:5146 +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEApPJKpk2vFwG0GSjl/Sg2IMfala2bOYSnTDO13AHIuybfmNr3H3O7 +exJ/ALN5lqnVOU5pL9GyORnAEEeaVI+eGJmQJwTtQExoLo3o12YT+mDV8YFYVqo8 +ZYQqxLlNO1gNKNDHPlZoCmwtavmv8jqGyitjCT8ZHDHiGl/ugddNOwfFHcSM1a9c +rAM4+D3Qu8YCIC3txcww77UtbFZVBQDG3UxkGbqNeD7Je1QHyZxPs0Oqj3aIYHLP +MW4H4360dW8+3U12bwYU4viD/uyCflrFvI2nY47GzF2MakC7UeUEiVDw7U9627wq +ra6GQebx7NRZjg/pTy77uxj7RFIHRFyIEQIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From abd83a5b91c00390300de40b8ada651212efe9a6 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 14 Jan 2013 15:14:46 +0100 Subject: retiolum find_super: parallel lookup --- retiolum/scripts/adv_graphgen/find_super | 37 +++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 13 deletions(-) mode change 100644 => 100755 retiolum/scripts/adv_graphgen/find_super diff --git a/retiolum/scripts/adv_graphgen/find_super b/retiolum/scripts/adv_graphgen/find_super old mode 100644 new mode 100755 index c89a94fb..e971e204 --- a/retiolum/scripts/adv_graphgen/find_super +++ b/retiolum/scripts/adv_graphgen/find_super @@ -1,14 +1,25 @@ -#!/bin/sh -cd /etc/tinc/retiolum/hosts -ls -1 . | while read fname; -do - for i in `sed -n 's/Address\s*=\s*\(.*\)/\1/p' $fname`;do - if nc -zw 5 $i 655 2>/dev/null; then - echo "$fname - $i reachable" - #else - #echo -n - #echo "$fname - $i unreachable" +#! /bin/dash +set -euf +case "${1-all}" in + (all) + find /etc/tinc/retiolum/hosts -type f | + xargs -P 423 -n 1 "$0" one + ;; + (one) + hosts_file=$2 + name=$(basename $hosts_file) - fi - done -done + if grep -q Address $hosts_file; then + script="$(sed -n ' + s/[[:space:]]*//g + s/^\(Address\|Port\)=\(.*\)/\1="${\1+$\1 }\2"/p + ' $hosts_file)" + eval "$script" + for address in ${Address-}; do + if nc -zw 2 $address 655 2>/dev/null; then + echo $name - $address reachable + fi & + done + wait + fi +esac -- cgit v1.2.3 From 3b6a2e967d075145613faffa63ea9399fb6f1800 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 14 Jan 2013 16:05:20 +0100 Subject: retiolum find_super: replace xargs with for&wait --- retiolum/scripts/adv_graphgen/find_super | 44 +++++++++++++++----------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/retiolum/scripts/adv_graphgen/find_super b/retiolum/scripts/adv_graphgen/find_super index e971e204..17a0c8c0 100755 --- a/retiolum/scripts/adv_graphgen/find_super +++ b/retiolum/scripts/adv_graphgen/find_super @@ -1,25 +1,21 @@ #! /bin/dash -set -euf -case "${1-all}" in - (all) - find /etc/tinc/retiolum/hosts -type f | - xargs -P 423 -n 1 "$0" one - ;; - (one) - hosts_file=$2 - name=$(basename $hosts_file) - - if grep -q Address $hosts_file; then - script="$(sed -n ' - s/[[:space:]]*//g - s/^\(Address\|Port\)=\(.*\)/\1="${\1+$\1 }\2"/p - ' $hosts_file)" - eval "$script" - for address in ${Address-}; do - if nc -zw 2 $address 655 2>/dev/null; then - echo $name - $address reachable - fi & - done - wait - fi -esac +set -eu +cd /etc/tinc/retiolum/hosts +for name in ` + grep '^[[:space:]]*Address[[:space:]]*=' * | + cut -d: -f1 | sort | uniq +`; do + if eval "`sed -n ' + s/[[:space:]]\+//g + s/^\(Address\|Port\)=\(.*\)/\1="\${\1+\$\1\n}\2"/p + ' $name`"; then + port=${Port-655} + for host in $Address; do + if nc -zw 2 $host $port 2>/dev/null; then + echo $name - $host reachable + fi & + done + wait + fi & +done +wait -- cgit v1.2.3 From bce6236eb787c047cfee496640533676d6dfeb45 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 14 Jan 2013 16:06:08 +0100 Subject: retiolum find_super: use same output format as find_super.py --- retiolum/scripts/adv_graphgen/find_super | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retiolum/scripts/adv_graphgen/find_super b/retiolum/scripts/adv_graphgen/find_super index 17a0c8c0..2c316d0e 100755 --- a/retiolum/scripts/adv_graphgen/find_super +++ b/retiolum/scripts/adv_graphgen/find_super @@ -12,7 +12,7 @@ for name in ` port=${Port-655} for host in $Address; do if nc -zw 2 $host $port 2>/dev/null; then - echo $name - $host reachable + echo "$name [('$host', $port)]" fi & done wait -- cgit v1.2.3 From 47a6395ee891488be4becd1f3292bd28811f0069 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 14 Jan 2013 16:36:13 +0100 Subject: retiolum apply-custom-hosts-patches: initial commit Custom hosts patches are currently used for "LAN supernodes". Example patch: --- destroy 2012-05-12 04:13:57.081041849 +0100 +++ destroy 2013-01-13 18:35:30.087707751 +0100 @@ -1,3 +1,4 @@ +Address = destroy.local Subnet = 42:9277:1f1e:7599:ae4b:7cca:b4a3:fe47/128 Subnet = 10.243.0.31/32 Compression = 9 --- retiolum/Makefile | 1 + retiolum/bin/apply-custom-hosts-patches | 8 ++++++++ 2 files changed, 9 insertions(+) mode change 100644 => 100755 retiolum/Makefile create mode 100755 retiolum/bin/apply-custom-hosts-patches diff --git a/retiolum/Makefile b/retiolum/Makefile old mode 100644 new mode 100755 index a8ae0973..f3424dea --- a/retiolum/Makefile +++ b/retiolum/Makefile @@ -29,3 +29,4 @@ startup: hosts: bin/update-retiolum-hosts || :; + sudo bin/apply-custom-hosts-patches diff --git a/retiolum/bin/apply-custom-hosts-patches b/retiolum/bin/apply-custom-hosts-patches new file mode 100755 index 00000000..2b2fda80 --- /dev/null +++ b/retiolum/bin/apply-custom-hosts-patches @@ -0,0 +1,8 @@ +#! /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 -- cgit v1.2.3 From eb270708aad6e4e878228bc8075afca5990b8416 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 15 Jan 2013 12:12:17 +0000 Subject: add kvasir --- retiolum/hosts/kvasir | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 retiolum/hosts/kvasir diff --git a/retiolum/hosts/kvasir b/retiolum/hosts/kvasir new file mode 100644 index 00000000..6e5772a5 --- /dev/null +++ b/retiolum/hosts/kvasir @@ -0,0 +1,10 @@ +Subnet = 10.243.222.181 +Subnet = 42:77e5:5496:7cd9:78aa:c4ab:ca70:6860 +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEAv8wui/1n4VhSd8BK1yswCrHydiYFx/+5Jdi7cB+S+qJU0FCsKs7i +9BdrTcJ+djBn6WXA6UXSHtQxoRPqT4OH9nW4HnXaMGvJJbJhHtX6C/Kun1p66zUE +oEBV0+WqSvN7+xgsMxoXjxB4YMmvMyI5zSl0uEx3sBfvkftoISQHruD3PoWInE9H +CfVcuk1qzvsbk23uEyGjS1k6z0rI/HunmcEHw1r3oTAgFg7ZXH9ElCBBDbwECjMI +x+DREZlH3kqJ/W4ulg6+tf9bh/22oBbJu2H4hza9k8lx4z1jUARqeJVhNVKOiyXM +l8rFUiGAXortMoSlslnPXvShSuskMJP2CQIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From 0373e52441bad0fcf37ad5f953ecde51886bfce0 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 15 Jan 2013 16:12:34 +0000 Subject: adv_graphgen: remove temporary data properly --- retiolum/scripts/adv_graphgen/anonytize.sh | 6 +++--- retiolum/scripts/adv_graphgen/sanitize.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/retiolum/scripts/adv_graphgen/anonytize.sh b/retiolum/scripts/adv_graphgen/anonytize.sh index b31f4dbb..2e2045e4 100755 --- a/retiolum/scripts/adv_graphgen/anonytize.sh +++ b/retiolum/scripts/adv_graphgen/anonytize.sh @@ -9,8 +9,8 @@ LOG_FILE=${LOG_FILE:-/var/log/syslog} TYPE=svg TYPE2=png OPENER=/bin/true -DOTFILE=`mktemp` -trap 'rm $DOTFILE' INT TERM +DOTFILE=`mktemp --suffix=anon` +trap 'rm $DOTFILE' INT TERM KILL sudo -E python tinc_stats2json |\ python parse_tinc_anon.py> $DOTFILE @@ -24,7 +24,7 @@ do mv $tmpgraph $1/retiolum_$i.$TYPE i=`expr $i + 1` done -#convert -resize 20% $1/retiolum_1.$TYPE $1/retiolum_1.$TYPE2 +convert $1/retiolum_1.$TYPE $1/retiolum_1.$TYPE2 #convert -resize 20% $1/retiolum_2.$TYPE $1/retiolum_2.$TYPE2 #convert -resize 20% $1/retiolum_3.$TYPE $1/retiolum_3.$TYPE2 #convert -resize 20% $1/retiolum_4.$TYPE $1/retiolum_4.$TYPE2 diff --git a/retiolum/scripts/adv_graphgen/sanitize.sh b/retiolum/scripts/adv_graphgen/sanitize.sh index 45d29a22..846cc549 100755 --- a/retiolum/scripts/adv_graphgen/sanitize.sh +++ b/retiolum/scripts/adv_graphgen/sanitize.sh @@ -9,8 +9,8 @@ LOG_FILE=${LOG_FILE:-/var/log/syslog} TYPE=svg TYPE2=png OPENER=/bin/true -DOTFILE=`mktemp` -trap 'rm $DOTFILE' INT TERM +DOTFILE=`mktemp --suffix=san` +trap 'rm $DOTFILE' INT TERM KILL sudo -E python tinc_stats2json |\ python parse_tinc_stats.py > $DOTFILE @@ -25,7 +25,7 @@ do i=`expr $i + 1` done -#convert -resize 20% $1/retiolum_1.$TYPE $1/retiolum_1.$TYPE2 +convert $1/retiolum_1.$TYPE $1/retiolum_1.$TYPE2 #convert -resize 20% $1/retiolum_2.$TYPE $1/retiolum_2.$TYPE2 #convert -resize 20% $1/retiolum_3.$TYPE $1/retiolum_3.$TYPE2 #convert -resize 20% $1/retiolum_4.$TYPE $1/retiolum_4.$TYPE2 -- cgit v1.2.3 From db9e0afc9391f0a94d072ea7b9a531c5dd9a4c42 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Wed, 16 Jan 2013 01:49:48 +0100 Subject: added slowpoke --- retiolum/hosts/slowpoke | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 retiolum/hosts/slowpoke diff --git a/retiolum/hosts/slowpoke b/retiolum/hosts/slowpoke new file mode 100644 index 00000000..b0ce6ba1 --- /dev/null +++ b/retiolum/hosts/slowpoke @@ -0,0 +1,12 @@ +Subnet = 10.243.232.121 +Subnet = 42:7d8f:9e3a:dcc7:9b22:d1ca:7e28:fe9c + +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEA9EtaOHLa0CyOGpX3rzMLqi9HqrjzVe3XdSfcb9QPYwcbxpPYNLLk +/1+4vxOI/TEh1QCu0bzPLy8tAwKF2DwnCH72yae17I0jVMW29Ng3Fdjzb3SmWJbf +C87X7c+Nx5+Yc7OIdvTi/BGPNpDEp7nJugubH1whSFfulCDbsGU3rX5IsDUiw4ha +B+5wH1coQl+Yp+M1ws5+PoHgYQ/ApYPBKEn+H7JAdnOTLbo0eI3B1PuDUrsMakMq +s4f74d2Z405xUGHhRRcerF0h5VD58TADxx7RSRd7oR06KlXM/RaqOkw9vzvA2vBq +CC+LdtIV7wWxF3uRAnk6odeFvqZTHvR4WQIDAQAB +-----END RSA PUBLIC KEY----- + -- cgit v1.2.3 From 4c0f7bb3e49f78731a4e31436caf22b074fc81c3 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Wed, 16 Jan 2013 01:50:15 +0100 Subject: added Address --- retiolum/hosts/slowpoke | 1 + 1 file changed, 1 insertion(+) diff --git a/retiolum/hosts/slowpoke b/retiolum/hosts/slowpoke index b0ce6ba1..e5cf70bf 100644 --- a/retiolum/hosts/slowpoke +++ b/retiolum/hosts/slowpoke @@ -1,3 +1,4 @@ +Address = 81.89.96.210 Subnet = 10.243.232.121 Subnet = 42:7d8f:9e3a:dcc7:9b22:d1ca:7e28:fe9c -- cgit v1.2.3 From 5263d84feb9cf3e96c6993a04446e1ad627de85f Mon Sep 17 00:00:00 2001 From: Lassulus Date: Wed, 16 Jan 2013 14:28:11 +0100 Subject: s/supernode/slowpoke/ --- retiolum/scripts/tinc_setup/install.sh | 2 +- retiolum/scripts/tinc_setup/new_install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/retiolum/scripts/tinc_setup/install.sh b/retiolum/scripts/tinc_setup/install.sh index a72d2b8b..9efe863c 100755 --- a/retiolum/scripts/tinc_setup/install.sh +++ b/retiolum/scripts/tinc_setup/install.sh @@ -65,7 +65,7 @@ Name = $myname ConnectTo = euer ConnectTo = albi10 ConnectTo = pigstarter -ConnectTo = supernode +ConnectTo = slowpoke Device = /dev/net/tun EOF diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 85a61be8..e07ecff0 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -340,7 +340,7 @@ LocalDiscovery = yes AutoConnect = 3 #ConnectTos -ConnectTo = supernode +ConnectTo = slowpoke ConnectTo = pigstarter ConnectTo = pico EOF -- cgit v1.2.3 From 786c68422411e838efc707a27ae1fc3face765d4 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Wed, 16 Jan 2013 14:44:08 +0100 Subject: removed redundant host detection --- retiolum/scripts/tinc_setup/new_install.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index e07ecff0..fdf0bf04 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -241,11 +241,6 @@ do esac done -#check for OS -if [ $OS -eq 0 ]; then - find_os -fi - #check if everything is installed if [ $OS -eq 2 ]; then if ! test -e /data/data/org.poirsouille.tinc_gui/files/tincd; then -- cgit v1.2.3 From 8660cde95b4f052cfbb74015c71340cb0661d5ba Mon Sep 17 00:00:00 2001 From: Lassulus Date: Wed, 16 Jan 2013 14:58:47 +0100 Subject: removed getopts --- retiolum/scripts/tinc_setup/new_install.sh | 85 ------------------------------ 1 file changed, 85 deletions(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index fdf0bf04..4dc973d9 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -40,30 +40,6 @@ IP6=${IP6:-0} RAND4=1 RAND6=1 -usage() -{ -cat << EOF -usage $0 options -This script gets you into the KREBS Darknet -all parameters are optional - -Options: - -h Show this message(haha) - -4 \$ipv4 specify an ip(version 4), this also disables random ip mode, default is random - -6 \$ipv6 specify an ip(version 6), this also disables random ip mode, default is random - -s \$SUBNET Choose another Subnet(version4), default is 10.243 - -x \$SUBNET Choose another Subnet(version6), default is 42 - -m \$MASK Choose another Subnet Mask(version4), default is 16 - -j \$MASK Choose another Subnet Mask(version6), default is 16 - -t \$DIR Choose another Temporary directory, default is /tmp/tinc-install-fu - -o \$HOST Choose another Hostname, default is your system hostname - -n \$NET Choose another tincd netname,this also specifies the path to your tinc config, default is retiolum - -u \$URL specify another hostsfiles.tar.gz url, default is http://euer.krebsco.de/retiolum/hosts.tar.gz - -l \$OS specify an OS, numeric parameter.0=Automatic 1=Linux 2=Android, disables automatic OS-finding, default is 0 - -r \$ADDR give the node an reachable remote address, ipv4 or dns -EOF -} - #convert hostmask to subnetmask only version 4 host2subnet() { @@ -180,67 +156,6 @@ if ! $(ping -c 1 -W 5 euer.krebsco.de 1>/dev/null) ;then exit 1 fi - -#parse options -while getopts "h4:6:s:x:m:j:t:o:n:u:l:" OPTION -do - case $OPTION in - h) - usage - exit 1 - ;; - 4) - IP4=$OPTARG - RAND4=0 - if ! check_ip_valid4 $IP4; then echo "ipv4 is invalid" && exit 1; fi - ;; - 6) - IP6=$OPTARG - RAND6=0 - if ! check_ip_valid6 $IP6; then echo "ipv6 is invalid" && exit 1; fi - ;; - s) - SUBNET4=$OPTARG - ;; - x) - SUBNET6=$OPTARG - ;; - m) - MASK4=$OPTARG - ;; - j) - MASK6=$OPTARG - ;; - t) - TEMPDIR=$OPTARG - ;; - o) - HOSTN=$OPTARG - ;; - n) - NETNAME=$OPTARG - ;; - u) - URL=$OPTARG - if $(! curl -s --head $URL | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null); then - echo "url not reachable" - exit 1 - fi - ;; - l) - OS=$OPTARG - if ! [ "$(echo $OS | awk -F"." ' $0 ~ /^[0-2]$/' )" == $OS ]; then - echo "invalid input for OS" - exit 1 - fi - ;; - r) - ADDR=$OPTARG - ;; - - esac -done - #check if everything is installed if [ $OS -eq 2 ]; then if ! test -e /data/data/org.poirsouille.tinc_gui/files/tincd; then -- cgit v1.2.3 From dd3cedb311e3980d78e046a5b49f787758597d9a Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 19 Jan 2013 22:06:17 +0100 Subject: rubus: rekeying --- retiolum/hosts/rubus | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/retiolum/hosts/rubus b/retiolum/hosts/rubus index 0ba98c0d..e5f0a729 100644 --- a/retiolum/hosts/rubus +++ b/retiolum/hosts/rubus @@ -1,11 +1,10 @@ -Subnet = 10.243.137.174 -Subnet = 42:7941:278b:bd29:f0ab:9c09:e5e9:7965 - +Subnet = 10.0.7.7.55 +Subnet = 42:537a:0c95:6315:6598:e109:74b2:0887/128 -----BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAznS+XyF278SXTVgK9OG8SDu+pffDZtBeYfyyNHAVt/2EeE3cfIJZ -3iBXMcD8/yelCWMY6S+MNNnP+KqyCCVuG8rvhpMjB/RGzqLFSTLZoQOmC/O9S3i3 -TKKr4zxyBxjSFAPSOeHbrERAyREg/GNrLxX/SzT/yOgRDjZLA1Z5CgunXVeiB7BF -9jL1U6AahFD/6NzaPAc4+mSAQJzGw4P5TeVvAlhf96x5I0sBc09Vu87sL9NJOpi8 -hqWYhLWjZF4CRusjV3SL9kUj668CZO1S9Ooe3FO37Pa0fftDLQekCpBDrtoNr6LW -O2BYBEXsQn5ooZgAysm7mi9Hbdc3dPl5/QIDAQAB +MIIBCgKCAQEAqudpo1cC1ETPA3d16cNTAwwud195Yetdx32ty5/VkY2KgLnnl672 +XTPZBVhFppG+NU6QIYq2c0+BdUV+42XNnSeTKy79xr49eSMDaAXuWiX4eY8dh4v9 +n7elTWikzTaElS5SI3wcJPz8SdajWclnRkqXbyMY7Pw7uJMgT3svC/chN8tgp1LT +2s1DdvxaHhnFPef2NQvIWgfgytReLB8dQnSYoAiwIGvNXQT4OXgshJkTAwmok/Sq +io8K1FeJyOranBM/ZyYbQWMEXuknoJ9PXKPbrGjD+ftS18Gs75ODWqh/Bpj75rpT +q6HLJv6H6YpToxueTL1iYM00MNW4g/oPZQIDAQAB -----END RSA PUBLIC KEY----- -- cgit v1.2.3 From 1f21051e9361de9bfdf70f269c90c25cbdbe2b43 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 20 Jan 2013 19:22:16 +0100 Subject: nfc-login: add mrled --- minikrebs/profiles/instakrebs/customfiles/etc/rc.d/tinc | 1 - .../profiles/nfc-login/customfiles/usr/bin/login-manager | 14 +++++++------- minikrebs/profiles/nfc-login/customfiles/usr/bin/mrled | 4 ++++ 3 files changed, 11 insertions(+), 8 deletions(-) delete mode 120000 minikrebs/profiles/instakrebs/customfiles/etc/rc.d/tinc create mode 100755 minikrebs/profiles/nfc-login/customfiles/usr/bin/mrled diff --git a/minikrebs/profiles/instakrebs/customfiles/etc/rc.d/tinc b/minikrebs/profiles/instakrebs/customfiles/etc/rc.d/tinc deleted file mode 120000 index f08fe11d..00000000 --- a/minikrebs/profiles/instakrebs/customfiles/etc/rc.d/tinc +++ /dev/null @@ -1 +0,0 @@ -../init.d/tinc \ No newline at end of file diff --git a/minikrebs/profiles/nfc-login/customfiles/usr/bin/login-manager b/minikrebs/profiles/nfc-login/customfiles/usr/bin/login-manager index 63f35c74..f22a209e 100755 --- a/minikrebs/profiles/nfc-login/customfiles/usr/bin/login-manager +++ b/minikrebs/profiles/nfc-login/customfiles/usr/bin/login-manager @@ -1,18 +1,18 @@ #!/bin/sh -#!/bin/sh #LOGIN_HOST=heidi.shack #LOGIN_HOST=heidi:5000 LOGIN_HOST=10.42.10.38:5000 all_led(){ - for i in 3g wlan lan wps;do - led $i $1 - done + for i in 3g wlan lan wps;do + led $i $1 + + done } led(){ - LED="$1" - ACTION="$2" - echo $ACTION > /sys/class/leds/tp-link:green:$LED/trigger + /usr/bin/mrled $1 $2 } + +# fix for mr3020 weirdness while sleep 1; do uid=$(nfc-list | grep UID | cut -d: -f 2 | sed 's/ //g') if ! [ x"$uid" = x ];then diff --git a/minikrebs/profiles/nfc-login/customfiles/usr/bin/mrled b/minikrebs/profiles/nfc-login/customfiles/usr/bin/mrled new file mode 100755 index 00000000..7059edd1 --- /dev/null +++ b/minikrebs/profiles/nfc-login/customfiles/usr/bin/mrled @@ -0,0 +1,4 @@ +#!/bin/sh +LED="$1" +ACTION="$2" +echo $ACTION > /sys/class/leds/tp-link:green:$LED/trigger -- cgit v1.2.3 From 715b2e23b0cb347dbf6b6516e5811e45406324ac Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 20 Jan 2013 19:24:19 +0100 Subject: minikrebs: init_overlay now does the right thing --- minikrebs/profiles/init_overlay | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) mode change 100644 => 100755 minikrebs/profiles/init_overlay diff --git a/minikrebs/profiles/init_overlay b/minikrebs/profiles/init_overlay old mode 100644 new mode 100755 index 3b714c39..e71cd151 --- a/minikrebs/profiles/init_overlay +++ b/minikrebs/profiles/init_overlay @@ -1,10 +1,22 @@ -#!/bin/sh +#!/bin/bash +cd $(dirname $(readlink -f $0)) [ ! -e overlay/ ] && echo "profile data for external overlay does not exist, bailing out" -[ ! -e doc/overlay ] && echo "Profile demands the following partitioning of the overlay usb stick:" && cat doc/overlay +[ -e doc/overlay ] && echo "Profile demands the following partitioning of the overlay usb stick:" && cat doc/OVERLAY if grep -q $PWD/mnt/overlay /etc/mtab;then - + echo "overlay mounted" + echo "copying overlay data:" + find overlay/ -mindepth 1 -maxdepth 1 | while read data; do + echo " $data -> mnt/overlay/$(basename $data)" + rm -rf mnt/overlay/$(basename $data) + cp -r $data mnt/overlay + done + echo + echo "unmounting overlay" + umount mnt/overlay/ else - echo "please mount your overlay to $PWD/overlay" + mkdir -p $PWD/mnt/overlay + echo "please mount your overlay to $PWD/mnt/overlay" fi + -- cgit v1.2.3 From c00d41c85e4f0b5a7fad0dab7956425cee79a634 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Mon, 21 Jan 2013 20:27:48 +0100 Subject: fix android bug --- retiolum/scripts/tinc_setup/new_install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 4dc973d9..7dcc3a7b 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -163,8 +163,8 @@ if [ $OS -eq 2 ]; then exit 1 else TINCBIN=/data/data/org.poirsouille.tinc_gui/files/tincd - if [ $TINCDIR = 'auto' ]; then TINCDIR=/usr/local/etc/tinc ;fi - if [ $TEMPDIR = 'auto' ]; then TEMPDIR=/data/secure/data ;fi + if [ $TINCDIR = 'auto' ]; then TINCDIR="/usr/local/etc/tinc" ;fi + if [ $TEMPDIR = 'auto' ]; then TEMPDIR="/data/secure/data" ;fi fi else if ! type tincd >/dev/null; then @@ -172,8 +172,8 @@ else exit 1 else TINCBIN=tincd - if [ $TINCDIR = 'auto' ]; then TINCDIR=/etc/tinc ;fi - if [ $TEMPDIR = 'auto' ]; then TEMPDIR=/tmp/tinc-install-fu ;fi + if [ $TINCDIR = 'auto' ]; then TINCDIR="/etc/tinc" ;fi + if [ $TEMPDIR = 'auto' ]; then TEMPDIR="/tmp/tinc-install-fu" ;fi fi fi -- cgit v1.2.3 From e6451bbd74b54702f09c7130348028f1a89b981c Mon Sep 17 00:00:00 2001 From: Lassulus Date: Mon, 21 Jan 2013 21:04:58 +0100 Subject: fixed path on android --- retiolum/scripts/tinc_setup/new_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 7dcc3a7b..9fa8a84b 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -163,7 +163,7 @@ if [ $OS -eq 2 ]; then exit 1 else TINCBIN=/data/data/org.poirsouille.tinc_gui/files/tincd - if [ $TINCDIR = 'auto' ]; then TINCDIR="/usr/local/etc/tinc" ;fi + if [ $TINCDIR = 'auto' ]; then TINCDIR="/etc/tinc" ;fi if [ $TEMPDIR = 'auto' ]; then TEMPDIR="/data/secure/data" ;fi fi else -- cgit v1.2.3 From fbcf1a5714a82d1f7eb6ca9d55625f0c910ee315 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Mon, 21 Jan 2013 22:06:40 +0100 Subject: fixes for android --- retiolum/scripts/tinc_setup/new_install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 9fa8a84b..4552810d 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -163,8 +163,9 @@ if [ $OS -eq 2 ]; then exit 1 else TINCBIN=/data/data/org.poirsouille.tinc_gui/files/tincd - if [ $TINCDIR = 'auto' ]; then TINCDIR="/etc/tinc" ;fi - if [ $TEMPDIR = 'auto' ]; then TEMPDIR="/data/secure/data" ;fi + if [ $TINCDIR = 'auto' ]; then TINCDIR="/usr/local/etc/tinc" ;fi + if [ $TEMPDIR = 'auto' ]; then TEMPDIR="/storage/sdcard0/tinc-fu" ;fi + mount -o remount,rw / fi else if ! type tincd >/dev/null; then -- cgit v1.2.3 From 83619a1e047518dbb3a13666bd97df196f9a978d Mon Sep 17 00:00:00 2001 From: Lassulus Date: Mon, 21 Jan 2013 22:27:16 +0100 Subject: added seruundroid (moritz) --- retiolum/hosts/seruundroid | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 retiolum/hosts/seruundroid diff --git a/retiolum/hosts/seruundroid b/retiolum/hosts/seruundroid new file mode 100644 index 00000000..660673fb --- /dev/null +++ b/retiolum/hosts/seruundroid @@ -0,0 +1,11 @@ +Subnet = 10.243.211.81 +Subnet = 42:d274:9187:9408:d5e7:05f2:ee07:9abd + +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEAryK+xseuc/kPjZb+uPyNiDDW4P9DVLTV/eGowHZrPcn6t7L5CUZp +jl4csKkfJs8TayM9edAitJvC3KWFmdZrV6L9LY1BmAGuJix4wr1WtdkxwC/cUUWE +I9bTqSTGrhSRxKRmO/xSB1za5oIfIQ6vnXZYXPaAFiOQj4B5m5qn79K+d3N3j3MX +BB8BEkQHNuuCTm3JIWTLT6ZSOGgKPCXnV9NR6WwdHS62SBntZQHaheirMQQ7AJAT +kiZTdrPnMap0Qm9xkMbttazgrfVNoOzCJRMOH5EyMEfc69CufOotgfJLg0Ki8aeJ +uY3wX/aLZz2HklVarvuk5gX5RqsmZXswFwIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From 66979215f1cda8b3af4829b809222161714d430d Mon Sep 17 00:00:00 2001 From: Lassulus Date: Mon, 21 Jan 2013 22:41:42 +0100 Subject: fixed device for android --- retiolum/scripts/tinc_setup/new_install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 4552810d..e67ec1c0 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -165,7 +165,8 @@ if [ $OS -eq 2 ]; then TINCBIN=/data/data/org.poirsouille.tinc_gui/files/tincd if [ $TINCDIR = 'auto' ]; then TINCDIR="/usr/local/etc/tinc" ;fi if [ $TEMPDIR = 'auto' ]; then TEMPDIR="/storage/sdcard0/tinc-fu" ;fi - mount -o remount,rw / + mount -o remount,rw / + DEV="/dev/tun" fi else if ! type tincd >/dev/null; then @@ -175,6 +176,7 @@ else TINCBIN=tincd if [ $TINCDIR = 'auto' ]; then TINCDIR="/etc/tinc" ;fi if [ $TEMPDIR = 'auto' ]; then TEMPDIR="/tmp/tinc-install-fu" ;fi + DEV="/dev/net/tun" fi fi @@ -244,7 +246,7 @@ echo "Subnet = $IP6" >> hosts/$HOSTN cat>tinc.conf< Date: Mon, 21 Jan 2013 22:43:24 +0100 Subject: fixed whitespace --- retiolum/scripts/tinc_setup/new_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index e67ec1c0..18096e1f 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -165,7 +165,7 @@ if [ $OS -eq 2 ]; then TINCBIN=/data/data/org.poirsouille.tinc_gui/files/tincd if [ $TINCDIR = 'auto' ]; then TINCDIR="/usr/local/etc/tinc" ;fi if [ $TEMPDIR = 'auto' ]; then TEMPDIR="/storage/sdcard0/tinc-fu" ;fi - mount -o remount,rw / + mount -o remount,rw / DEV="/dev/tun" fi else -- cgit v1.2.3 From 7d1d43e0267ab4ef9998d50a3076ebed5dc107a5 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Wed, 23 Jan 2013 17:37:05 +0100 Subject: more android fixes --- retiolum/scripts/tinc_setup/new_install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 18096e1f..65611b1c 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -166,6 +166,7 @@ if [ $OS -eq 2 ]; then if [ $TINCDIR = 'auto' ]; then TINCDIR="/usr/local/etc/tinc" ;fi if [ $TEMPDIR = 'auto' ]; then TEMPDIR="/storage/sdcard0/tinc-fu" ;fi mount -o remount,rw / + mount -o remount,rw /system DEV="/dev/tun" fi else @@ -305,6 +306,12 @@ else yes | $TINCBIN -n $NETNAME -K fi +if [ $OS -eq 2 ]; then + mkdir /etc/tinc + cd / + mv $TINCDIR/$NETNAME /etc/tinc/ + cd /etc/tinc/$NETNAME +fi #write to irc-channel NICK="${HOSTN}_$(head /dev/urandom | tr -dc "0123456789" | head -c3)" -- cgit v1.2.3 From 300eafb32422512ced5466197de058d0d909f9be Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 23 Jan 2013 16:37:44 +0000 Subject: create shallow clone when bootstrapping --- infest/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infest/bootstrap.sh b/infest/bootstrap.sh index 723e78f0..66a1cfdd 100644 --- a/infest/bootstrap.sh +++ b/infest/bootstrap.sh @@ -14,7 +14,7 @@ command -v git || \ pacman -Sy git || \ { echo "please install git manually!"; exit 1;} || exit 1 -[ -e "$KREBSDIR" ] || git clone https://github.com/krebscode/painload.git "$KREBSDIR" \ +[ -e "$KREBSDIR" ] || git clone --depth 1 https://github.com/krebscode/painload.git "$KREBSDIR" \ || { echo "cloning failed :(" ; exit 1; } || exit 1 cd $KREBSDIR || { echo "cannot change into $KREBSDIR folder:(" ; exit 1; } || exit 1 -- cgit v1.2.3 From 8cb674488f660b5c2e010769f0849092a1fbe661 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Wed, 23 Jan 2013 17:41:42 +0100 Subject: readded seruundroid (lost privkey) --- retiolum/hosts/seruundroid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retiolum/hosts/seruundroid b/retiolum/hosts/seruundroid index 660673fb..d880042c 100644 --- a/retiolum/hosts/seruundroid +++ b/retiolum/hosts/seruundroid @@ -1,4 +1,4 @@ -Subnet = 10.243.211.81 +ubnet = 10.243.211.81 Subnet = 42:d274:9187:9408:d5e7:05f2:ee07:9abd -----BEGIN RSA PUBLIC KEY----- -- cgit v1.2.3 From 14ae58b1f8712c7db98c4b85e18fe632b9dd3a3d Mon Sep 17 00:00:00 2001 From: Lassulus Date: Wed, 23 Jan 2013 17:44:09 +0100 Subject: fixed wrong key --- retiolum/hosts/seruundroid | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/retiolum/hosts/seruundroid b/retiolum/hosts/seruundroid index d880042c..b4f0848e 100644 --- a/retiolum/hosts/seruundroid +++ b/retiolum/hosts/seruundroid @@ -1,11 +1,12 @@ -ubnet = 10.243.211.81 -Subnet = 42:d274:9187:9408:d5e7:05f2:ee07:9abd +Subnet = 10.243.127.2 +Subnet = 42:81de:f850:152b:0988:1942:265d:dacb -----BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAryK+xseuc/kPjZb+uPyNiDDW4P9DVLTV/eGowHZrPcn6t7L5CUZp -jl4csKkfJs8TayM9edAitJvC3KWFmdZrV6L9LY1BmAGuJix4wr1WtdkxwC/cUUWE -I9bTqSTGrhSRxKRmO/xSB1za5oIfIQ6vnXZYXPaAFiOQj4B5m5qn79K+d3N3j3MX -BB8BEkQHNuuCTm3JIWTLT6ZSOGgKPCXnV9NR6WwdHS62SBntZQHaheirMQQ7AJAT -kiZTdrPnMap0Qm9xkMbttazgrfVNoOzCJRMOH5EyMEfc69CufOotgfJLg0Ki8aeJ -uY3wX/aLZz2HklVarvuk5gX5RqsmZXswFwIDAQAB +MIIBCgKCAQEAvNtSbaaacF05L2mAxxA5SYc6DuoZEAkXlhcvLTlpu9f/0vZwUWh7 +175pLn6VqUijVoFb9vyoOwkrs9Uk3aX8mYws+5yJLwXhIje+U3uiVTphowKva+m9 +BzV6waZ5dLbh+3CGimx1TBkFTly3NkdZs886QWSO4aXLdU6lt3jRYsuay0Eop/j0 +eQ0BWg9o0QEcfDRQ7RirXrD0B7TSo6qZC0b4NSAMHTE+dvOMo7c+Z7cIPNLS0B+T +Am7ju3gF7UU68kKPyczrNSPPPZayEvZYUZE4PHt8dyIsppojoRq0SJqsMr/mOC15 +dg/KnoKezn9nqUWzisRWrrqWStAKITJkjQIDAQAB -----END RSA PUBLIC KEY----- + -- cgit v1.2.3 From 0c1883da9a8667595c528130cb9ddc7b0c4a04b2 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 24 Jan 2013 02:12:00 +0000 Subject: find_super is now using a threadpool --- retiolum/scripts/adv_graphgen/find_super.py | 39 ++++++++++++++++++----------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/retiolum/scripts/adv_graphgen/find_super.py b/retiolum/scripts/adv_graphgen/find_super.py index df01734e..99548f1c 100644 --- a/retiolum/scripts/adv_graphgen/find_super.py +++ b/retiolum/scripts/adv_graphgen/find_super.py @@ -23,23 +23,32 @@ def find_super(path="/etc/tinc/retiolum/hosts"): if addrs : yield (f ,[(addr ,int(port)) for addr in addrs]) -def check_super(path="/etc/tinc/retiolum/hosts"): - from socket import socket,AF_INET,SOCK_STREAM - for host,addrs in find_super(path): +def try_connect(addr): + try: + from socket import socket,AF_INET,SOCK_STREAM + s = socket(AF_INET,SOCK_STREAM) + s.settimeout(2) + s.connect(addr) + s.settimeout(None) + s.close() + return addr + except Exception as e: + pass + #return () + +def check_one_super(ha): + host,addrs = ha valid_addrs = [] for addr in addrs: - try: - s = socket(AF_INET,SOCK_STREAM) - s.settimeout(3) - s.connect(addr) - #print("success connecting %s:%d"%(addr)) - s.settimeout(None) - s.close() - valid_addrs.append(addr) - except Exception as e: - pass - #print("cannot connect to %s:%d"%(addr)) - if valid_addrs: yield (host,valid_addrs) + ret = try_connect(addr) + if ret: valid_addrs.append(ret) + if valid_addrs: return (host,valid_addrs) + +def check_super(path="/etc/tinc/retiolum/hosts"): + from multiprocessing import Pool + p = Pool(20) + return filter(None,p.map(check_one_super,find_super(path))) + if __name__ == "__main__": -- cgit v1.2.3 From 55d7d06d41fc47d32e4c138cb5aa7127cfd4864b Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 24 Jan 2013 02:24:16 +0000 Subject: fix misleading function name in find_super --- retiolum/scripts/adv_graphgen/find_super.py | 8 ++++---- retiolum/scripts/adv_graphgen/parse_tinc_stats.py | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/retiolum/scripts/adv_graphgen/find_super.py b/retiolum/scripts/adv_graphgen/find_super.py index 99548f1c..ae0fae8f 100644 --- a/retiolum/scripts/adv_graphgen/find_super.py +++ b/retiolum/scripts/adv_graphgen/find_super.py @@ -1,6 +1,6 @@ #!/usr/bin/python -def find_super(path="/etc/tinc/retiolum/hosts"): +def find_potential_super(path="/etc/tinc/retiolum/hosts"): import os import re @@ -44,10 +44,10 @@ def check_one_super(ha): if ret: valid_addrs.append(ret) if valid_addrs: return (host,valid_addrs) -def check_super(path="/etc/tinc/retiolum/hosts"): +def check_all_the_super(path="/etc/tinc/retiolum/hosts"): from multiprocessing import Pool p = Pool(20) - return filter(None,p.map(check_one_super,find_super(path))) + return filter(None,p.map(check_one_super,find_potential_super(path))) @@ -55,5 +55,5 @@ if __name__ == "__main__": """ usage """ - for host,addrs in check_super(): + for host,addrs in check_all_the_super(): print host,addrs diff --git a/retiolum/scripts/adv_graphgen/parse_tinc_stats.py b/retiolum/scripts/adv_graphgen/parse_tinc_stats.py index 76a3ffcd..e5bd96a8 100755 --- a/retiolum/scripts/adv_graphgen/parse_tinc_stats.py +++ b/retiolum/scripts/adv_graphgen/parse_tinc_stats.py @@ -2,7 +2,7 @@ # -*- coding: utf8 -*- from BackwardsReader import BackwardsReader import sys,json -from find_super import check_super +from find_super import check_all_the_super try: from time import time import socket @@ -18,7 +18,7 @@ except Exception as e: sys.stderr.write("Cannot connect to graphite: %s\n" % str(e)) supernodes= [ ] -for supernode,addr in check_super(): +for supernode,addr in check_all_the_super(): supernodes.append(supernode) """ TODO: Refactoring needed to pull the edges out of the node structures again, it should be easier to handle both structures""" @@ -39,6 +39,7 @@ def write_digraph(nodes): for k,v in nodes.iteritems(): write_node(k,v) print ('}') + def dump_graph(nodes): from time import time graph = {} @@ -48,6 +49,7 @@ def dump_graph(nodes): json.dump(graph,f) f.write('\n') f.close() + def write_stat_node(nodes): ''' Write a `stats` node in the corner This node contains infos about the current number of active nodes and connections inside the network @@ -95,6 +97,7 @@ def generate_stats(nodes): v['avg_weight'] = get_node_avg_weight(conns) v['availability'] = get_node_availability(k,jlines) sys.stderr.write( "%s -> %f\n" %(k ,v['availability'])) + def get_node_avg_weight(conns): """ calculates the average weight for the given connections """ if not conns: @@ -143,6 +146,7 @@ def delete_unused_nodes(nodes): #del(new_nodes[k]) del(k) return new_nodes + def merge_edges(nodes): """ merge back and forth edges into one DESTRUCTS the current structure by deleting "connections" in the nodes -- cgit v1.2.3 From 3380e4d7cd0d22b228725d060b3a2b7cc0fa2678 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 24 Jan 2013 10:22:40 +0100 Subject: Shepherd -> devstar --- retiolum/hosts/Shepherd | 11 ----------- retiolum/hosts/devstar | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 retiolum/hosts/Shepherd create mode 100644 retiolum/hosts/devstar diff --git a/retiolum/hosts/Shepherd b/retiolum/hosts/Shepherd deleted file mode 100644 index 875f62e2..00000000 --- a/retiolum/hosts/Shepherd +++ /dev/null @@ -1,11 +0,0 @@ -Subnet = 10.243.0.133 -Subnet = 42:2be0:92f5:3546:5f0f:8f22:6244:25f4/128 - ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAwkkmkhGMnI0x5VIgdLwV2SvXO9Bw3Sy1U5AToZiG2dSB+OiwwLir -JIrTHv4r73lMLROJjQhznq06VMmNviC82178H7/DZqgSqlGU7d9p1Okd5XCs6LI3 -eaL5mYTXFuA+PMHVvYqQ5fDQRQ4KoWmlSV65XUPejPlxtl3FXqOSHVuuBSbka+St -qLyWLAh9d8AfWjxbAIv41fl6WOyw2IuDc05K36aT/TwzA3ykl+ekNObAjvpI0cxI -+d3j8H8JY5jDcg1hvWT06JqpUcTJRkWLL7BBdQvWySaBcET1Flfo8eYVqVQDK4kU -XV/tA1ax7YPFBQ7Lh3Ru9nEC45Gv6R4HbwIDAQAB ------END RSA PUBLIC KEY----- diff --git a/retiolum/hosts/devstar b/retiolum/hosts/devstar new file mode 100644 index 00000000..875f62e2 --- /dev/null +++ b/retiolum/hosts/devstar @@ -0,0 +1,11 @@ +Subnet = 10.243.0.133 +Subnet = 42:2be0:92f5:3546:5f0f:8f22:6244:25f4/128 + +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEAwkkmkhGMnI0x5VIgdLwV2SvXO9Bw3Sy1U5AToZiG2dSB+OiwwLir +JIrTHv4r73lMLROJjQhznq06VMmNviC82178H7/DZqgSqlGU7d9p1Okd5XCs6LI3 +eaL5mYTXFuA+PMHVvYqQ5fDQRQ4KoWmlSV65XUPejPlxtl3FXqOSHVuuBSbka+St +qLyWLAh9d8AfWjxbAIv41fl6WOyw2IuDc05K36aT/TwzA3ykl+ekNObAjvpI0cxI ++d3j8H8JY5jDcg1hvWT06JqpUcTJRkWLL7BBdQvWySaBcET1Flfo8eYVqVQDK4kU +XV/tA1ax7YPFBQ7Lh3Ru9nEC45Gv6R4HbwIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From 245a815267928096ea18d9d49cd395b87a7af175 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 24 Jan 2013 23:40:05 +0100 Subject: services: minimal services.txt-over-ssh provider (twisted) --- services/Makefile | 14 ++++++ services/authorized_keys | 1 + services/checkers.py | 25 +++++++++++ services/services.txt | 2 + services/test.py | 108 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 150 insertions(+) create mode 100644 services/Makefile create mode 100644 services/authorized_keys create mode 100644 services/checkers.py create mode 100644 services/services.txt create mode 100644 services/test.py diff --git a/services/Makefile b/services/Makefile new file mode 100644 index 00000000..a68f095d --- /dev/null +++ b/services/Makefile @@ -0,0 +1,14 @@ +help:;@cat Makefile + +export authorized_keys_file := authorized_keys +export services_file := services.txt +export host_key_file := test.key + +test-client: + ssh localhost -p 1337 2>/dev/null + +test-server: + python test.py + +$(host_key_file): + ssh-keygen -t rsa -P '' -f $@ diff --git a/services/authorized_keys b/services/authorized_keys new file mode 100644 index 00000000..dcb8bfeb --- /dev/null +++ b/services/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7YrLdnXDRU2XEdZDu1BmgiT0Vaxplf3bfvSm+5o3g4AcR2yCv7h2D633c9uA0gq52EJ3V5m8B1ZcxqA0zqDptKwx+ZTMUGDls7StH5xpJyk9j5gf8DzyDLQPQG2IYszCH+8esKjo3BOFxfey8NaX+k6gvQsG3lyV0PjLvvIy4gDuMn6dPZfVAlwNYFOUNgwpku3W3A0d+UFyVjt3/sgZxM+8C3y6QE1gwT5/NfBbHM5vaEqjHcVq1ui+7a4iOXFGKkZDcd7EX6cQZSbCzZL7sZ0OmB1WpAsDCvIXfzX1YfNA0sso7ldSF6ZUGNgwEk1LootnQlCK/dfbM+i62SZ+1 tv@iiso diff --git a/services/checkers.py b/services/checkers.py new file mode 100644 index 00000000..dbfe1323 --- /dev/null +++ b/services/checkers.py @@ -0,0 +1,25 @@ + +import base64, binascii +from twisted.python.filepath import FilePath +from twisted.conch.checkers import SSHPublicKeyDatabase + + +class PublicKeyChecker(SSHPublicKeyDatabase): + + def __init__(self, filename): + self.filepath = FilePath(filename) + + def getAuthorizedKeysFiles(self, credentials): + return [self.filepath] + + def checkKey(self, credentials): + for line in self.filepath.open(): + parts = line.split() + if len(parts) < 2: + continue + try: + if base64.decodestring(parts[1]) == credentials.blob: + return True + except binascii.Error: + continue + return False diff --git a/services/services.txt b/services/services.txt new file mode 100644 index 00000000..a2b97670 --- /dev/null +++ b/services/services.txt @@ -0,0 +1,2 @@ +# this is a comment +TODO declare proper services format diff --git a/services/test.py b/services/test.py new file mode 100644 index 00000000..06340a54 --- /dev/null +++ b/services/test.py @@ -0,0 +1,108 @@ +#! /usr/bin/env python + +from os import environ as env + +authorized_keys_file = env.get('authorized_keys_file', '/dev/null') +services_file = env.get('services_file', '/dev/null') +host_key_file = env.get('host_key_file', '/dev/null') +host_key_pub_file = host_key_file + '.pub' + + +from checkers import PublicKeyChecker +from twisted.conch.avatar import ConchUser +from twisted.conch.ssh.connection import SSHConnection +from twisted.conch.ssh.factory import SSHFactory +from twisted.conch.ssh.keys import Key +from twisted.conch.ssh.session import SSHSession, ISession, wrapProtocol +from twisted.conch.ssh.userauth import SSHUserAuthServer +from twisted.cred.error import UnauthorizedLogin +from twisted.cred.portal import IRealm, Portal +from twisted.internet.protocol import Protocol +from twisted.internet.reactor import listenTCP, run +from twisted.python.components import registerAdapter +from zope.interface import implements + +from twisted.python.log import startLogging +from sys import stderr +startLogging(stderr) + + +class MyRealm: + implements(IRealm) + + def requestAvatar(self, avatarId, mind, *interfaces): + return interfaces[0], MyUser(), lambda: None + + +class MyUser(ConchUser): + def __init__(self): + ConchUser.__init__(self) + self.channelLookup.update({ 'session': SSHSession }) + + +class MySession: + + def __init__(self, avatar): + pass + + def getPty(self, term, windowSize, attrs): + pass + + def execCommand(self, proto, cmd): + raise Exception("no executing commands") + + def openShell(self, trans): + ep = MyProtocol() + ep.makeConnection(trans) + trans.makeConnection(wrapProtocol(ep)) + + def eofReceived(self): + pass + + def closed(self): + pass + + +registerAdapter(MySession, MyUser, ISession) + + +def slurpTextfile(filename): + file = open(filename, 'r') + try: + return file.read() + finally: + file.close() + +class MyProtocol(Protocol): + def connectionMade(self): + data = slurpTextfile(services_file).replace('\n', '\r\n') + self.transport.write(data) + self.transport.loseConnection() + + #def dataReceived(self, data): + # if data == '\r': + # data = '\r\n' + # elif data == '\x03': #^C + # self.transport.loseConnection() + # return + # self.transport.write(data) + + +class MyFactory(SSHFactory): + privateKeys = { + 'ssh-rsa': Key.fromFile(filename=host_key_file) + } + publicKeys = { + 'ssh-rsa': Key.fromFile(filename=host_key_pub_file) + } + services = { + 'ssh-userauth': SSHUserAuthServer, + 'ssh-connection': SSHConnection + } + +if __name__ == '__main__': + portal = Portal(MyRealm()) + portal.registerChecker(PublicKeyChecker(authorized_keys_file)) + MyFactory.portal = portal + listenTCP(1337, MyFactory()) + run() -- cgit v1.2.3 From 721f01468e0a08cd145a9596208f196227ec55e3 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 28 Jan 2013 11:47:39 +0000 Subject: add geisha geisha is the host for streaming the s21-instacam to ustream --- retiolum/hosts/geisha | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 retiolum/hosts/geisha diff --git a/retiolum/hosts/geisha b/retiolum/hosts/geisha new file mode 100644 index 00000000..6a3a2788 --- /dev/null +++ b/retiolum/hosts/geisha @@ -0,0 +1,11 @@ +Subnet = 10.243.175.29 +Subnet = 42:b6aa:9052:fffc:807b:4829:8756:860c + +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEA0kVV9ezFx/kZ6GvSALhXODkWlwHSjdA5hBJ90bdNcILeltVa3FIv +K2E+L6EG/jsETWKutxOk08+B/Z3p1SONgEksTNBdXx/Crww5PZGN/ocVSKZj61/N +lCej/Jcu88a4/R7JHIiSMdmqRCGHnwnxRA0iDQZIunriUH83NqMBQk6Drkphr/9a +5U8PhlqC5oSzZrg0uReRuBK86KmU03vp9/DndaLn18G835dtWRBQ2aEfIrrlaTPJ +ZKN/0xYZJU3v8YJYPi+UeRSymecSNgFQg36v95r3s4j3trk+yXVzVwT347AZRm4a +d/AHdk0+blXyUr5CFBsjA71cJfzqIIJJrwIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From 680b55ab5c2601ead3adfa8050f121e8fa2d7d2c Mon Sep 17 00:00:00 2001 From: Lassulus Date: Mon, 28 Jan 2013 23:11:00 +0100 Subject: moved to new ircchannel --- retiolum/scripts/tinc_setup/new_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 65611b1c..f8407c98 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -28,7 +28,7 @@ RMASK=${RMASK:-255.255.0.0} URL=${URL:-http://euer.krebsco.de/retiolum/hosts.tar.gz} SURL=${SURL:-http://euer.krebsco.de/retiolum/supernodes.tar.gz} -IRCCHANNEL=${IRCCHANNEL:-"#krebsco"} +IRCCHANNEL=${IRCCHANNEL:-"#krebs"} IRCSERVER=${IRCSERVER:-"irc.freenode.net"} IRCPORT=${IRCPORT:-6667} -- cgit v1.2.3 From 1025fa3e19d2678da41a13c2bce0846a661c0624 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 29 Jan 2013 11:58:13 +0000 Subject: add authorized_keys config for openssh-server --- services/Makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/services/Makefile b/services/Makefile index a68f095d..901769b8 100644 --- a/services/Makefile +++ b/services/Makefile @@ -1,9 +1,29 @@ help:;@cat Makefile - export authorized_keys_file := authorized_keys export services_file := services.txt export host_key_file := test.key +export services_home := /opt/services + +.PHONY: authorized_keys +$(services_home)/.ssh: + mkdir $@ + chown services:services $@ + +$(services_home)/.ssh/authorized_keys: $(services_home)/.ssh $(authorized_keys_file) + cp $(authorized_keys_file) $(services_home)/.ssh/authorized_keys + @echo "restricting authorized_keys..." + @sed -i 's#^#command="/bin/cat $(services_home)/services.txt",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty #' $(services_home)/.ssh/authorized_keys + +$(services_home)/services.txt: + @echo 'make sure to configure the services correctly in $(services_home)/services.txt' + cp $(services_file) $(services_home)/services.txt + +service-user: $(services_home)/services.txt $(services_home)/.ssh/authorized_keys + @echo 'also make sure that the user is created: make create-service-user' +create-service-user: + useradd -m -r -l -f -1 -d /opt/services services + test-client: ssh localhost -p 1337 2>/dev/null -- cgit v1.2.3 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 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 965b2bce7b66605df16fdaf70b4da1f78ebae546 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 29 Jan 2013 14:24:23 +0000 Subject: add pigstarter to authorized_keys --- services/authorized_keys | 1 + 1 file changed, 1 insertion(+) diff --git a/services/authorized_keys b/services/authorized_keys index dcb8bfeb..a7368693 100644 --- a/services/authorized_keys +++ b/services/authorized_keys @@ -1 +1,2 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7YrLdnXDRU2XEdZDu1BmgiT0Vaxplf3bfvSm+5o3g4AcR2yCv7h2D633c9uA0gq52EJ3V5m8B1ZcxqA0zqDptKwx+ZTMUGDls7StH5xpJyk9j5gf8DzyDLQPQG2IYszCH+8esKjo3BOFxfey8NaX+k6gvQsG3lyV0PjLvvIy4gDuMn6dPZfVAlwNYFOUNgwpku3W3A0d+UFyVjt3/sgZxM+8C3y6QE1gwT5/NfBbHM5vaEqjHcVq1ui+7a4iOXFGKkZDcd7EX6cQZSbCzZL7sZ0OmB1WpAsDCvIXfzX1YfNA0sso7ldSF6ZUGNgwEk1LootnQlCK/dfbM+i62SZ+1 tv@iiso +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCv9TTt4FkzT3jlQ0VS2tX/GpQO9Ef0wIQ+g96foe4qSniBwR667T1gIhURrod/p7N9oQcWRrNohjgmSBZRYA0kW6ZyqYJkLvRv54nXv6j/8Xq2nG/KVfDqL0kp8if+JGeFlQElpWJiAbGifYkopFy69QiLYU2ndR7aPbx+5qm/dcwPJ7K+n6dyePynCZadtcabm3PuBFUxGLdT9ImDXMOPfXxPMlN/3eb78byuEuHnhCIvIGLMBGx+8QTXvu7kHpZObvkbsF1xjVs9fDpwVLjh7GWdwf3BZ/agFlI24ffyqCPFnuaxUVyfUZeqf4twRsIZkTTB47lHDhYiVkyGe8gd root@pigstarter.de -- cgit v1.2.3 From 60f353a64ac890c35a327c9c2cbcbe0b7b2bc87c Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Jan 2013 16:39:23 +0100 Subject: Add sammy@muhbaasu pubkey --- services/authorized_keys | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/authorized_keys b/services/authorized_keys index a7368693..e7298315 100644 --- a/services/authorized_keys +++ b/services/authorized_keys @@ -1,2 +1,4 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7YrLdnXDRU2XEdZDu1BmgiT0Vaxplf3bfvSm+5o3g4AcR2yCv7h2D633c9uA0gq52EJ3V5m8B1ZcxqA0zqDptKwx+ZTMUGDls7StH5xpJyk9j5gf8DzyDLQPQG2IYszCH+8esKjo3BOFxfey8NaX+k6gvQsG3lyV0PjLvvIy4gDuMn6dPZfVAlwNYFOUNgwpku3W3A0d+UFyVjt3/sgZxM+8C3y6QE1gwT5/NfBbHM5vaEqjHcVq1ui+7a4iOXFGKkZDcd7EX6cQZSbCzZL7sZ0OmB1WpAsDCvIXfzX1YfNA0sso7ldSF6ZUGNgwEk1LootnQlCK/dfbM+i62SZ+1 tv@iiso ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCv9TTt4FkzT3jlQ0VS2tX/GpQO9Ef0wIQ+g96foe4qSniBwR667T1gIhURrod/p7N9oQcWRrNohjgmSBZRYA0kW6ZyqYJkLvRv54nXv6j/8Xq2nG/KVfDqL0kp8if+JGeFlQElpWJiAbGifYkopFy69QiLYU2ndR7aPbx+5qm/dcwPJ7K+n6dyePynCZadtcabm3PuBFUxGLdT9ImDXMOPfXxPMlN/3eb78byuEuHnhCIvIGLMBGx+8QTXvu7kHpZObvkbsF1xjVs9fDpwVLjh7GWdwf3BZ/agFlI24ffyqCPFnuaxUVyfUZeqf4twRsIZkTTB47lHDhYiVkyGe8gd root@pigstarter.de +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7df1RfMGNHPJe0iF6rD9DBs/4VujN6nNr7RbRCFk7HF/JzLXSn9Vcwk+3JefP4/d/bUo0h03rhQaRohDhBScrJidj2YacF6gmZOuTf3AMWprdz9D/1dDkN/ytwzGhADhqbHEWeomIllsa8Up4PvEeDcIHJGzYvuc0BbGqRk0XgxwqIrLAhdpTfEKaTbt7IzmUqEofxThTZ/4k020PKn2WDBWKQYGZJ9Ba2WzlKUXWx842ncW29oxC2faRz4M3eMPy0JMpBLkK9U3dccE75dgT/89/4ofVjM7+J3FOP3dgXzrtk+A5aN5a/veJUViQ9xdGxXvoa++iCr5q/BVRv0Bb sammy@muhbaasu.de + -- cgit v1.2.3 From 77501543d0f9aa94dcc9a814f420c43e07f09611 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 29 Jan 2013 16:42:41 +0100 Subject: //services/bin/services: initial commit --- services/bin/services | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 services/bin/services diff --git a/services/bin/services b/services/bin/services new file mode 100755 index 00000000..90d3f624 --- /dev/null +++ b/services/bin/services @@ -0,0 +1,18 @@ +#! /bin/sh +# usage: services [user@]hostname[:port] +set -euf + +user=services +hostname=${1-localhost} +port=1337 + +if echo $hostname | grep -q @; then + user=`echo $hostname | cut -d@ -f1` + hostname=`echo $hostname | cut -d@ -f2` +fi +if echo $hostname | grep -q :; then + port=`echo $hostname | cut -d: -f2` + hostname=`echo $hostname | cut -d: -f1` +fi + +ssh $user@$hostname -p $port -- cgit v1.2.3 From f9a3b1b51a469ca56f9d573832ae50c7c3e38bd6 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 29 Jan 2013 15:47:26 +0000 Subject: fix useradd issues --- services/Makefile | 14 +++++++++----- services/authorized_keys | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/services/Makefile b/services/Makefile index 901769b8..3ef670a3 100644 --- a/services/Makefile +++ b/services/Makefile @@ -5,6 +5,15 @@ export host_key_file := test.key export services_home := /opt/services .PHONY: authorized_keys + +service-user: $(services_home)/services.txt $(services_home)/.ssh/authorized_keys + @echo 'also make sure that the user is created: make create-service-user' + +create-service-user: + mkdir -p $(services_home) + rmdir $(services_home) + useradd -m -r -l -f -1 -d $(services_home) services + $(services_home)/.ssh: mkdir $@ chown services:services $@ @@ -18,11 +27,6 @@ $(services_home)/services.txt: @echo 'make sure to configure the services correctly in $(services_home)/services.txt' cp $(services_file) $(services_home)/services.txt -service-user: $(services_home)/services.txt $(services_home)/.ssh/authorized_keys - @echo 'also make sure that the user is created: make create-service-user' - -create-service-user: - useradd -m -r -l -f -1 -d /opt/services services test-client: ssh localhost -p 1337 2>/dev/null diff --git a/services/authorized_keys b/services/authorized_keys index a7368693..404f6552 100644 --- a/services/authorized_keys +++ b/services/authorized_keys @@ -1,2 +1,3 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7YrLdnXDRU2XEdZDu1BmgiT0Vaxplf3bfvSm+5o3g4AcR2yCv7h2D633c9uA0gq52EJ3V5m8B1ZcxqA0zqDptKwx+ZTMUGDls7StH5xpJyk9j5gf8DzyDLQPQG2IYszCH+8esKjo3BOFxfey8NaX+k6gvQsG3lyV0PjLvvIy4gDuMn6dPZfVAlwNYFOUNgwpku3W3A0d+UFyVjt3/sgZxM+8C3y6QE1gwT5/NfBbHM5vaEqjHcVq1ui+7a4iOXFGKkZDcd7EX6cQZSbCzZL7sZ0OmB1WpAsDCvIXfzX1YfNA0sso7ldSF6ZUGNgwEk1LootnQlCK/dfbM+i62SZ+1 tv@iiso ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCv9TTt4FkzT3jlQ0VS2tX/GpQO9Ef0wIQ+g96foe4qSniBwR667T1gIhURrod/p7N9oQcWRrNohjgmSBZRYA0kW6ZyqYJkLvRv54nXv6j/8Xq2nG/KVfDqL0kp8if+JGeFlQElpWJiAbGifYkopFy69QiLYU2ndR7aPbx+5qm/dcwPJ7K+n6dyePynCZadtcabm3PuBFUxGLdT9ImDXMOPfXxPMlN/3eb78byuEuHnhCIvIGLMBGx+8QTXvu7kHpZObvkbsF1xjVs9fDpwVLjh7GWdwf3BZ/agFlI24ffyqCPFnuaxUVyfUZeqf4twRsIZkTTB47lHDhYiVkyGe8gd root@pigstarter.de +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCl3RTOHd5DLiVeUbUr/GSiKoRWknXQnbkIf+uNiFO+XxiqZVojPlumQUVhasY8UzDzj9tSDruUKXpjut50FhIO5UFAgsBeMJyoZbgY/+R+QKU00Q19+IiUtxeFol/9dCO+F4o937MC0OpAC10LbOXN/9SYIXueYk3pJxIycXwUqhYmyEqtDdVh9Rx32LBVqlBoXRHpNGPLiswV2qNe0b5p919IGcslzf1XoUzfE3a3yjk/XbWh/59xnl4V7Oe7+iQheFxOT6rFA30WYwEygs5As//ZYtxvnn0gA02gOnXJsNjOW9irlxOUeP7IOU6Ye3WRKFRR0+7PS+w8IJLag2xb makefu@pornocauster -- cgit v1.2.3 From 2da96a69e9ab02db32cdafd194ef3e5f87ca71dc Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 29 Jan 2013 17:00:43 +0100 Subject: //services services: use $services_identity_file --- services/bin/services | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/bin/services b/services/bin/services index 90d3f624..c142a363 100755 --- a/services/bin/services +++ b/services/bin/services @@ -1,11 +1,17 @@ #! /bin/sh # usage: services [user@]hostname[:port] +# environment: +# services_identity_file path to ssh(1) identity_file set -euf user=services hostname=${1-localhost} port=1337 +if test -n "${services_identity_file-}"; then + options="${options+$options }-i $services_identity_file" +fi + if echo $hostname | grep -q @; then user=`echo $hostname | cut -d@ -f1` hostname=`echo $hostname | cut -d@ -f2` @@ -15,4 +21,4 @@ if echo $hostname | grep -q :; then hostname=`echo $hostname | cut -d: -f1` fi -ssh $user@$hostname -p $port +ssh $options $user@$hostname -p $port -- cgit v1.2.3 From 41a72197fa4e84668bd8e93cf23923581f9f8d91 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 29 Jan 2013 16:14:30 +0000 Subject: fix chown incompatibility --- retiolum/scripts/tinc_setup/new_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index f8407c98..4cfa9699 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -296,7 +296,7 @@ fi #fix permissions chmod +x tinc-up -chown -R root:root . +chown -R 0:0 . #generate keys with tinc if type tincctl >/dev/null; then -- cgit v1.2.3 From d221dc6c4a959edbbab7dde34020d9ce46897b8e Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 29 Jan 2013 16:18:04 +0000 Subject: refactor type in new_install --- retiolum/scripts/tinc_setup/new_install.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 4cfa9699..12c0588b 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -12,9 +12,10 @@ SUBNET4=${SUBNET4:-10.243} SUBNET6=${SUBNET6:-42} TEMPDIR=${TEMPDIR:-auto} TINCDIR=${TINCDIR:-auto} +exists() { type "$1" >/dev/null 2>/dev/null; } -if type hostname >/dev/null ;then SYSHOSTN=${HOSTNAME:-$(hostname)} -elif type uci >/dev/null ;then SYSHOSTN=$(uci get system.@system[0].hostname) +if exists hostname ;then SYSHOSTN=${HOSTNAME:-$(hostname)} +elif exists uci ;then SYSHOSTN=$(uci get system.@system[0].hostname) elif [ -e /etc/hostname ] ;then SYSHOSTN=$(cat /etc/hostname) else SYSHOSTN="unknown" fi @@ -106,7 +107,7 @@ find_os() { if grep -qe 'Linux' /etc/*release 2>/dev/null || grep -qe 'Linux' /etc/issue 2>/dev/null; then OS=1 - elif type getprop >/dev/null; then + elif exists getprop ; then OS=2 elif test -e /etc/openwrt_release; then OS=3 @@ -135,13 +136,13 @@ if [ $OS -eq 0 ]; then fi #check if everything is installed -if ! type awk >/dev/null; then +if ! exists awk ; then echo "Please install awk" exit 1 fi -if ! type curl >/dev/null; then - if ! type wget >/dev/null; then +if ! exists curl ; then + if ! exists wget ; then echo "Please install curl or wget" exit 1 else @@ -299,7 +300,7 @@ chmod +x tinc-up chown -R 0:0 . #generate keys with tinc -if type tincctl >/dev/null; then +if exists tincctl ; then yes | tincctl -n $NETNAME generate-keys cat rsa_key.pub >> hosts/$HOSTN else -- cgit v1.2.3 From 0124dceeea93bf9cb8e4b7c23c9a0cef15ee7089 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 29 Jan 2013 17:46:36 +0100 Subject: OS-strings instead of numbers --- retiolum/scripts/tinc_setup/new_install.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 12c0588b..e2049a4b 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -106,14 +106,14 @@ get_hostname() find_os() { if grep -qe 'Linux' /etc/*release 2>/dev/null || grep -qe 'Linux' /etc/issue 2>/dev/null; then - OS=1 + OS='linux' elif exists getprop ; then - OS=2 + OS='android' elif test -e /etc/openwrt_release; then - OS=3 + OS='openwrt' else echo "Cannot determine your operating system, falling back to Linux" - OS=1 + OS='linux' fi } @@ -158,7 +158,7 @@ if ! $(ping -c 1 -W 5 euer.krebsco.de 1>/dev/null) ;then fi #check if everything is installed -if [ $OS -eq 2 ]; then +if [ $OS = 'android' ]; then if ! test -e /data/data/org.poirsouille.tinc_gui/files/tincd; then echo "Please install tinc-gui" exit 1 @@ -234,7 +234,7 @@ get_hostname $HOSTN mkdir -p $TINCDIR/$NETNAME cd $TINCDIR/$NETNAME -if [ $OS -eq 3 ]; then +if [ $OS = 'openwrt' ]; then mkdir hosts $LOADER $SURL | tar xz -C hosts/ else @@ -307,7 +307,7 @@ else yes | $TINCBIN -n $NETNAME -K fi -if [ $OS -eq 2 ]; then +if [ $OS = 'android' ]; then mkdir /etc/tinc cd / mv $TINCDIR/$NETNAME /etc/tinc/ -- cgit v1.2.3 From 702b0bd06cf86a296243470e0a4ca9fe20c01407 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 29 Jan 2013 17:55:01 +0100 Subject: osx proto added --- retiolum/scripts/tinc_setup/new_install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index e2049a4b..a52d1edc 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -111,6 +111,8 @@ find_os() OS='android' elif test -e /etc/openwrt_release; then OS='openwrt' + elif uname -s | grep -qi 'darwin'; then + OS='osx' else echo "Cannot determine your operating system, falling back to Linux" OS='linux' @@ -170,8 +172,11 @@ if [ $OS = 'android' ]; then mount -o remount,rw /system DEV="/dev/tun" fi +#elif [ $OS = 'osx' ]; then +# echo 'this is not implemented' +# exit 1 else - if ! type tincd >/dev/null; then + if ! exists tincd >/dev/null; then echo "Please install tinc" exit 1 else -- cgit v1.2.3 From 58c8c76afbf980c22715272b6de1ae9287bddbe3 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 29 Jan 2013 18:05:20 +0100 Subject: more osx support --- retiolum/scripts/tinc_setup/new_install.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index a52d1edc..1ff42e54 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -166,24 +166,31 @@ if [ $OS = 'android' ]; then