From c41ae5b09d5d0dc15f9f0c912a3aedaba0ec1307 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Thu, 24 Nov 2011 21:38:40 +0000 Subject: updated peer2anonet --- contrib/peer2anonet/README | 73 ++++------------------------------------------ 1 file changed, 6 insertions(+), 67 deletions(-) (limited to 'contrib/peer2anonet/README') diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index 04feabb..c68fc2d 100644 --- a/contrib/peer2anonet/README +++ b/contrib/peer2anonet/README @@ -1,82 +1,21 @@ -SYNOPSIS: - # Generate Keys: - quicktun.keypair. + peering session with BGP on AnoNet2. DEPENDS ON: quicktun, bird, daemontools(non-deb), bash -INSTALL AND UNINSTALL: - ****************************************************************** - * PEER2ANONET CAN AND WILL OVERWRITE /service AND /services, TO * - * INCLUDE FILES WITHIN THOSE DIRECTORIES. PLEASE CREATE BACKUPS * - * BEFORE INSTALLING AND USING PEER2ANONET AT ANY TIME! * - ****************************************************************** - - To install, `cd' to the extracted peer2anonet folder. - Issue the following commands as root: - - make install - - To uninstall peer2anonet, as root do: +USAGE: - make uninstall + --configure generate a new local configuration and exit - To compile/install a .deb package, as root do: + --update regenerate peer configurations - make install-deb + --configure-peer generate a new peer configuration and update -USAGE: - You may execute peer2anonet and answer configuration questions - via interface or pipe a file containing the new peering - session's specifications to the executable. peer2anonet has - some security checks but it is highly recommended you check - a autoconfig file manually before using to prevent malicious - attacks. An autoconfig file should be in the following format: - Plain text file, one block of data per line, no spaces, and - without including the following '<-- comments'. + --rm-peer remove a peer configuration and update -================== Not Actual Line on File ============================ -anon <--your peer's alias -11.22.33.44 <--your peer's remote ip -1.2.3.4 <--your peer's anonet ip -4321 <--your peer's client port -1234 <--your peer's asn -3c6e0b8a9c15224a8228b9a98ca1531d <--your peer's public key -================== Not Actual Line on File ============================ - At your discretion, you may exclude the public key from the - bottom of an autoconfig file and post installation of your new - peer service, peer2anonet will prompt foor it. -- cgit v1.2.3 From fcfc1c666c15243796ba7c886fe3a0ee7ad8b592 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Fri, 25 Nov 2011 21:11:12 +0000 Subject: update peer2anonet --- contrib/peer2anonet/README | 6 ++++++ contrib/peer2anonet/peer2anonet | 48 ++++++++++++++++++++++------------------- 2 files changed, 32 insertions(+), 22 deletions(-) (limited to 'contrib/peer2anonet/README') diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index c68fc2d..196dae3 100644 --- a/contrib/peer2anonet/README +++ b/contrib/peer2anonet/README @@ -15,6 +15,12 @@ USAGE: --rm-peer remove a peer configuration and update +NOTES: + + peer2anonet exports the /service/$PEER/run file to + /etc/peer2anonet/peers/$PEER/run. If you need to + create customizations for peerings then make adjustments + to that file. diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 7b01f24..7e61543 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -164,7 +164,6 @@ protocol direct direct_AnoNet_routes { table AnoNet_routes; for PEER in `ls /etc/peer2anonet/peers`; do mkdir -p /services/"$PEER" - PEERNAME="$PEER" REMOTEIP=`cat /etc/peer2anonet/peers/"$PEER"/remote_ip` PEERIP=`cat /etc/peer2anonet/peers/"$PEER"/peering_ip` PEERPORT=`cat /etc/peer2anonet/peers/"$PEER"/port` @@ -173,7 +172,7 @@ protocol direct direct_AnoNet_routes { table AnoNet_routes; SECKEY=`cat /etc/peer2anonet/peers/"$PEER"/seckey` echo " -protocol bgp $PEERNAME { table AnoNet_routes; +protocol bgp $PEER { table AnoNet_routes; local as $P2A_ASN; neighbor $PEERIP as $PEERASN; source address $P2A_IP; @@ -181,7 +180,10 @@ protocol bgp $PEERNAME { table AnoNet_routes; export filter only_AnoNet_ebgp_export; }" >> /services/bird/bird.conf - echo "#!/bin/bash + if [ -e /etc/peer2anonet/peers/"$PEER"/run ]; then + cp /etc/peer2anonet/peers/$PEER/run /services/"$PEER"/run + else + echo "#!/bin/bash # uncomment if your peer has a dynamic IP # #export REMOTE_FLOAT=1 @@ -197,7 +199,7 @@ export LOCAL_PORT=2${PEERASN:0:5} export PRIVATE_KEY=$SECKEY export PUBLIC_KEY=$PUBKEY export TUN_MODE=1 -export INTERFACE=ppp-$PEERNAME +export INTERFACE=ppp-$PEER # uncomment if you want to nuke your default gateway and configure # routes only to peers through IcannNet. If any of your peers use @@ -218,10 +220,12 @@ export INTERFACE=ppp-$PEERNAME # trick used to help bird connect. ping -c 1 -I \$INTERFACE $PEERIP -r -w 5 ) & -exec /usr/sbin/quicktun.nacltai" > /services/"$PEERNAME"/run - chmod +x /services/"$PEERNAME"/run - test -L "/service/$PEERNAME" || ln -s "/services/$PEERNAME" "/service/$PEERNAME" - svc -d "/service/$PEERNAME" && svc -u "/service/$PEERNAME" +exec /usr/sbin/quicktun.nacltai" > /etc/peer2anonet/peers/$PEER/run + cp /etc/peer2anonet/peers/$PEER/run /services/"$PEER"/run + fi + chmod +x /services/"$PEER"/run + test -L "/service/$PEER" || ln -s "/services/$PEER" "/service/$PEER" + svc -d "/service/$PEER" && svc -u "/service/$PEER" done test -L /service/bird || ln -s /services/bird /service/bird echo configure | birdc @@ -229,33 +233,33 @@ exec /usr/sbin/quicktun.nacltai" > /services/"$PEERNAME"/run CONFIGURE_PEER(){ echo -e '\nCONFIGURE PEER:\n' - read -p " Enter your peer's name: " PEERNAME + read -p " Enter your peer's name: " PEER read -p " Enter your peer's remote ip: " REMOTEIP read -p " Enter your peer's peering ip: " PEERIP read -p " Enter your peer's remote port: " PEERPORT read -p " Enter your peer's asn: " PEERASN read -p " Enter your peer's public key: " PUBKEY read -p " Enter your private key: " SECKEY - mkdir -p /etc/peer2anonet/peers/"$PEERNAME" - echo $REMOTEIP >/etc/peer2anonet/peers/"$PEERNAME"/remote_ip - echo $PEERIP >/etc/peer2anonet/peers/"$PEERNAME"/peering_ip - echo $PEERPORT >/etc/peer2anonet/peers/"$PEERNAME"/port - echo $PEERASN >/etc/peer2anonet/peers/"$PEERNAME"/asn - echo $PUBKEY >/etc/peer2anonet/peers/"$PEERNAME"/pubkey - echo $SECKEY >/etc/peer2anonet/peers/"$PEERNAME"/seckey - echo -e "\n configured $PEERNAME\n" + mkdir -p /etc/peer2anonet/peers/"$PEER" + echo $REMOTEIP >/etc/peer2anonet/peers/"$PEER"/remote_ip + echo $PEERIP >/etc/peer2anonet/peers/"$PEER"/peering_ip + echo $PEERPORT >/etc/peer2anonet/peers/"$PEER"/port + echo $PEERASN >/etc/peer2anonet/peers/"$PEER"/asn + echo $PUBKEY >/etc/peer2anonet/peers/"$PEER"/pubkey + echo $SECKEY >/etc/peer2anonet/peers/"$PEER"/seckey + echo -e "\n configured $PEER\n" } RM_PEER(){ echo -e '\nRM PEER:\n' - read -p " Enter your peer's name: " PEERNAME - if [ -e /etc/peer2anonet/peers/"$PEERNAME" ]; then - rm -r /etc/peer2anonet/peers/"$PEERNAME" + read -p " Enter your peer's name: " PEER + if [ -e /etc/peer2anonet/peers/"$PEER" ]; then + rm -r /etc/peer2anonet/peers/"$PEER" echo - echo -e " removed /etc/peer2anonet/peers/$PEERNAME\n" + echo -e " removed /etc/peer2anonet/peers/$PEER\n" else echo - echo -e " error: /etc/peer2anonet/peers/$PEERNAME not exists\n" + echo -e " error: /etc/peer2anonet/peers/$PEER not exists\n" exit 1 fi } -- cgit v1.2.3 From 9cf9a87c268d278fa15d48be0e79fd9c63a37ea3 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Fri, 25 Nov 2011 22:35:38 +0000 Subject: updated peer2anonet --- contrib/peer2anonet/README | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'contrib/peer2anonet/README') diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index 196dae3..7e34f13 100644 --- a/contrib/peer2anonet/README +++ b/contrib/peer2anonet/README @@ -7,13 +7,15 @@ DEPENDS ON: USAGE: - --configure generate a new local configuration and exit + --configure generate a new local configuration and exit - --update regenerate peer configurations + --update regenerate peer configurations - --configure-peer generate a new peer configuration and update + --configure-peer generate a new peer configuration and update - --rm-peer remove a peer configuration and update + --rm-peer remove a peer configuration and update + + --install-daemontools installs daemontools NOTES: -- cgit v1.2.3 From 8e4a98fc3b28c5a07df516f88ccee3cc79af4048 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Fri, 25 Nov 2011 23:40:28 +0000 Subject: updated README --- contrib/peer2anonet/README | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'contrib/peer2anonet/README') diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index 7e34f13..ba98280 100644 --- a/contrib/peer2anonet/README +++ b/contrib/peer2anonet/README @@ -17,6 +17,10 @@ USAGE: --install-daemontools installs daemontools + --install-ucspi-tcp installs ucspi-tcp + + --install-djbdns installs djbdns + NOTES: peer2anonet exports the /service/$PEER/run file to -- cgit v1.2.3 From 6aaa07d374fbe07a0c1952f88487b4fc848d41de Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sat, 26 Nov 2011 00:27:46 +0000 Subject: updated peer2anonet stuff --- contrib/peer2anonet/README | 40 ++++++++++++++++++++++++++++++++++++---- contrib/peer2anonet/peer2anonet | 6 +++++- 2 files changed, 41 insertions(+), 5 deletions(-) (limited to 'contrib/peer2anonet/README') diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index ba98280..8b8eacf 100644 --- a/contrib/peer2anonet/README +++ b/contrib/peer2anonet/README @@ -23,10 +23,42 @@ USAGE: NOTES: - peer2anonet exports the /service/$PEER/run file to - /etc/peer2anonet/peers/$PEER/run. If you need to - create customizations for peerings then make adjustments - to that file. + KEY PAIRS: + + before running peer2anonet to configure peers you can use + quicktun to generate keypairs: + + quicktun.keypair Date: Sat, 26 Nov 2011 05:16:10 +0000 Subject: massive update to peer2anonet, here's hoping i didn't fuck something up ;-) --- contrib/peer2anonet/DEBIAN/configure | 10 ---- contrib/peer2anonet/DEBIAN/control | 12 ---- contrib/peer2anonet/README | 107 ++++++++++++++++++++++++----------- contrib/peer2anonet/peer2anonet | 90 ++++++++++++++++++++++++++--- 4 files changed, 155 insertions(+), 64 deletions(-) delete mode 100755 contrib/peer2anonet/DEBIAN/configure delete mode 100644 contrib/peer2anonet/DEBIAN/control (limited to 'contrib/peer2anonet/README') diff --git a/contrib/peer2anonet/DEBIAN/configure b/contrib/peer2anonet/DEBIAN/configure deleted file mode 100755 index 6a01c74..0000000 --- a/contrib/peer2anonet/DEBIAN/configure +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -read -p "Enter your anonet network: " P2A_NET -read -p "Enter your anonet router: " P2A_ROUTE -read -p "Enter your anonet asn: " P2A_ASN -read -p "Enter your anonet ip: " P2A_IP - -echo "P2A_NET=\"$P2A_NET\"" >>DEBIAN/peer2anonet/etc/peer2anonet/p2a.conf -echo "P2A_ROUTE=\"$P2A_ROUTE\"" >>DEBIAN/peer2anonet/etc/peer2anonet/p2a.conf -echo "P2A_ASN=\"$P2A_ASN\"" >>DEBIAN/peer2anonet/etc/peer2anonet/p2a.conf -echo "P2A_IP=\"$P2A_IP\"" >>DEBIAN/peer2anonet/etc/peer2anonet/p2a.conf diff --git a/contrib/peer2anonet/DEBIAN/control b/contrib/peer2anonet/DEBIAN/control deleted file mode 100644 index 903b29e..0000000 --- a/contrib/peer2anonet/DEBIAN/control +++ /dev/null @@ -1,12 +0,0 @@ -Source: peer2anonet -Priority: optional -Maintainer: d3v11 -Version: 1.0-0 -Package: peer2anonet -Architecture: all -Depends: bash(>= 4.1) -Description: peer2anonet 1.0-0 - peer2anonet is an autoconfiguration utility to easily establish a - peering session with BGP on AnoNet2. - - diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index 8b8eacf..1b300b4 100644 --- a/contrib/peer2anonet/README +++ b/contrib/peer2anonet/README @@ -1,64 +1,105 @@ DESCRIPTION: - peer2anonet is an autoconfiguration utility to easily establish a - peering session with BGP on AnoNet2. + + peer2anonet is an autoconfiguration utility for setting + up core services on AnoNet2. Enjoy :-). DEPENDS ON: - quicktun, bird, daemontools(non-deb), bash -USAGE: + quicktun, bird, daemontools(non-deb), bash + +AUTHOR: + + d3v11 from www.d3v11.ano somtimes, maybe, dunno. + + REPORT BULLSHIT TO: - --configure generate a new local configuration and exit + IRC: + + /relayhell/d3v11 - --update regenerate peer configurations + EMAIL: + + d3v11@d3v11.ano - --configure-peer generate a new peer configuration and update +USAGE: + + ./contrib/peer2anonet/peer2anonet --configure generate a new local configuration and exit - --rm-peer remove a peer configuration and update + ./contrib/peer2anonet/peer2anonet --update regenerate peer configurations - --install-daemontools installs daemontools + ./contrib/peer2anonet/peer2anonet --configure-peer generate a new peer configuration and update - --install-ucspi-tcp installs ucspi-tcp + ./contrib/peer2anonet/peer2anonet --rm-peer remove a peer configuration and update - --install-djbdns installs djbdns + ./contrib/peer2anonet/peer2anonet --install-daemontools installs daemontools -NOTES: + ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp installs ucspi-tcp - KEY PAIRS: + ./contrib/peer2anonet/peer2anonet --install-djbdns installs djbdns - before running peer2anonet to configure peers you can use - quicktun to generate keypairs: + ./contrib/peer2anonet/peer2anonet --configure-dns configures dnscache and tinydns zones - quicktun.keypair>/etc/peer2anonet/p2a.conf echo "P2A_ASN=\"$P2A_ASN\"">>/etc/peer2anonet/p2a.conf echo -e '\npeer2anonet: configured\n' + NICK=`cat conf/git_name` + ./scripts/add_as $P2A_ASN $NICK + ./scripts/add_ip $P2A_NET/24 $NICK + ./scripts/add_dom $NICK.ano $NICK a.ns.$NICK.ano/`cat db/dom/ano/$NICK/ns/a.ns.$NICK.ano` exit 0 } @@ -247,6 +255,7 @@ CONFIGURE_PEER(){ read -p " Enter your peer's asn: " PEERASN read -p " Enter your peer's public key: " PUBKEY read -p " Enter your private key: " SECKEY + [ -e /etc/peer2anonet/peers/"$PEER" ] && rm -r /etc/peer2anonet/peers/"$PEER" mkdir -p /etc/peer2anonet/peers/"$PEER" echo $REMOTEIP >/etc/peer2anonet/peers/"$PEER"/remote_ip echo $PEERIP >/etc/peer2anonet/peers/"$PEER"/peering_ip @@ -272,10 +281,13 @@ RM_PEER(){ } INSTALL_DAEMONTOOLS(){ + echo -e '\nINSTALL DAEMONTOOLS:\n' [[ $(echo X`which gcc`) == X ]] && echo ' error: cannot find gcc' [[ $(echo X`which gcc`) == X ]] && exit 1 [[ $(echo X`which make`) == X ]] && echo ' error: cannot find make' [[ $(echo X`which make`) == X ]] && exit 1 + [[ $(echo X`which csh`) == X ]] && echo ' error: cannot find csh' + [[ $(echo X`which csh`) == X ]] && exit 1 mkdir -p /package chmod 1755 /package cd /package @@ -286,9 +298,13 @@ INSTALL_DAEMONTOOLS(){ cd admin/daemontools-0.76 sed -i 's/gcc/gcc -include errno.h/g' src/conf-cc package/install + cp /etc/rc.local /etc/peer2anonet/rc.local.backup + sed -i "s/exit 0/csh -cf \'\/command\/svscanboot \&\'/" /etc/rc.local + chmod +x /etc/rc.local } INSTALL_UCSPI_TCP(){ + echo -e '\nINSTALL UCSPI-TCP:\n' [[ $(echo X`which gcc`) == X ]] && echo ' error: cannot find gcc' [[ $(echo X`which gcc`) == X ]] && exit 1 [[ $(echo X`which make`) == X ]] && echo ' error: cannot find make' @@ -304,6 +320,7 @@ INSTALL_UCSPI_TCP(){ } INSTALL_DJBDNS(){ + echo -e '\nINSTALL DJBDNS:\n' [[ $(echo X`which gcc`) == X ]] && echo ' error: cannot find gcc' [[ $(echo X`which gcc`) == X ]] && exit 1 [[ $(echo X`which make`) == X ]] && echo ' error: cannot find make' @@ -318,6 +335,59 @@ INSTALL_DJBDNS(){ make setup check } +CONFIGURE_DNS(){ + echo -e '\nCONFIGURE DNS:\n' + NICK=`cat conf/git_name` + TINYDNS_ROOT_IP=`cat conf/tinydns__rootsrvrip` + TINYDNS_ROOT_DOMAIN=`cat conf/tinydns__rootsrvrname` + TINYDNS_ANO_IP=`cat conf/tinydns__tldsrvrip` + TINYDNS_ANO_DOMAIN=`cat conf/tinydns__tldsrvrname` + TINYDNS_IP=`cat db/dom/ano/$NICK/ns/a.ns.$NICK.ano` + TINYDNS_DOMAIN="a.ns.$NICK.ano" + GIT_IP=`cat conf/gitd_ip` + GIT_DOMAIN="git.$NICK.ano" + + ip addr add $TINYDNS_ROOT_IP/32 dev lo & + ip addr add $TINYDNS_IP/32 dev lo & + ip addr add $TINYDNS_ANO_IP/32 dev lo & + ip addr add $GIT_IP/32 dev lo & + + echo "ip addr add $TINYDNS_ROOT_IP/32 dev lo &" >> /etc/rc.local + echo "ip addr add $TINYDNS_IP/32 dev lo &" >> /etc/rc.local + echo "ip addr add $TINYDNS_ANO_IP/32 dev lo &" >> /etc/rc.local + echo "ip addr add $GIT_IP/32 dev lo &" >> /etc/rc.local + + useradd Gdnscache + useradd Gdnslog + useradd Gtinydns + + dnscache-conf Gdnscache Gdnslog /services/dnscache + mv /services/dnscache/root/servers/@ /services/dnscache/root/servers/@.icann + echo $TINYDNS_ROOT_IP >/services/dnscache/root/servers/@ + echo 'nameserver 127.0.0.1' >/etc/resolv.conf + ( cd / ; ln -s /services/dnscache /service/dnscache ) + + tinydns-conf Gtinydns Gdnslog /services/tinydns $TINYDNS_IP + ( cd / ; ln -s /services/tinydns /service/tinydns ) + ( cd /service/tinydns/root ; ./add-ns $TINYDNS_DOMAIN $TINYDNS_IP ) + ( cd /service/tinydns/root ; ./add-alias $GIT_DOMAIN $GIT_IP ) + ( cd /service/tinydns/root ; ./add-alias $TINYDNS_ANO_IP $TINYDNS_ROOT_IP ) + ( cd /service/tinydns/root ; ./add-alias $TINYDNS_ANO_DOMAIN $TINYDNS_ANO_IP ) + ( cd /service/tinydns/root ; make ) + + tinydns-conf Gtinydns Gdnslog /services/tinydns-root $TINYDNS_ROOT_IP + ( cd / ; ln -s /services/tinydns-root /service/tinydns-root ) + ./scripts/nameserver_autogen/tinydns_root_datafile > /service/tinydns-root/root/data + ( cd /service/tinydns-root/root ; make ) + + tinydns-conf Gtinydns Gdnslog /services/tinydns-ano $TINYDNS_ANO_IP + ( cd / ; ln -s /services/tinydns-ano /service/tinydns-ano ) + ./scripts/nameserver_autogen/tinydns_tld_datafile > /service/tinydns-ano/root/data + ( cd /service/tinydns-ano/root ; make ) + + ( cd /service ; svc -t dnscache tinydns* ) + } + if [ "$1" == '--configure' ]; then CONFIGURE @@ -335,6 +405,8 @@ elif [ "$1" == '--install-ucspi-tcp' ]; then INSTALL_UCSPI_TCP elif [ "$1" == '--install-djbdns' ]; then INSTALL_DJBDNS +elif [ "$1" == '--configure-dns' ]; then + CONFIGURE_DNS else USAGE fi -- cgit v1.2.3 From 9002a3eb108b7bb58797527875e25eb1c906d9c8 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sat, 26 Nov 2011 23:47:46 +0000 Subject: updates for peer2anonet --- contrib/peer2anonet/README | 7 +++++++ contrib/peer2anonet/peer2anonet | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 9 deletions(-) (limited to 'contrib/peer2anonet/README') diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index 1b300b4..1693e7c 100644 --- a/contrib/peer2anonet/README +++ b/contrib/peer2anonet/README @@ -101,6 +101,13 @@ RTFM: ./contrib/peer2anonet/peer2anonet --configure-dns + COMPLAIN: + + If this README doesn't tell you what you need to know + you can head over to www.d3v11.ano/peering. If that + doesn't get you what you want then either complain to + me or shoot both of us in the face. + diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index e704913..6f5bbb2 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -36,19 +36,28 @@ CONFIGURE(){ read -p " Enter your AnoNet router: " P2A_ROUTE read -p " Enter your peering ip: " P2A_IP read -p " Enter your AnoNet asn: " P2A_ASN + + echo "P2A_NET=\"$P2A_NET\"">/etc/peer2anonet/p2a.conf echo "P2A_ROUTE=\"$P2A_ROUTE\"">>/etc/peer2anonet/p2a.conf echo "P2A_IP=\"$P2A_IP\"">>/etc/peer2anonet/p2a.conf echo "P2A_ASN=\"$P2A_ASN\"">>/etc/peer2anonet/p2a.conf echo -e '\npeer2anonet: configured\n' + NICK=`cat conf/git_name` ./scripts/add_as $P2A_ASN $NICK ./scripts/add_ip $P2A_NET/24 $NICK - ./scripts/add_dom $NICK.ano $NICK a.ns.$NICK.ano/`cat db/dom/ano/$NICK/ns/a.ns.$NICK.ano` exit 0 } UPDATE(){ + if [ -e /etc/peer2anonet/p2a.conf ]; then + source /etc/peer2anonet/p2a.conf + else + CONFIGURE + exit 0 + fi + echo -e '\nUPDATE:\n' if [[ $(ls /etc/peer2anonet/peers) ]]; then for PEER in `ls /etc/peer2anonet/peers`; do @@ -233,13 +242,19 @@ exec /usr/sbin/quicktun.nacltai" > /etc/peer2anonet/peers/$PEER/run fi chmod +x /services/"$PEER"/run test -L "/service/$PEER" || ln -s "/services/$PEER" "/service/$PEER" - svc -d "/service/$PEER" && svc -u "/service/$PEER" done test -L /service/bird || ln -s /services/bird /service/bird echo configure | birdc } CONFIGURE_PEER(){ + if [ -e /etc/peer2anonet/p2a.conf ]; then + source /etc/peer2anonet/p2a.conf + else + CONFIGURE + exit 0 + fi + echo -e '\nCONFIGURE PEER:\n' read -p " Enter your peer's name: " PEER read -p " Enter your peer's remote ip: " REMOTEIP @@ -260,6 +275,13 @@ CONFIGURE_PEER(){ } RM_PEER(){ + if [ -e /etc/peer2anonet/p2a.conf ]; then + source /etc/peer2anonet/p2a.conf + else + CONFIGURE + exit 0 + fi + echo -e '\nRM PEER:\n' read -p " Enter your peer's name: " PEER if [ -e /etc/peer2anonet/peers/"$PEER" ]; then @@ -329,6 +351,13 @@ INSTALL_DJBDNS(){ } CONFIGURE_DNS(){ + if [ -e /etc/peer2anonet/p2a.conf ]; then + source /etc/peer2anonet/p2a.conf + else + CONFIGURE + exit 0 + fi + echo -e '\nCONFIGURE DNS:\n' NICK=`cat conf/git_name` TINYDNS_ROOT_IP=`cat conf/tinydns__rootsrvrip` @@ -390,13 +419,6 @@ CONFIGURE_DNS(){ ( cd /service ; svc -t dnscache tinydns* ) } -if [ -e /etc/peer2anonet/p2a.conf ]; then - source /etc/peer2anonet/p2a.conf -else - CONFIGURE - exit 0 -fi - if [ "$1" == '--configure' ]; then CONFIGURE -- cgit v1.2.3 From 693cadd1df535a6875b26a659ea8d080cc6a5481 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Tue, 29 Nov 2011 09:23:30 +0000 Subject: updates for peer2anonet, ./contrib/peer2anonet/peer2anonet --update-dns can now bring tinydns-ano up to date. --- contrib/peer2anonet/README | 113 ---------------------------------- contrib/peer2anonet/README.html | 130 ++++++++++++++++++++++++++++++++++++++++ contrib/peer2anonet/peer2anonet | 101 +++++++++++++++++++++++-------- 3 files changed, 207 insertions(+), 137 deletions(-) delete mode 100644 contrib/peer2anonet/README create mode 100644 contrib/peer2anonet/README.html (limited to 'contrib/peer2anonet/README') diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README deleted file mode 100644 index 1693e7c..0000000 --- a/contrib/peer2anonet/README +++ /dev/null @@ -1,113 +0,0 @@ -DESCRIPTION: - - peer2anonet is an autoconfiguration utility for setting - up core services on AnoNet2. Enjoy :-). - -DEPENDS ON: - - quicktun, bird, daemontools(non-deb), bash - -AUTHOR: - - d3v11 from www.d3v11.ano somtimes, maybe, dunno. - - REPORT BULLSHIT TO: - - IRC: - - /relayhell/d3v11 - - EMAIL: - - d3v11@d3v11.ano - -USAGE: - - ./contrib/peer2anonet/peer2anonet --configure generate a new local configuration and exit - - ./contrib/peer2anonet/peer2anonet --update regenerate peer configurations - - ./contrib/peer2anonet/peer2anonet --configure-peer generate a new peer configuration and update - - ./contrib/peer2anonet/peer2anonet --rm-peer remove a peer configuration and update - - ./contrib/peer2anonet/peer2anonet --install-daemontools installs daemontools - - ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp installs ucspi-tcp - - ./contrib/peer2anonet/peer2anonet --install-djbdns installs djbdns - - ./contrib/peer2anonet/peer2anonet --configure-dns configures dnscache and tinydns zones - -RTFM: - - CONFIGURE: - - I highly recommend that before you use peer2anonet - you ./configure resdb with tinydns support. - - ./contrib/peer2anonet/peer2anonet --configure - - EXAMPLES: - - Enter your AnoNet subnet: 1.2.3.0 - Enter your AnoNet router: 1.2.3.1 - Enter your peering ip: 1.2.3.4 - Enter your AnoNet asn: 1234 - - CONFIGURE PEER: - - ./contrib/peer2anonet/peer2anonet --configure-peer - - KEY PAIRS: - - before running peer2anonet to configure peers you can use - quicktun to generate keypairs: - - quicktun.keypair +
+DESCRIPTION:
+
+    peer2anonet is an autoconfiguration utility for setting
+    up core services on AnoNet2. Enjoy :-).
+
+DEPENDS ON:
+
+    quicktun, bird, bash for now. it also installs some cool shit
+    that you'll use later.
+
+AUTHOR:
+
+    d3v11 from www.d3v11.ano, somtimes, maybe, dunno.
+
+    REPORT BULLSHIT TO:
+
+        IRC:
+        
+            /relayhell/d3v11
+
+        EMAIL:
+        
+            d3v11@d3v11.ano
+
+USAGE:
+
+    ./contrib/peer2anonet/peer2anonet --configure             generate a new local configuration and exit
+
+    ./contrib/peer2anonet/peer2anonet --update                regenerate peer configurations
+
+    ./contrib/peer2anonet/peer2anonet --configure-peer        generate a new peer configuration and update
+
+    ./contrib/peer2anonet/peer2anonet --rm-peer               remove a peer configuration and update
+
+    ./contrib/peer2anonet/peer2anonet --install-daemontools   installs daemontools
+
+    ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp     installs ucspi-tcp
+
+    ./contrib/peer2anonet/peer2anonet --install-djbdns        installs djbdns
+
+    ./contrib/peer2anonet/peer2anonet --configure-dns         configures dnscache and tinydns zones
+
+    ./contrib/peer2anonet/peer2anonet --update-dns            updates tinydns-ano zone
+
+RTFM:
+
+    CONFIGURE:
+
+        I highly recommend that before you use peer2anonet
+        you ./configure resdb with tinydns support.
+
+        ./contrib/peer2anonet/peer2anonet --configure
+
+        EXAMPLES:
+
+            Enter your AnoNet subnet: 1.2.3.0
+            Enter your AnoNet router: 1.2.3.1
+            Enter your peering ip: 1.2.3.4
+            Enter your AnoNet asn: 1234
+
+    CONFIGURE PEER:
+
+        ./contrib/peer2anonet/peer2anonet --configure-peer
+
+            KEY PAIRS:
+
+                before running peer2anonet to configure peers you can use
+                quicktun to generate keypairs:
+
+                    quicktun.keypair < /dev/random
+
+            EXAMPLES:
+
+                Enter your peer's name: d3v11
+                Enter your peer's remote ip: 11.11.55.1
+                Enter your peer's peering ip: 1.1.5.2
+                Enter your peer's remote port: 21150
+                Enter your local port: 61150
+                Enter your peer's asn: 1150
+                Enter your peer's public key: * see KEY PAIRS above *
+                Enter your private key: * see KEY PAIRS above *
+
+            RUN CHANGES:
+
+                peer2anonet exports the /service/$PEER/run file to
+                /etc/peer2anonet/peers/$PEER/run. If you need to
+                create customizations for peerings then make adjustments
+                to that file.
+
+            CONFIGURATION FILES:
+
+                /etc/peer2anonet/peers/$PEER/* contains:
+                
+                    asn  local_port  peering_ip  pubkey  remote_ip  remote_port  run  seckey
+
+                In the event you want to reconfigure a peer's tunnel you can alter the run
+                file and do `--update', rm run and modify the above files then use `--update',
+                or reconfigure the peering tunnel altogether with --configure-peer and choose
+                that peer's name. If you think this is absurd then you're probably right! I 
+                plan on doing something with these files later.
+
+    CONFIGURE DNS:
+
+        If you did not ./configure resdb with tinydns support
+        then you need to do that before using this function.
+
+        also before using you will need to have installed
+        daemontools, djbdns, and ucspi-tcp. peer2anonet
+        can do this for you with --install-* options.
+
+        ./contrib/peer2anonet/peer2anonet --configure-dns
+
+        UPDATE DNS:
+
+            After a successful `--configure-dns', you can now
+            enjoy to use `--update-dns' to bring your AnoNet
+            domains up to speed.
+
+    COMPLAIN:
+
+        If this README doesn't tell you what you need to know
+        you can head over to www.d3v11.ano/peering. If that
+        doesn't get you what you want then either complain to
+        me or shoot both of us in the face.
+
+
+      
+
diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 4e6aad3..bfa671b 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -21,7 +21,8 @@ USAGE(){ echo -e '\n ./contrib/peer2anonet/peer2anonet --install-daemontools installs daemontools' echo -e '\n ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp installs ucspi-tcp' echo -e '\n ./contrib/peer2anonet/peer2anonet --install-djbdns installs djbdns' - echo -e '\n ./contrib/peer2anonet/peer2anonet --configure-dns configures dnscache and tinydns zones\n' + echo -e '\n ./contrib/peer2anonet/peer2anonet --configure-dns configures dnscache and tinydns zones' + echo -e '\n ./contrib/peer2anonet/peer2anonet --update-dns updates tinydns-ano zone\n' exit 0 } @@ -399,9 +400,13 @@ CONFIGURE_DNS(){ tar cf /etc/peer2anonet/tinydns-root.tar tinydns-root ) fi - (cd /service ; svc -d dnscache tinydns tinydns-ano tinydns-root) - (cd /service ; rm -f dnscache tinydns tinydns-ano tinydns-root) - (cd /services ; rm -rf dnscache tinydns tinydns-ano tinydns-root) + ( + cd /service + svc -d dnscache tinydns tinydns-ano tinydns-root + rm -f dnscache tinydns tinydns-ano tinydns-root + cd /services + rm -rf dnscache tinydns tinydns-ano tinydns-root + ) echo -e '\nCONFIGURE DNS:\n' NICK=`cat conf/git_name` @@ -443,22 +448,13 @@ CONFIGURE_DNS(){ tinydns-conf Gtinydns Gdnslog /services/tinydns $TINYDNS_IP - #echo ".$NICK.ano:$TINYDNS_IP:a:259200" > /services/tinydns/root/data - #echo "=www.$NICK.ano:$GIT_IP:86400" >> /services/tinydns/root/data - #echo "+git.$NICK.ano:$GIT_IP:86400" >> /services/tinydns/root/data - #echo "+$NICK.ano:$GIT_IP:86400" >> /services/tinydns/root/data - #echo "+$TINYDNS_ANO_DOMAIN:$TINYDNS_ANO_IP:3600" >> /services/tinydns/root/data - #echo ".1.in-addr.arpa::$TINYDNS_ANO_DOMAIN" >> /services/tinydns/root/data - #echo ".2.in-addr.arpa::$TINYDNS_ANO_DOMAIN" >> /services/tinydns/root/data - #echo ".ano::$TINYDNS_ANO_DOMAIN" >> /services/tinydns/root/data - #echo ".ntwrk::$TINYDNS_ANO_DOMAIN" >> /services/tinydns/root/data ( - cd /services/tinydns/root - ./add-ns $NICK.ano $TINYDNS_IP - ./add-alias $GIT_DOMAIN $GIT_IP - ./add-alias $TINYDNS_ROOT_DOMAIN $TINYDNS_ROOT_IP - ./add-alias $TINYDNS_ANO_DOMAIN $TINYDNS_ANO_IP - make + cd /services/tinydns/root + ./add-ns $NICK.ano $TINYDNS_IP + ./add-alias $GIT_DOMAIN $GIT_IP + ./add-alias $TINYDNS_ROOT_DOMAIN $TINYDNS_ROOT_IP + ./add-alias $TINYDNS_ANO_DOMAIN $TINYDNS_ANO_IP + make ) tinydns-conf Gtinydns Gdnslog /services/tinydns-root $TINYDNS_ROOT_IP @@ -469,11 +465,66 @@ CONFIGURE_DNS(){ ./scripts/nameserver_autogen/tinydns_tld_datafile > /services/tinydns-ano/root/data ( cd /services/tinydns-ano/root ; make ) - ( cd / ; ln -s /services/dnscache /service/dnscache ) - ( cd / ; ln -s /services/tinydns /service/tinydns ) - ( cd / ; ln -s /services/tinydns-ano /service/tinydns-ano ) - ( cd / ; ln -s /services/tinydns-root /service/tinydns-root ) - ( cd /service ; sleep 5 ; svc -t dnscache tinydns tinydns-ano tinydns-root ) + ( + cd / + ln -s /services/dnscache /service/dnscache + ln -s /services/tinydns /service/tinydns + ln -s /services/tinydns-ano /service/tinydns-ano + ln -s /services/tinydns-root /service/tinydns-root + cd /service ; sleep 5 ; svc -t dnscache tinydns tinydns-ano tinydns-root + ) + } + +INSTALL_DJBDNS(){ + echo -e '\nINSTALL DJBDNS:\n' + [[ $(echo X`which gcc`) == X ]] && echo ' fatal error: cannot find gcc' + [[ $(echo X`which gcc`) == X ]] && exit 1 + [[ $(echo X`which make`) == X ]] && echo ' fatal error: cannot find make' + [[ $(echo X`which make`) == X ]] && exit 1 + [[ $(echo X`which tcpserver`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2nonet --install-ucspi-tcp' + [[ $(echo X`which tcpserver`) == X ]] && exit 1 + [[ $(echo X`which svscanboot`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2nonet --install-daemontools' + [[ $(echo X`which svscanboot`) == X ]] && exit 1 + cd /usr/local/src + wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz + gunzip djbdns-1.05.tar + tar -xf djbdns-1.05.tar + cd djbdns-1.05 + echo gcc -O2 -include /usr/include/errno.h > conf-cc + make + make setup check + } + +UPDATE_DNS(){ + if [ -e /etc/peer2anonet/p2a.conf ]; then + source /etc/peer2anonet/p2a.conf + else + CONFIGURE + exit 0 + fi + + [[ $(echo X`which tcpserver`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2nonet --install-ucspi-tcp' + [[ $(echo X`which tcpserver`) == X ]] && exit 1 + [[ $(echo X`which svscanboot`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2nonet --install-daemontools' + [[ $(echo X`which svscanboot`) == X ]] && exit 1 + + if [ -e /services/tinydns-ano ]; then + ( + cd /services + echo "creating /etc/peer2anonet/tinydns-ano.tar backup" + tar cf /etc/peer2anonet/tinydns-ano.tar tinydns-ano + ) + fi + + echo -e '\nUPDATE DNS:\n' + ./scripts/nameserver_autogen/tinydns_tld_datafile > /services/tinydns-ano/root/data + ( cd /services/tinydns-ano/root ; make ) + + ( + cd /service + sleep 5 + svc -t dnscache tinydns tinydns-ano tinydns-root + ) } @@ -495,6 +546,8 @@ elif [ "$1" == '--install-djbdns' ]; then INSTALL_DJBDNS elif [ "$1" == '--configure-dns' ]; then CONFIGURE_DNS +elif [ "$1" == '--update-dns' ]; then + UPDATE_DNS else USAGE fi -- cgit v1.2.3