diff options
author | root <root@flap> | 2014-05-06 10:00:33 -0400 |
---|---|---|
committer | root <root@flap> | 2014-05-06 10:00:33 -0400 |
commit | 4d8016064edd5e5dc1d194ea5ec0fce4f07b8f2a (patch) | |
tree | d8ecba8651604e51d6f887449641ac627844ae63 /retiolum/scripts/tinc_setup | |
parent | f44c8529e6d04b557d93cc862599b956ed21f0de (diff) | |
parent | d0367082a5c1296cefed641b4eda736b29a3ad69 (diff) |
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'retiolum/scripts/tinc_setup')
-rw-r--r-- | retiolum/scripts/tinc_setup/README | 18 | ||||
-rw-r--r-- | retiolum/scripts/tinc_setup/README.md | 10 | ||||
-rwxr-xr-x | retiolum/scripts/tinc_setup/build_arch.sh | 14 | ||||
-rwxr-xr-x | retiolum/scripts/tinc_setup/build_debian.sh | 32 | ||||
-rwxr-xr-x | retiolum/scripts/tinc_setup/build_debian_clean.sh | 31 | ||||
-rwxr-xr-x | retiolum/scripts/tinc_setup/build_ec2.sh | 16 | ||||
-rw-r--r-- | retiolum/scripts/tinc_setup/build_no.de.sh | 1 | ||||
-rwxr-xr-x | retiolum/scripts/tinc_setup/install.sh | 84 | ||||
-rwxr-xr-x | retiolum/scripts/tinc_setup/new_install.sh | 9 |
9 files changed, 17 insertions, 198 deletions
diff --git a/retiolum/scripts/tinc_setup/README b/retiolum/scripts/tinc_setup/README deleted file mode 100644 index 11d6f6e9..00000000 --- a/retiolum/scripts/tinc_setup/README +++ /dev/null @@ -1,18 +0,0 @@ -This directory contains the build and install scripts for shack-retiolum - -1. build_arch - arch linux build script -2. build_debian - debian build script -3. build_debian_clean - debian script which builds a clean tinc daemon -4. build_ec2 - Amazon ec2 base instance build script -5. install.sh - configures the tinc daemon - $1 is the nickname - $2 is the ip-address - also writes a python file inside the tinc/retiolum folder which posts - the public key into the IRC:freenode/#tincspasm -6. build_no.de - nonfunct no.de smartmachine build script diff --git a/retiolum/scripts/tinc_setup/README.md b/retiolum/scripts/tinc_setup/README.md new file mode 100644 index 00000000..c4892474 --- /dev/null +++ b/retiolum/scripts/tinc_setup/README.md @@ -0,0 +1,10 @@ +# Description +new_install.sh is the script fur bootstrapping tinc. +We use irc for the initial key exchange, specifically +irc.freenode.com#krebs_incoming . + +# Usage + + curl tinc.krebsco.de | HOSTN=bobkhan sh + # or + HOSTN=wrryyyyy ./new_install.sh diff --git a/retiolum/scripts/tinc_setup/build_arch.sh b/retiolum/scripts/tinc_setup/build_arch.sh deleted file mode 100755 index 5ef5d765..00000000 --- a/retiolum/scripts/tinc_setup/build_arch.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -set -e -sudo pacman -S openssl gcc lzo -curl http://www.tinc-vpn.org/packages/tinc-1.0.13.tar.gz | tar xz -cd tinc-1.0.13 -./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var -make -sudo make install -cd .. - -echo "overwriting python to python2" -sed 's/\/usr\/bin\/python/\/usr\/bin\/python2/g' install.sh >install2.sh -mv install2.sh install.sh - diff --git a/retiolum/scripts/tinc_setup/build_debian.sh b/retiolum/scripts/tinc_setup/build_debian.sh deleted file mode 100755 index 52e61390..00000000 --- a/retiolum/scripts/tinc_setup/build_debian.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -set -x -if [ ! "$MYIP" ] -then - MYIP=10.0.7.7.55 -fi -if [ ! "$MYHOSTNAME" ] -then - MYHOSTNAME="penis" -fi - -if [ "$MYHOSTNAME" = "penis" ]; -then - read -n1 -p "name is penis, are u sure? [yN]" - if [[ "$REPLY" != [yY] ]] - then - echo "then better RTFC" - echo "bailing out" - exit 0 - fi -fi -apt-get install tinc git curl python - -./install.sh "$MYHOSTNAME" "$MYIP" - -# for autostart -sed -i '/retiolum/d' /etc/tinc/nets.boot -echo "retiolum" >> /etc/tinc/nets.boot -sed -i '/EXTRA/d' /etc/tinc/nets.boot -echo "EXTRA=\"\"" >> /etc/default/tinc - -/etc/init.d/tinc start diff --git a/retiolum/scripts/tinc_setup/build_debian_clean.sh b/retiolum/scripts/tinc_setup/build_debian_clean.sh deleted file mode 100755 index a7332f4e..00000000 --- a/retiolum/scripts/tinc_setup/build_debian_clean.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -set -xe -MYIP=10.0.7.7.55 - -apt-get install tinc git curl gcc gcc-dev build-essential libssl-dev python - -git clone https://github.com/makefu/shack-retiolum.git - -mkdir build -cd build -curl http://www.oberhumer.com/opensource/lzo/download/lzo-2.04.tar.gz | tar -xz -cd lzo-2.04 -./configure --prefix=/usr -make -sudo make install -cd .. -curl http://www.tinc-vpn.org/packages/tinc-1.0.13.tar.gz | tar xz -cd tinc-1.0.13 -./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var -make -sudo make install -cd ../.. - -cd shack-retiolum -./install.sh `hostname` $MYIP - -rm shack-retiolum -# for autostart -echo "retiolum" >> /etc/tinc/nets.boot -echo "EXTRA=\"--user=tincd --chroot\"" >> /etc/default/tinc diff --git a/retiolum/scripts/tinc_setup/build_ec2.sh b/retiolum/scripts/tinc_setup/build_ec2.sh deleted file mode 100755 index 79f2af28..00000000 --- a/retiolum/scripts/tinc_setup/build_ec2.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -set -e -sudo yum install -y gcc openssl-devel -mkdir build -cd build -curl http://www.oberhumer.com/opensource/lzo/download/lzo-2.04.tar.gz | tar xz -cd lzo-2.04 -./configure --prefix=/usr -make -sudo make install -cd .. -curl http://www.tinc-vpn.org/packages/tinc-1.0.13.tar.gz | tar xz -cd tinc-1.0.13 -./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var -make -sudo make install diff --git a/retiolum/scripts/tinc_setup/build_no.de.sh b/retiolum/scripts/tinc_setup/build_no.de.sh deleted file mode 100644 index 2976d3a2..00000000 --- a/retiolum/scripts/tinc_setup/build_no.de.sh +++ /dev/null @@ -1 +0,0 @@ -pkgin in lzo gcc-tools gcc-compiler gcc34 diff --git a/retiolum/scripts/tinc_setup/install.sh b/retiolum/scripts/tinc_setup/install.sh deleted file mode 100755 index 9efe863c..00000000 --- a/retiolum/scripts/tinc_setup/install.sh +++ /dev/null @@ -1,84 +0,0 @@ -#! /bin/sh -# USE WITH GREAT CAUTION -set -eu - -if test "${nosudo-false}" != true -a `id -u` != 0; then - echo "we're going sudo..." >&2 - exec sudo "$0" "$@" - exit 23 # go to hell -fi - -#make -C ../../ update -set -e -DIRNAME=`dirname $0` -CURR=`readlink -f ${DIRNAME}` -MYBIN=${CURR}/../../bin -netname=retiolum -# create configuration directory for $netname -mkdir -p /etc/tinc/$netname/hosts -cd /etc/tinc/$netname - -echo "added known hosts:" -ls -1 hosts | LC_ALL=C sort -echo "delete the nodes you do not trust!" - -hostname="${HOSTNAME-`cat /etc/hostname`}" -myname="${1:-}" -if [ ! "$myname" ] -then - printf "select node name [$hostname]: " - read myname - if test -z "$myname"; then - myname="$hostname" - fi -fi -if [ ! -e "hosts/$myname" ] -then - - # TODO eloop until we found a free IPv4 - # myipv4=$(echo 42.$(for i in `seq 1 3`; do echo "ibase=16;`bin/fillxx xx|tr [a-f] [A-F]`" | bc; done)|tr \ .)/32 - - myipv4="${2:-}" - mynet4=10.243.0.0 - - if [ ! "$myipv4" ] - then - printf 'select v4 subnet ip (1-255): ' - read v4num - until $MYBIN/check-free-retiolum-v4 10.243.0.$v4num; do - echo "your're an idiot!" - printf 'select unused v4 subnet ip (1-255): ' - read v4num - done - myipv4="10.243.0.$v4num" - fi - echo "Subnet = $myipv4" > hosts/$myname - - myipv6=`$MYBIN/fillxx 42:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx`/128 - echo "Subnet = $myipv6" >> hosts/$myname -else - echo "own host file already exists! will not write again!" -fi - -cat>tinc.conf<<EOF -Name = $myname -ConnectTo = euer -ConnectTo = albi10 -ConnectTo = pigstarter -ConnectTo = slowpoke -Device = /dev/net/tun -EOF - -if [ ! -e rsa_key.priv ] -then - echo "creating new keys" - tincd -n $netname -K - $MYBIN/announce_pubkey $myname || \ - echo "cannot write public key to IRC, you are on your own. Good Luck" -else - echo "key files already exist, skipping" - echo "if you know what you are doing, remove rsa_key.priv" -fi -# add user tincd -# this is what the setup scripts for the distribution has to do -#useradd tincd diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index b48649ec..25e7f04d 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -43,6 +43,11 @@ main(){ RAND4=1 RAND6=1 + if $(echo $HOSTN | grep -q -); then + echo 'invalid hostname, - not allowed' + exit 1 + fi + if [ $IP4 -eq 0 ]; then RAND4=1 @@ -196,9 +201,9 @@ LocalDiscovery = yes AutoConnect = 3 #ConnectTos -ConnectTo = slowpoke +ConnectTo = fastpoke ConnectTo = pigstarter -ConnectTo = pico +ConnectTo = kheurop EOF host2subnet $MASK4 |