From 7baee36853d0fae399a951918c2b8ebe4e6da6a8 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 20 Jan 2014 22:43:12 +0100 Subject: refactor vim configuration --- ship/lib/vim | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ship/lib/vim (limited to 'ship/lib') diff --git a/ship/lib/vim b/ship/lib/vim new file mode 100644 index 00000000..de1ec5b0 --- /dev/null +++ b/ship/lib/vim @@ -0,0 +1,37 @@ +# configure vim + +vimrc=$HOME/.vimrc + +vim_conf_sane_defaults(){ + cat >>$vimrc< +nnoremap +vnoremap +set wildignore=*.o,*.obj,*.bak,*.exe,*.os +colorscheme darkblue +set background=dark +set number +set mouse= +set shiftwidth=2 +set tabstop=2 +set et +set sw=2 +set smarttab +set autoindent +set backspace=indent,eol,start +set nocp +EOF +} -- cgit v1.2.3 From a774db6b3d89a106689fb1365f65b4a49c2dedec Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 20 Jan 2014 22:45:54 +0100 Subject: ship fix typo --- ship/lib/vim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ship/lib') diff --git a/ship/lib/vim b/ship/lib/vim index de1ec5b0..43173585 100644 --- a/ship/lib/vim +++ b/ship/lib/vim @@ -3,6 +3,7 @@ vimrc=$HOME/.vimrc vim_conf_sane_defaults(){ + # TODO - make stuff more modular? cat >>$vimrc< Date: Thu, 20 Feb 2014 18:50:20 +0100 Subject: add proposal for find-supers this script may be used when bootstrapping new retiolum nodes --- ship/lib/retiolum | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 ship/lib/retiolum (limited to 'ship/lib') diff --git a/ship/lib/retiolum b/ship/lib/retiolum new file mode 100644 index 00000000..015537bd --- /dev/null +++ b/ship/lib/retiolum @@ -0,0 +1,76 @@ +#!/bin/sh +# retiolum host functions +#@include core +netname=${netname:-retiolum} + + +check_free_v4(){ + myipv4=${1-10.243.0.-1} + v4num=${myipv4##*.} + printf "Retard check: " + if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; + then + info "No retard detected\n" + cd /etc/tinc/$netname/hosts + info "Check if ip is still free: " + for i in `ls -1`; do + if grep -q -e $myipv4\$ $i ;then + warn "Host IP already taken by $i! " + return 1 + fi + done + info "Passed\n" + return 0 + else + error "you are made of stupid. bailing out\n" + return 1 + fi + cd - >/dev/null +} + +find_active_nodes(){ + # TODO this function currently only supports a single address for a host + cd /etc/tinc/retiolum/hosts + # posix grep does not support [[:space:]] + for name in ` + grep '^[ ]*Address[ ]*=' * | + cut -d: -f1 | sort | uniq + `; do + if eval "`sed -n ' + s/[ ]\+//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', $port)]" + fi & + done + wait + fi & + done + wait + cd - >/dev/null +} +find_supernodes(){ + cd /etc/tinc/retiolum/hosts + for name in ` + grep '^[ ]*Address[ ]*=' * | + cut -d: -f1 | sort | uniq + `; do + if eval "`sed -n ' + s/[ ]\+//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', $port)]" + fi & + done + wait + fi & + done + wait + cd - >/dev/null +} -- cgit v1.2.3 From 1046da40ddc283cdec9d3156ecd6a37117c083cf Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 21 Feb 2014 13:23:05 +0100 Subject: add //ship/src/refresh-supers this script updates the currently configured supernodes in /etc/tinc/retiolum/tinc.conf with 5 random working supernodes in the retiolum darknet. The tinc.conf file can be given via environment. the hosts should be up-to-date in order to find all available supernodes. --- ship/lib/retiolum | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ship/lib') diff --git a/ship/lib/retiolum b/ship/lib/retiolum index 015537bd..2a5c7338 100644 --- a/ship/lib/retiolum +++ b/ship/lib/retiolum @@ -1,8 +1,9 @@ #!/bin/sh # retiolum host functions #@include core +tinc_path=${tinc_path:-/etc/tinc} netname=${netname:-retiolum} - +hosts_dir=${hosts_dir:-$tinc_path/$netname/hosts} check_free_v4(){ myipv4=${1-10.243.0.-1} @@ -11,7 +12,7 @@ check_free_v4(){ if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; then info "No retard detected\n" - cd /etc/tinc/$netname/hosts + cd $hosts_dir info "Check if ip is still free: " for i in `ls -1`; do if grep -q -e $myipv4\$ $i ;then @@ -30,8 +31,9 @@ check_free_v4(){ find_active_nodes(){ # TODO this function currently only supports a single address for a host - cd /etc/tinc/retiolum/hosts + cd $hosts_dir # posix grep does not support [[:space:]] + set +f for name in ` grep '^[ ]*Address[ ]*=' * | cut -d: -f1 | sort | uniq @@ -53,7 +55,8 @@ find_active_nodes(){ cd - >/dev/null } find_supernodes(){ - cd /etc/tinc/retiolum/hosts + cd $hosts_dir + set +f for name in ` grep '^[ ]*Address[ ]*=' * | cut -d: -f1 | sort | uniq -- cgit v1.2.3 From be4d573b21895449e57a8263a5a9ca292500a74b Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 26 Feb 2014 17:04:54 +0100 Subject: sort //ship/lib/retiolum --- ship/lib/retiolum | 56 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 27 deletions(-) (limited to 'ship/lib') diff --git a/ship/lib/retiolum b/ship/lib/retiolum index 2a5c7338..3956a200 100644 --- a/ship/lib/retiolum +++ b/ship/lib/retiolum @@ -5,34 +5,9 @@ tinc_path=${tinc_path:-/etc/tinc} netname=${netname:-retiolum} hosts_dir=${hosts_dir:-$tinc_path/$netname/hosts} -check_free_v4(){ - myipv4=${1-10.243.0.-1} - v4num=${myipv4##*.} - printf "Retard check: " - if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; - then - info "No retard detected\n" - cd $hosts_dir - info "Check if ip is still free: " - for i in `ls -1`; do - if grep -q -e $myipv4\$ $i ;then - warn "Host IP already taken by $i! " - return 1 - fi - done - info "Passed\n" - return 0 - else - error "you are made of stupid. bailing out\n" - return 1 - fi - cd - >/dev/null -} -find_active_nodes(){ - # TODO this function currently only supports a single address for a host +find_supernodes(){ cd $hosts_dir - # posix grep does not support [[:space:]] set +f for name in ` grep '^[ ]*Address[ ]*=' * | @@ -54,8 +29,11 @@ find_active_nodes(){ wait cd - >/dev/null } -find_supernodes(){ + +find_active_nodes(){ + # TODO this function currently only supports a single address for a host cd $hosts_dir + # posix grep does not support [[:space:]] set +f for name in ` grep '^[ ]*Address[ ]*=' * | @@ -77,3 +55,27 @@ find_supernodes(){ wait cd - >/dev/null } + +check_free_v4(){ + myipv4=${1-10.243.0.-1} + v4num=${myipv4##*.} + printf "Retard check: " + if [ "$v4num" -gt 0 -a "$v4num" -lt "256" ]; + then + info "No retard detected\n" + cd $hosts_dir + info "Check if ip is still free: " + for i in `ls -1`; do + if grep -q -e $myipv4\$ $i ;then + warn "Host IP already taken by $i! " + return 1 + fi + done + info "Passed\n" + return 0 + else + error "you are made of stupid. bailing out\n" + return 1 + fi + cd - >/dev/null +} -- cgit v1.2.3 From d818d26256380d1be91cb3d449271da96adb2105 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 26 Feb 2014 22:53:35 +0100 Subject: implement IRC proposal to refresh supernodes //ship/src/refresh-supers is the script which will update your tinc config and choose 5 working supernodes for you to connect to. This proposal may become part of the tinc.krebsco.de install script --- ship/lib/retiolum | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'ship/lib') diff --git a/ship/lib/retiolum b/ship/lib/retiolum index 3956a200..1e55041c 100644 --- a/ship/lib/retiolum +++ b/ship/lib/retiolum @@ -1,10 +1,28 @@ #!/bin/sh # retiolum host functions #@include core +#@include network tinc_path=${tinc_path:-/etc/tinc} netname=${netname:-retiolum} hosts_dir=${hosts_dir:-$tinc_path/$netname/hosts} +supernode_urls="http://euer.krebsco.de/retiolum/supernodes.tar.gz" +reload_tinc(){ + info "reloading tinc configuration" + pkill -HUP tincd || tinc -n $netname reload; +} +refresh_supernode_keys(){ + for url in $supernode_urls;do + info "Trying $url to retrieve supernodes" + if http_get "$url" \ + | tar xvz -C $hosts_dir | xargs -n1 echo "refreshed:" ;then + info "refreshed supernode keys" + return 0 + else + error "$url unusable for retrieving supernode host files" + fi + done && return 1 +} find_supernodes(){ cd $hosts_dir @@ -67,7 +85,7 @@ check_free_v4(){ info "Check if ip is still free: " for i in `ls -1`; do if grep -q -e $myipv4\$ $i ;then - warn "Host IP already taken by $i! " + error "Host IP already taken by $i! " return 1 fi done -- cgit v1.2.3 From 3bf91dd3f4569f17c0077938bef65f8df1050d72 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 28 Feb 2014 01:51:55 +0100 Subject: add zsh to punani db --- ship/lib/_punani_db | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ship/lib') diff --git a/ship/lib/_punani_db b/ship/lib/_punani_db index 721b5fa2..609baf07 100644 --- a/ship/lib/_punani_db +++ b/ship/lib/_punani_db @@ -39,6 +39,10 @@ _punanidb_pacman_tinc=tinc _punanidb_yum_tinc=tinc _punanidb_aptget_tinc=tinc +_punanidb_pacman_zsh=zsh +_punanidb_yum_zsh=zsh +_punanidb_aptget_zsh=zsh + _punanidb_pacman_tor=tor _punanidb_yum_tor=tor _punanidb_aptget_tor=tor -- cgit v1.2.3 From fb75532f8ac05761955ea25ed0d00ce66a6567db Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 7 Mar 2014 14:25:40 +0100 Subject: update env-bootstrapping --- ship/lib/vim | 1 + 1 file changed, 1 insertion(+) (limited to 'ship/lib') diff --git a/ship/lib/vim b/ship/lib/vim index 43173585..f75f3d0e 100644 --- a/ship/lib/vim +++ b/ship/lib/vim @@ -22,6 +22,7 @@ inoremap nnoremap vnoremap set wildignore=*.o,*.obj,*.bak,*.exe,*.os +cmap w!! w !sudo tee > /dev/null % colorscheme darkblue set background=dark set number -- cgit v1.2.3 From c6b10ba46ea17f4ff0bc2f666dc1237fbb643b9d Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 7 Mar 2014 14:26:52 +0100 Subject: whatweb is now up-to-date --- ship/lib/_punani_db | 1 + 1 file changed, 1 insertion(+) (limited to 'ship/lib') diff --git a/ship/lib/_punani_db b/ship/lib/_punani_db index 609baf07..e5bf15b1 100644 --- a/ship/lib/_punani_db +++ b/ship/lib/_punani_db @@ -54,3 +54,4 @@ _punanidb_aptget_nano=nano _punanidb_pacman_vim=vim _punanidb_yum_vim=vim-enhanced _punanidb_aptget_vim=vim + -- cgit v1.2.3 From 2c7569f73fc49f0ba0279d6db877bdfcfdee9bb7 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 9 Mar 2014 12:44:49 +0100 Subject: make irc send verbose again --- ship/lib/network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ship/lib') diff --git a/ship/lib/network b/ship/lib/network index 974fb282..bc4d1047 100644 --- a/ship/lib/network +++ b/ship/lib/network @@ -95,5 +95,5 @@ send_irc(){ echo "JOIN $IRCCHANNEL"; sleep 23; while read line; do echo "PRIVMSG $IRCCHANNEL :$line";sleep 1;done - sleep 5; ) | run_telnet $IRCSERVER $IRCPORT 2>/dev/null | line_to_dot + sleep 5; ) | run_telnet $IRCSERVER $IRCPORT 2>/dev/null } -- cgit v1.2.3 From 5c9d8118729c2e5524324bc340da45405ce69505 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 9 Mar 2014 12:45:23 +0100 Subject: add filehooker ncdc pseudocode --- ship/lib/filehooker | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 ship/lib/filehooker (limited to 'ship/lib') diff --git a/ship/lib/filehooker b/ship/lib/filehooker new file mode 100644 index 00000000..fac84b93 --- /dev/null +++ b/ship/lib/filehooker @@ -0,0 +1,56 @@ +#@include core +#@include tmux +# +netshare= +dc_hub=${dc_hub:-adcs://localhost:2781} +ncdc_user=hooker +ncdc_install(){ +curl http://dev.yorhel.nl/download/ncdc-linux-x86_64-1.19.tar.gz | tar xz -C /usr/bin/ +} + + + +ncdc_configure(){ + # maybe we want to use the running ncdc process and communicate via tmux send-keys ? + (sleep 1;cat;printf "/quit\n") | sudo -u $ncdc_user +# not implemented yet +# /set active +# /share $random $netshare +: +} +ncdc_configure_netshare(){ + :${1?provide path to share} + rnd=`hexdump -n 2 -e '/2 "%u"' /dev/urandom` + rnd_name="share_$rnd" + info "setting active as true" + info "adding share" + (echo "/set active true" ; + echo "/share $rnd_name $1") | ncdc_configure + +} +ncdc_configure_hub(){ + info "configuring DC Hub: $dc_hub, activating autconnect" + (echo "/open c1 $dc_hub" ; + echo "/hset autoconnect true") | ncdc_configure +} +ncdc_autostart(){ +# only systemd +# punani install tmux +cat > /etc/systemd/system/ncdc@.service < Date: Sun, 9 Mar 2014 12:45:40 +0100 Subject: add lib to deploy pubkeys for user --- ship/lib/krebs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ship/lib/krebs (limited to 'ship/lib') diff --git a/ship/lib/krebs b/ship/lib/krebs new file mode 100644 index 00000000..e47031d6 --- /dev/null +++ b/ship/lib/krebs @@ -0,0 +1,16 @@ +#@include core +krebs_pubkeys="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7YrLdnXDRU2XEdZDu1BmgiT0Vaxplf3bfvSm+5o3g4AcR2yCv7h2D633c9uA0gq52EJ3V5m8B1ZcxqA0zqDptKwx+ZTMUGDls7StH5xpJyk9j5gf8DzyDLQPQG2IYszCH+8esKjo3BOFxfey8NaX+k6gvQsG3lyV0PjLvvIy4gDuMn6dPZfVAlwNYFOUNgwpku3W3A0d+UFyVjt3/sgZxM+8C3y6QE1gwT5/NfBbHM5vaEqjHcVq1ui+7a4iOXFGKkZDcd7EX6cQZSbCzZL7sZ0OmB1WpAsDCvIXfzX1YfNA0sso7ldSF6ZUGNgwEk1LootnQlCK/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n9rRFY2fBzrdYAgk9C0N6ojCs/Gzknk9SGntA96MDqHJ1HXWFMfmwOLCnxtE5TY30MqSmkrJb7Fsejwjoqoe9Y/mCaR0LpG2cStC1+37GbHJNH0caCMaQCX8qdfgMVbWTVeFWtV6aWOaRgwLrPDYn4cHWQJqTfhtPrNQ== death@uriel" + +authorized_keys_file="${authorized_keys:-$HOME/.ssh/authorized_keys}" +deploy_krebs_pubkeys(){ +info "deploying pubkeys in $authorized_keys_file" +mkdir -p "$(dirname "$authorized_keys_file")" +printf "$krebs_pubkeys\n" >> "$authorized_keys_file" + +} -- cgit v1.2.3 From fc166354da369e4a9e3e635d5026ecf4f8ee11f4 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 9 Mar 2014 21:44:17 +0100 Subject: ship:/lib/filehooker set nick --- ship/lib/filehooker | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'ship/lib') diff --git a/ship/lib/filehooker b/ship/lib/filehooker index fac84b93..bd658c42 100644 --- a/ship/lib/filehooker +++ b/ship/lib/filehooker @@ -1,22 +1,13 @@ #@include core -#@include tmux -# + netshare= dc_hub=${dc_hub:-adcs://localhost:2781} -ncdc_user=hooker -ncdc_install(){ -curl http://dev.yorhel.nl/download/ncdc-linux-x86_64-1.19.tar.gz | tar xz -C /usr/bin/ -} - +ncdc_user=${ncdc_user:-hooker} -ncdc_configure(){ +ncdc_config(){ # maybe we want to use the running ncdc process and communicate via tmux send-keys ? (sleep 1;cat;printf "/quit\n") | sudo -u $ncdc_user -# not implemented yet -# /set active -# /share $random $netshare -: } ncdc_configure_netshare(){ :${1?provide path to share} @@ -25,14 +16,27 @@ ncdc_configure_netshare(){ info "setting active as true" info "adding share" (echo "/set active true" ; - echo "/share $rnd_name $1") | ncdc_configure + echo "/share $rnd_name $1") | ncdc_config +} +ncdc_configure_nick(){ + nick=${1?nick must be provided} + info "configuring DC Nick: $nick" + echo "/nick $nick" | ncdc_config } ncdc_configure_hub(){ - info "configuring DC Hub: $dc_hub, activating autconnect" - (echo "/open c1 $dc_hub" ; - echo "/hset autoconnect true") | ncdc_configure + hub=${1:-$dc_hub} + info "configuring DC Hub: $hub, activating autconnect" + (echo "/open c1 ${hub}" ; + echo "/hset autoconnect true") | ncdc_config } + + +ncdc_install(){ +curl http://dev.yorhel.nl/download/ncdc-linux-x86_64-1.19.tar.gz | tar xz -C /usr/bin/ +useradd -m $ncdc_user ||: +} + ncdc_autostart(){ # only systemd # punani install tmux -- cgit v1.2.3 From 0970f673456cf8bef932aef048bb89f6178eb104 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 9 Mar 2014 22:32:48 +0100 Subject: ship:implement ncdc configuration --- ship/lib/filehooker | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'ship/lib') diff --git a/ship/lib/filehooker b/ship/lib/filehooker index bd658c42..a6987733 100644 --- a/ship/lib/filehooker +++ b/ship/lib/filehooker @@ -1,14 +1,12 @@ #@include core - -netshare= -dc_hub=${dc_hub:-adcs://localhost:2781} ncdc_user=${ncdc_user:-hooker} - +ncdc_bin=${ncdc_bin:-/usr/bin/ncdc} ncdc_config(){ # maybe we want to use the running ncdc process and communicate via tmux send-keys ? - (sleep 1;cat;printf "/quit\n") | sudo -u $ncdc_user + (sleep 1;cat;printf "/quit\n") | sudo -u $ncdc_user "$ncdc_bin" } + ncdc_configure_netshare(){ :${1?provide path to share} rnd=`hexdump -n 2 -e '/2 "%u"' /dev/urandom` @@ -25,15 +23,19 @@ ncdc_configure_nick(){ echo "/nick $nick" | ncdc_config } ncdc_configure_hub(){ - hub=${1:-$dc_hub} + rnd=`hexdump -n 2 -e '/2 "%u"' /dev/urandom` + hubname="hub_$rnd" + hub=${1?adcs://localhost:2781} info "configuring DC Hub: $hub, activating autconnect" - (echo "/open c1 ${hub}" ; + (echo "/open ${hubname} ${hub}" ; echo "/hset autoconnect true") | ncdc_config } ncdc_install(){ -curl http://dev.yorhel.nl/download/ncdc-linux-x86_64-1.19.tar.gz | tar xz -C /usr/bin/ +install_dir="$(dirname "${ncdc_bin}")" +info "installing ncdc to $install_dir" +curl http://dev.yorhel.nl/download/ncdc-linux-x86_64-1.19.tar.gz | tar xz -C "$install_dir" useradd -m $ncdc_user ||: } -- cgit v1.2.3 From ee63a28d029408a9a3012917a5169df5addd239a Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 10 Mar 2014 23:06:50 +0100 Subject: add volid finder for remastering scripts --- ship/lib/iso | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ship/lib/iso (limited to 'ship/lib') diff --git a/ship/lib/iso b/ship/lib/iso new file mode 100644 index 00000000..0776d796 --- /dev/null +++ b/ship/lib/iso @@ -0,0 +1,7 @@ +get_volid(){ + #returns the volume id of the iso given + # is needed for remastering the archlinux iso + + #punani install genisoimage + isoinfo -d -i "${1?path to iso must be given}" | grep "^Volume id:" | cut -d: -f 2 |xargs +} -- cgit v1.2.3 From e2cf4fc92569487e21d096ac6879177aac8f73c1 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 16 Mar 2014 12:55:24 +0100 Subject: update tor_announce --- ship/lib/filehooker | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'ship/lib') diff --git a/ship/lib/filehooker b/ship/lib/filehooker index a6987733..5e6def5d 100644 --- a/ship/lib/filehooker +++ b/ship/lib/filehooker @@ -1,4 +1,5 @@ #@include core +#@include network ncdc_user=${ncdc_user:-hooker} ncdc_bin=${ncdc_bin:-/usr/bin/ncdc} @@ -60,3 +61,25 @@ WantedBy=multi-user.target EOF systemctl enable ncdc@$ncdc_user } + +install_tor_announce(){ +# systemd only +cat > /etc/systemd/system/tor_announce.service<