From 31aa0f9bb8466d43930128170a87b647c9d53dd2 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Wed, 2 Nov 2011 23:34:38 -0400 Subject: Peer2AnoNet updated --- contrib/peer2anonet/peer2anonet | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 64af216..f64a07b 100644 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -136,7 +136,15 @@ mkdir -p /services/"$PEERNAME" ######################################################################### # Create files to configure the new peering session: echo "#!/bin/sh +# uncomment if your peer has a dynamic IP +# #export REMOTE_FLOAT=1 + +# uncomment for debugging. you'll need to use ./run to view output instead +# of svc -u /service/ +# +#export DEBUG=1 + export REMOTE_ADDRESS=$REMOTEIP export REMOTE_PORT=$PEERPORT export LOCAL_PORT=$ADDPORT @@ -144,6 +152,15 @@ export PRIVATE_KEY=\"\$(cat seckey)\" export PUBLIC_KEY=$PUBKEY export TUN_MODE=1 export INTERFACE=ppp-$PEERNAME + +# uncomment if you want to nuke your default gateway and configure +# routes only to peers through IcannNet. If any of your peers use +# dynamic IP's or you use Tor or i2p then this is probably NOT a +# good idea. +# +#route del default gw `ip route show | grep default | cut -d' ' -f 3` +#route add $REMOTE_ADDRESS gw `ip route show | grep default | cut -d' ' -f 3 + ( sleep 5; ip addr add $P2A_IP peer $PEERIP/32 dev \$INTERFACE scope link ip addr add $P2A_ROUTE/32 dev \$INTERFACE scope global @@ -161,8 +178,8 @@ echo 'Secret Key Goes Here!' > "/services/$PEERNAME/seckey" echo "peer2anonet: New peering session configured. Please place your secret key in: /services/$PEERNAME/seckey -To allow remote floating: -uncomment REMOTE_FLOAT=1 in /services/$PEERNAME/run" +Some additional options are available in /services/$PEERNAME/run +Please read the comments in the file for details." -- cgit v1.2.3 From 06c7e29cb8008b697463f02d693826f64643499f Mon Sep 17 00:00:00 2001 From: d3v11 Date: Thu, 3 Nov 2011 14:13:00 -0400 Subject: Peer2AnoNet updated: made changes to ./run configuration and included better documentation. --- contrib/peer2anonet/peer2anonet | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index f64a07b..2416d74 100644 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -156,10 +156,13 @@ export INTERFACE=ppp-$PEERNAME # uncomment if you want to nuke your default gateway and configure # routes only to peers through IcannNet. If any of your peers use # dynamic IP's or you use Tor or i2p then this is probably NOT a -# good idea. +# good idea. You may need to modify the DEFAULT_ROUTE code below. +# If you run into problems with this please email d3v11@d3v11.ano +# so I can create a patch. # -#route del default gw `ip route show | grep default | cut -d' ' -f 3` -#route add $REMOTE_ADDRESS gw `ip route show | grep default | cut -d' ' -f 3 +#DEFAULT_ROUTE=`ip route show | grep default | cut -d' ' -f 3` +#route del default gw $DEFAULT_ROUTE +#route add $REMOTE_ADDRESS gw $DEFAULT_ROUTE ( sleep 5; ip addr add $P2A_IP peer $PEERIP/32 dev \$INTERFACE scope link -- cgit v1.2.3 From 8ebb4c96fa73fd490aff71076da273214200d5ee Mon Sep 17 00:00:00 2001 From: d3v11 Date: Thu, 3 Nov 2011 19:35:29 -0400 Subject: Peer2AnoNet bug fixed with run script, ping hack --- contrib/peer2anonet/peer2anonet | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 2416d74..a09d42c 100644 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -168,7 +168,7 @@ export INTERFACE=ppp-$PEERNAME ip addr add $P2A_IP peer $PEERIP/32 dev \$INTERFACE scope link ip addr add $P2A_ROUTE/32 dev \$INTERFACE scope global ip link set dev \$INTERFACE up - ping -c 1 -I $INTERFACE -r -w 5 + ping -c 1 -I \$INTERFACE -r -w 5 ) & exec /usr/sbin/quicktun.nacltai" > /services/"$PEERNAME"/run chmod +x /services/"$PEERNAME"/run @@ -182,7 +182,8 @@ echo "peer2anonet: New peering session configured. Please place your secret key in: /services/$PEERNAME/seckey Some additional options are available in /services/$PEERNAME/run -Please read the comments in the file for details." +Please read the comments in the file for details. You may need to +restart the bird daemon. ie, svc -t /service/bird " -- cgit v1.2.3 From b793e8463cdaec932d3de4e52514cc2f2aeb4fc3 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Thu, 3 Nov 2011 19:45:30 -0400 Subject: peer2anonet bug(s) fixed with new /service*//run configurations --- contrib/peer2anonet/peer2anonet | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index a09d42c..9816304 100644 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -160,9 +160,9 @@ export INTERFACE=ppp-$PEERNAME # If you run into problems with this please email d3v11@d3v11.ano # so I can create a patch. # -#DEFAULT_ROUTE=`ip route show | grep default | cut -d' ' -f 3` -#route del default gw $DEFAULT_ROUTE -#route add $REMOTE_ADDRESS gw $DEFAULT_ROUTE +#DEFAULT_ROUTE=\`ip route show | grep default | cut -d' ' -f 3\` +#route del default gw \$DEFAULT_ROUTE +#route add \$REMOTE_ADDRESS gw \$DEFAULT_ROUTE ( sleep 5; ip addr add $P2A_IP peer $PEERIP/32 dev \$INTERFACE scope link -- cgit v1.2.3 From cd1cd5834b7c5863ac1c462df68653d2fc70b9e0 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Thu, 3 Nov 2011 20:07:15 -0400 Subject: peer2anonet pinghack bug fixed --- contrib/peer2anonet/peer2anonet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 9816304..1072659 100644 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -168,7 +168,7 @@ export INTERFACE=ppp-$PEERNAME ip addr add $P2A_IP peer $PEERIP/32 dev \$INTERFACE scope link ip addr add $P2A_ROUTE/32 dev \$INTERFACE scope global ip link set dev \$INTERFACE up - ping -c 1 -I \$INTERFACE -r -w 5 + ping -c 1 -I \$INTERFACE $PEERIP -r -w 5 ) & exec /usr/sbin/quicktun.nacltai" > /services/"$PEERNAME"/run chmod +x /services/"$PEERNAME"/run -- cgit v1.2.3 From 8c4564fc4c6f9f94bd837af6ba5716d9b58c6f3a Mon Sep 17 00:00:00 2001 From: d3v11 Date: Thu, 3 Nov 2011 20:09:30 -0400 Subject: peer2anonet update --- contrib/peer2anonet/peer2anonet | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 1072659..4bbb164 100644 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -168,6 +168,8 @@ export INTERFACE=ppp-$PEERNAME ip addr add $P2A_IP peer $PEERIP/32 dev \$INTERFACE scope link ip addr add $P2A_ROUTE/32 dev \$INTERFACE scope global ip link set dev \$INTERFACE up +# comment the following ping line to remove pinghack. this is a +# trick used to help bird connect. ping -c 1 -I \$INTERFACE $PEERIP -r -w 5 ) & exec /usr/sbin/quicktun.nacltai" > /services/"$PEERNAME"/run -- cgit v1.2.3 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/Makefile | 32 ----- contrib/peer2anonet/README | 73 +--------- contrib/peer2anonet/configure | 12 -- contrib/peer2anonet/peer2anonet | 286 ++++++++++++++++++++++++++-------------- 4 files changed, 191 insertions(+), 212 deletions(-) delete mode 100644 contrib/peer2anonet/Makefile delete mode 100755 contrib/peer2anonet/configure mode change 100644 => 100755 contrib/peer2anonet/peer2anonet (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/Makefile b/contrib/peer2anonet/Makefile deleted file mode 100644 index b3d0ee5..0000000 --- a/contrib/peer2anonet/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/make -f - -install-deb: - make clean - rm -rf DEBIAN/peer2anonet *.deb - mkdir DEBIAN/peer2anonet - mkdir DEBIAN/peer2anonet/DEBIAN - mkdir DEBIAN/peer2anonet/usr - mkdir DEBIAN/peer2anonet/usr/bin - mkdir DEBIAN/peer2anonet/etc - mkdir DEBIAN/peer2anonet/etc/peer2anonet - cp DEBIAN/control DEBIAN/peer2anonet/DEBIAN/control - cp peer2anonet DEBIAN/peer2anonet/usr/bin/peer2anonet - chmod +x DEBIAN/peer2anonet/usr/bin/peer2anonet - DEBIAN/configure - dpkg-deb --build DEBIAN/peer2anonet - dpkg -i DEBIAN/peer2anonet.deb - rm -rf DEBIAN/peer2anonet DEBIAN/peer2anonet.deb - -install: - make clean - make uninstall - cp peer2anonet /usr/bin/peer2anonet - chmod +x /usr/bin/peer2anonet - mkdir /etc/peer2anonet - ./configure - -uninstall: - rm -rf /usr/bin/peer2anonet /etc/peer2anonet - -clean: - rm -rf DEBIAN/peer2anonet DEBIAN/peer2anonet.deb 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. diff --git a/contrib/peer2anonet/configure b/contrib/peer2anonet/configure deleted file mode 100755 index d9a574d..0000000 --- a/contrib/peer2anonet/configure +++ /dev/null @@ -1,12 +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 '' >/etc/peer2anonet/p2a.conf - -echo "P2A_NET=\"$P2A_NET\"" >>/etc/peer2anonet/p2a.conf -echo "P2A_ROUTE=\"$P2A_ROUTE\"" >>/etc/peer2anonet/p2a.conf -echo "P2A_ASN=\"$P2A_ASN\"" >>/etc/peer2anonet/p2a.conf -echo "P2A_IP=\"$P2A_IP\"" >>/etc/peer2anonet/p2a.conf diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet old mode 100644 new mode 100755 index 4bbb164..7b01f24 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -1,75 +1,119 @@ #!/bin/bash -######################################################################### -# We need to check for root privileges: if [[ $(id -u) != 0 ]]; then - echo "peer2anonet: error: root privileges required." - exit 1 + echo "error: root privileges required." + exit 1 fi -######################################################################### -# We need to source our peer2anonet variables -source /etc/peer2anonet/p2a.conf +USAGE(){ + echo -e '\npeer2anonet:' + echo -e '\n --configure generate a new local configuration and exit' + echo -e '\n --update regenerate peer configurations' + echo -e '\n --configure-peer generate a new peer configuration and update' + echo -e '\n --rm-peer remove a peer configuration and update\n' + exit 0 + } -######################################################################### -# We need to see if service(s) directories exist: +mkdir -p /service mkdir -p /services mkdir -p /services/bird -mkdir -p /service - -######################################################################### -# We need to get info for the new peering and BGP session: -read -p "Enter your peer's name/interface: " PEERNAME -read -p "Enter your peer's remote ip: " REMOTEIP -read -p "Enter your peer's anonet 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 - -######################################################################### -# Do some security checks on variables: -TEST[0]=$PEERNAME; TEST[1]=$REMOTEIP; TEST[2]=$PEERIP - TEST[3]=$PEERPORT; TEST[4]=$PEERASN - -for((X=0;X<=2;X++)); do -if [[ $(echo ${TEST[$X]} | tr -d 'a-zA-Z0-9._-' | wc -c) -gt 1 ]]; then -echo ${TEST[$X]} | tr -d 'a-zA-Z0-9' | wc -c - echo "peer2anonet: fatal error: unacceptable data: ${TEST[$X]} -" - exit 1 -fi -done - -for((X=3;X<=4;X++)); do -if [[ $(echo ${TEST[$X]} | tr -d '0-9' | wc -c) -gt 1 ]]; then - echo "peer2anonet: fatal error: unacceptable data: ${TEST[$X]} -" - exit 1 +mkdir -p /etc/peer2anonet +mkdir -p /etc/peer2anonet/peers + +if [ -e /etc/peer2anonet/p2a.conf ]; then + source /etc/peer2anonet/p2a.conf +else + echo "peer2anonet: needs --configure prior to usage" + exit 1 fi -done -if [[ $(echo "$PUBKEY" | tr -d 'a-zA-Z0-9' | wc -c) -gt 1 ]]; then - echo "peer2anonet: fatal error: unacceptable data: ${TEST[$X]} -" - exit 1 -fi - -ADDPORT="2$(($PEERASN % 10000))" - -######################################################################### -# We need to check if base files need to be imported to services for bird: -NEW_PROTOCOL=" -protocol bgp $PEERNAME { table AnoNet_routes; - local as $P2A_ASN; - neighbor $PEERIP as $PEERASN; - source address $P2A_IP; - import filter only_AnoNet_ebgp; - export filter only_AnoNet_ebgp_export; -}" - -BIRD_RUN='#!/bin/sh -exec bird -c bird.conf -d' - -BIRD_CONF="function n_AnoNet_mine (prefix arg) { +CONFIGURE(){ + echo -e '\nCONFIGURE:\n' + read -p " Enter your AnoNet subnet: " P2A_NET + 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' + exit 0 + } + +UPDATE(){ + echo -e '\nUPDATE:\n' + if [[ $(ls /etc/peer2anonet/peers) ]]; then + for PEER in `ls /etc/peer2anonet/peers`; do + if [ -e /etc/peer2anonet/peers/"$PEER"/remote_ip ]; then + if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/remote_ip`) == 'X' ]]; then + echo " error: /etc/peer2anonet/peers/$PEER/remote_ip is void" + exit 1 + fi + else + echo " error: /etc/peer2anonet/peers/$PEER/remote_ip not exists" + exit 1 + fi + + if [ -e /etc/peer2anonet/peers/"$PEER"/peering_ip ]; then + if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/peering_ip`) == 'X' ]]; then + echo " error: /etc/peer2anonet/peers/$PEER/peering_ip is void" + exit 1 + fi + else + echo " error: /etc/peer2anonet/peers/$PEER/peering_ip not exists" + exit 1 + fi + + if [ -e /etc/peer2anonet/peers/"$PEER"/port ]; then + if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/port`) == 'X' ]]; then + echo " error: /etc/peer2anonet/peers/$PEER/port is void" + exit 1 + fi + else + echo " error: /etc/peer2anonet/peers/$PEER/port not exists" + exit 1 + fi + + if [ -e /etc/peer2anonet/peers/"$PEER"/asn ]; then + if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/asn`) == 'X' ]]; then + echo " error: /etc/peer2anonet/peers/$PEER/asn is void" + exit 1 + fi + else + echo " error: /etc/peer2anonet/peers/$PEER/asn not exists" + exit 1 + fi + + if [ -e /etc/peer2anonet/peers/"$PEER"/pubkey ]; then + if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/pubkey`) == 'X' ]]; then + echo " error: /etc/peer2anonet/peers/$PEER/pubkey is void" + exit 1 + fi + else + echo " error: /etc/peer2anonet/peers/$PEER/pubkey not exists" + exit 1 + fi + + if [ -e /etc/peer2anonet/peers/"$PEER"/seckey ]; then + if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/seckey`) == 'X' ]]; then + echo " error: /etc/peer2anonet/peers/$PEER/seckey is void" + exit 1 + fi + else + echo " error: /etc/peer2anonet/peers/$PEER/seckey not exists" + exit 1 + fi + done + else + echo " error: peering configurations not exists" + exit 1 + fi + + echo '#!/bin/bash +bird -c bird.conf -d' > /services/bird/run + chmod +x /services/bird/run + + echo "function n_AnoNet_mine (prefix arg) { if arg ~ [ $P2A_NET/24+ ] then return true; return false; }; @@ -116,26 +160,28 @@ protocol device { protocol direct direct_AnoNet_routes { table AnoNet_routes; interface \"eth0\"; import filter only_AnoNet; -}" - - - -test -e /services/bird/bird.conf || echo "$BIRD_CONF" > /services/bird/bird.conf -test -e /services/bird/run || echo "$BIRD_RUN" > /services/bird/run -chmod +x /services/bird/run -echo "$NEW_PROTOCOL" >> /services/bird/bird.conf -test -L /services/bird && rm -r /service/bird -test -L /service/bird || ln -s /services/bird /service/ - -######################################################################### -# We need to check if this peering session already exists: -test -e /services/"$PEERNAME" && rm -r /services/"$PEERNAME" -mkdir -p /services/"$PEERNAME" - +}" > /services/bird/bird.conf + + 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` + PEERASN=`cat /etc/peer2anonet/peers/"$PEER"/asn` + PUBKEY=`cat /etc/peer2anonet/peers/"$PEER"/pubkey` + SECKEY=`cat /etc/peer2anonet/peers/"$PEER"/seckey` + + echo " +protocol bgp $PEERNAME { table AnoNet_routes; + local as $P2A_ASN; + neighbor $PEERIP as $PEERASN; + source address $P2A_IP; + import filter only_AnoNet_ebgp; + export filter only_AnoNet_ebgp_export; +}" >> /services/bird/bird.conf -######################################################################### -# Create files to configure the new peering session: -echo "#!/bin/sh + echo "#!/bin/bash # uncomment if your peer has a dynamic IP # #export REMOTE_FLOAT=1 @@ -147,8 +193,8 @@ echo "#!/bin/sh export REMOTE_ADDRESS=$REMOTEIP export REMOTE_PORT=$PEERPORT -export LOCAL_PORT=$ADDPORT -export PRIVATE_KEY=\"\$(cat seckey)\" +export LOCAL_PORT=2${PEERASN:0:5} +export PRIVATE_KEY=$SECKEY export PUBLIC_KEY=$PUBKEY export TUN_MODE=1 export INTERFACE=ppp-$PEERNAME @@ -173,23 +219,61 @@ export INTERFACE=ppp-$PEERNAME ping -c 1 -I \$INTERFACE $PEERIP -r -w 5 ) & exec /usr/sbin/quicktun.nacltai" > /services/"$PEERNAME"/run -chmod +x /services/"$PEERNAME"/run - -######################################################################### -# Configure and start our new peering session: -test -L "/service/$PEERNAME" && rm -r "/service/$PEERNAME" -ln -s "/services/$PEERNAME" /service/ -echo 'Secret Key Goes Here!' > "/services/$PEERNAME/seckey" -echo "peer2anonet: New peering session configured. -Please place your secret key in: /services/$PEERNAME/seckey - -Some additional options are available in /services/$PEERNAME/run -Please read the comments in the file for details. You may need to -restart the bird daemon. ie, svc -t /service/bird " - - - - + chmod +x /services/"$PEERNAME"/run + test -L "/service/$PEERNAME" || ln -s "/services/$PEERNAME" "/service/$PEERNAME" + svc -d "/service/$PEERNAME" && svc -u "/service/$PEERNAME" + done + test -L /service/bird || ln -s /services/bird /service/bird + echo configure | birdc + } + +CONFIGURE_PEER(){ + echo -e '\nCONFIGURE PEER:\n' + read -p " Enter your peer's name: " PEERNAME + 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" + } + +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" + echo + echo -e " removed /etc/peer2anonet/peers/$PEERNAME\n" + else + echo + echo -e " error: /etc/peer2anonet/peers/$PEERNAME not exists\n" + exit 1 + fi + } + + +if [ "$1" == '--configure' ]; then + CONFIGURE +elif [ "$1" == '--update' ]; then + UPDATE +elif [ "$1" == '--configure-peer' ]; then + CONFIGURE_PEER + UPDATE +elif [ "$1" == '--rm-peer' ]; then + RM_PEER + UPDATE +else + USAGE +fi -- 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') 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 db2c109f7b1f3ebae5fe703bf8d38b218541b3b6 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Fri, 25 Nov 2011 22:34:39 +0000 Subject: updated peer2anonet --- contrib/peer2anonet/peer2anonet | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 7e61543..fb8564f 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -6,10 +6,11 @@ fi USAGE(){ echo -e '\npeer2anonet:' - echo -e '\n --configure generate a new local configuration and exit' - echo -e '\n --update regenerate peer configurations' - echo -e '\n --configure-peer generate a new peer configuration and update' - echo -e '\n --rm-peer remove a peer configuration and update\n' + echo -e '\n --configure generate a new local configuration and exit' + echo -e '\n --update regenerate peer configurations' + echo -e '\n --configure-peer generate a new peer configuration and update' + echo -e '\n --rm-peer remove a peer configuration and update' + echo -e '\n --install-daemontools installs daemontools\n' exit 0 } @@ -264,6 +265,23 @@ RM_PEER(){ fi } +INSTALL_DAEMONTOOLS(){ + [[ $(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 + mkdir -p /package + chmod 1755 /package + cd /package + wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz + gunzip daemontools-0.76.tar + tar -xpf daemontools-0.76.tar + rm -f daemontools-0.76.tar + cd admin/daemontools-0.76 + sed -i 's/gcc/gcc -include errno.h/g' src/conf-cc + package/install + } + if [ "$1" == '--configure' ]; then CONFIGURE @@ -275,6 +293,8 @@ elif [ "$1" == '--configure-peer' ]; then elif [ "$1" == '--rm-peer' ]; then RM_PEER UPDATE +elif [ "$1" == '--rm-peer' ]; then + INSTALL_DAEMONTOOLS else USAGE 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') 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 d767f074c4182059b51c48995c6e4e3902228f4d Mon Sep 17 00:00:00 2001 From: d3v11 Date: Fri, 25 Nov 2011 23:21:28 +0000 Subject: updated my software to resdb --- contrib/peer2anonet/peer2anonet | 42 +++++++++++++++++++++++++-- contrib/splicex/CHANGES | 63 ----------------------------------------- contrib/splicex/DEBIAN/control | 2 +- contrib/splicex/LICENSE | 22 -------------- contrib/splicex/README | 10 ------- contrib/splicex/src/manual | 13 --------- contrib/splicex/src/splicex.pyx | 12 -------- contrib/tor2dns/README | 32 +++++++++++++++++++++ contrib/tor2dns/run | 13 +++++++++ contrib/tor2dns/serve | 9 ++++++ contrib/tor2dns/tor2dns/README | 32 --------------------- contrib/tor2dns/tor2dns/run | 13 --------- contrib/tor2dns/tor2dns/serve | 9 ------ 13 files changed, 94 insertions(+), 178 deletions(-) delete mode 100644 contrib/splicex/CHANGES delete mode 100644 contrib/splicex/LICENSE create mode 100644 contrib/tor2dns/README create mode 100755 contrib/tor2dns/run create mode 100755 contrib/tor2dns/serve delete mode 100644 contrib/tor2dns/tor2dns/README delete mode 100755 contrib/tor2dns/tor2dns/run delete mode 100755 contrib/tor2dns/tor2dns/serve (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index fb8564f..1893439 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -10,7 +10,9 @@ USAGE(){ echo -e '\n --update regenerate peer configurations' echo -e '\n --configure-peer generate a new peer configuration and update' echo -e '\n --rm-peer remove a peer configuration and update' - echo -e '\n --install-daemontools installs daemontools\n' + echo -e '\n --install-daemontools installs daemontools' + echo -e '\n --install-ucspi-tcp installs ucspi-tcp' + echo -e '\n --install-djbdns installs djbdns\n' exit 0 } @@ -282,6 +284,36 @@ INSTALL_DAEMONTOOLS(){ package/install } +INSTALL_UCSPI_TCP(){ + [[ $(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 + cd /usr/local/src + wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz + gunzip ucspi-tcp-0.88.tar + tar -xf ucspi-tcp-0.88.tar + cd ucspi-tcp-0.88 + sed -i 's/gcc/gcc -include errno.h/g' src/conf-cc + make + make setup check + } + +INSTALL_DJBDNS(){ + [[ $(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 + 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 + } + if [ "$1" == '--configure' ]; then CONFIGURE @@ -293,8 +325,12 @@ elif [ "$1" == '--configure-peer' ]; then elif [ "$1" == '--rm-peer' ]; then RM_PEER UPDATE -elif [ "$1" == '--rm-peer' ]; then - INSTALL_DAEMONTOOLS +elif [ "$1" == '--install-daemontools' ]; then + INSTALL_CORE +elif [ "$1" == '--install-ucspi-tcp' ]; then + INSTALL_UCSPI_TCP +elif [ "$1" == '--install-djbdns' ]; then + INSTALL_DJBDNS else USAGE fi diff --git a/contrib/splicex/CHANGES b/contrib/splicex/CHANGES deleted file mode 100644 index aefb866..0000000 --- a/contrib/splicex/CHANGES +++ /dev/null @@ -1,63 +0,0 @@ -CHANGES: - - d3v11 - Sat Oct 22 2011: - - SpliceX is the new replacement for Splice3. - it includes some new options and should be - compatible with most versions of Python. - - see README, splicex --help, splicex --rtfm - - d3v11 - Sun Oct 23 2011: - - Added some colour enhancements to SpliceX - :-). This is a useless update but i thought - it was fun. - - Also, I trimmed down much unnecessary - code. - - 'deshadow' bug fixed in splicex.py src - - d3v11 - Fri Oct 28 2011: - - SpliceX now compiles to machine language - via Cython. see README for dependencies - and installation details. - - SpliceX compiler flags patched. recent - update did not distinguish: - - /usr/include/ - - -FROM- - - /usr/local/include/ - - Thus, if you have debian python-dev or - source python-dev the ./configure script - should choose the appropriate option. - if the configure still failed to locate - the python development files (headers) - please let me know and I will correct. - - SpliceX can now optionally do a pure - python install. This cuts down on - dependencies and is useful if you just - want to test, try, and/or debug. - - SpliceX now detects invalid arguments - and prints with error message. - - d3v11 - Sat Oct 29 2011: - - Old timing bug is now fixed. --time now - how a consistant tracking of how many - passwords and how much time has elapsed - among each brute force algorithm. This - new patch also simplified the code and - makes the functions faster. Much code - has been trimmed from splicex without - removing any options or functionality. - - --no-char bug fixed diff --git a/contrib/splicex/DEBIAN/control b/contrib/splicex/DEBIAN/control index 4bc2760..8f97b98 100644 --- a/contrib/splicex/DEBIAN/control +++ b/contrib/splicex/DEBIAN/control @@ -7,6 +7,6 @@ Package: Splicex Architecture: all Depends: python2.6 (>= 2.6) Description: SpliceX - brute force utilities for the linux shell. + Brute Force Utilities For GNU/Linux. diff --git a/contrib/splicex/LICENSE b/contrib/splicex/LICENSE deleted file mode 100644 index 87f9e86..0000000 --- a/contrib/splicex/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - __________ _ _ __ __ ______ - / / / / ___| _ __ | (_) ___ ___\ \/ / / / / / - / / / /\___ \| '_ \| | |/ __/ _ \\ / / / / / - / / / / ___) | |_) | | | (_| __// \ / / / / - /_/_/_/ |____/| .__/|_|_|\___\___/_/\_\/_/_/_/ - |_| - - - - .:Brute Force Utilities For GNU/Linux:. - - - - SpliceX is free software: you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. - - SpliceX is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. diff --git a/contrib/splicex/README b/contrib/splicex/README index 8cbe4ee..69b78f5 100644 --- a/contrib/splicex/README +++ b/contrib/splicex/README @@ -7,16 +7,6 @@ .:Brute Force Utilities For GNU/Linux:. - SpliceX is free software: you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. - - SpliceX is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. http://www.gnu.org/licenses/ - AUTHOR: d3v11 diff --git a/contrib/splicex/src/manual b/contrib/splicex/src/manual index f11acc0..8453157 100644 --- a/contrib/splicex/src/manual +++ b/contrib/splicex/src/manual @@ -8,19 +8,6 @@ .:Brute Force Utilities For GNU/Linux:. - - SpliceX is free software: you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. - - SpliceX is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - - .SH OPTIONS diff --git a/contrib/splicex/src/splicex.pyx b/contrib/splicex/src/splicex.pyx index 206cee6..abf9057 100644 --- a/contrib/splicex/src/splicex.pyx +++ b/contrib/splicex/src/splicex.pyx @@ -22,18 +22,6 @@ def HELP(): print('') print('') print('') - print(' SpliceX is free software: you can redistribute it and/or modify it under ') - print(' the terms of the GNU General Public License as published by the Free ') - print(' Software Foundation, either version 3 of the License, or (at your option)') - print(' any later version. ') - print('') - print(' SpliceX is distributed in the hope that it will be useful, but WITHOUT ') - print(' ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ') - print(' FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ') - print(' for more details. ') - print('') - print('') - print('') print(Red + ' --help ' + DefColour + 'Show help display and exit') print('') print(Red + ' --command ' + DefColour + 'Parse passwords to this command') diff --git a/contrib/tor2dns/README b/contrib/tor2dns/README new file mode 100644 index 0000000..5194c76 --- /dev/null +++ b/contrib/tor2dns/README @@ -0,0 +1,32 @@ +DESCRIPTION: + tor2dns is a quick solution to non-free + and centralized dns. + +DEPENDS: + tor, daemontools, python + +INSTALL: + +mkdir /var/lib/tor/tor2dns +echo 'HiddenServiceDir /var/lib/tor/tor2dns' >> /etc/tor/torrc +echo 'HiddenServicePort 8053 127.0.0.1:8053' >> /etc/tor/torrc + +#See note below, you may need to use the commented line. +#chown debian-tor /var/lib/tor/tor2dns + +/etc/init.d/tor restart +mkdir /services/tor2dns +tar -xvf tor2dns.tgz --directory='/services' +cd / +ln -s /services/tor2dns /service +echo 'new dns link >>> http://'`cat /var/lib/tor/tor2dns/hostname`':8053' + +UPDATE: + +# pull a copy from AnoNet2 +wget http://d3v11.ano/tor2dns.tgz + +NOTE: + On some systems /var/lib/tor/tor2dns will need a special owner + like "debian-tor". If tor2dns fails for you please troubleshoot + your logs. diff --git a/contrib/tor2dns/run b/contrib/tor2dns/run new file mode 100755 index 0000000..1e543a9 --- /dev/null +++ b/contrib/tor2dns/run @@ -0,0 +1,13 @@ +#!/bin/bash +GETIP() { + while true; do + wget 'http://www.showmyip.com/simple/' -O index.html + sleep 5h + done + } + +[ -e SHARE ] || mkdir SHARE +cd SHARE +../serve & +GETIP + diff --git a/contrib/tor2dns/serve b/contrib/tor2dns/serve new file mode 100755 index 0000000..0274b74 --- /dev/null +++ b/contrib/tor2dns/serve @@ -0,0 +1,9 @@ +#!/usr/bin/python +import SimpleHTTPServer +import SocketServer + +PORT = 8053 + +Handler = SimpleHTTPServer.SimpleHTTPRequestHandler +httpd = SocketServer.TCPServer(("", PORT), Handler) +httpd.serve_forever() diff --git a/contrib/tor2dns/tor2dns/README b/contrib/tor2dns/tor2dns/README deleted file mode 100644 index 5194c76..0000000 --- a/contrib/tor2dns/tor2dns/README +++ /dev/null @@ -1,32 +0,0 @@ -DESCRIPTION: - tor2dns is a quick solution to non-free - and centralized dns. - -DEPENDS: - tor, daemontools, python - -INSTALL: - -mkdir /var/lib/tor/tor2dns -echo 'HiddenServiceDir /var/lib/tor/tor2dns' >> /etc/tor/torrc -echo 'HiddenServicePort 8053 127.0.0.1:8053' >> /etc/tor/torrc - -#See note below, you may need to use the commented line. -#chown debian-tor /var/lib/tor/tor2dns - -/etc/init.d/tor restart -mkdir /services/tor2dns -tar -xvf tor2dns.tgz --directory='/services' -cd / -ln -s /services/tor2dns /service -echo 'new dns link >>> http://'`cat /var/lib/tor/tor2dns/hostname`':8053' - -UPDATE: - -# pull a copy from AnoNet2 -wget http://d3v11.ano/tor2dns.tgz - -NOTE: - On some systems /var/lib/tor/tor2dns will need a special owner - like "debian-tor". If tor2dns fails for you please troubleshoot - your logs. diff --git a/contrib/tor2dns/tor2dns/run b/contrib/tor2dns/tor2dns/run deleted file mode 100755 index 1e543a9..0000000 --- a/contrib/tor2dns/tor2dns/run +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -GETIP() { - while true; do - wget 'http://www.showmyip.com/simple/' -O index.html - sleep 5h - done - } - -[ -e SHARE ] || mkdir SHARE -cd SHARE -../serve & -GETIP - diff --git a/contrib/tor2dns/tor2dns/serve b/contrib/tor2dns/tor2dns/serve deleted file mode 100755 index 0274b74..0000000 --- a/contrib/tor2dns/tor2dns/serve +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/python -import SimpleHTTPServer -import SocketServer - -PORT = 8053 - -Handler = SimpleHTTPServer.SimpleHTTPRequestHandler -httpd = SocketServer.TCPServer(("", PORT), Handler) -httpd.serve_forever() -- 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') 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') 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') 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 ceff4700285f7963b56ba9d87057d3befe175313 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sat, 26 Nov 2011 09:17:54 +0000 Subject: updated peer2anonet --- contrib/peer2anonet/peer2anonet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index a2a9906..0c9665f 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -400,7 +400,7 @@ elif [ "$1" == '--rm-peer' ]; then RM_PEER UPDATE elif [ "$1" == '--install-daemontools' ]; then - INSTALL_CORE + INSTALL_DAEMONTOOLS elif [ "$1" == '--install-ucspi-tcp' ]; then INSTALL_UCSPI_TCP elif [ "$1" == '--install-djbdns' ]; then -- cgit v1.2.3 From 24cc26d124dd44e9c3c1c842c5d14bbd04307f20 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sat, 26 Nov 2011 19:04:16 +0000 Subject: updated peer2anonet --- contrib/peer2anonet/peer2anonet | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 0c9665f..dd8a76a 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -369,10 +369,19 @@ CONFIGURE_DNS(){ 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 ) + echo ".$NICK.ano:$TINYDNS_IP:a:259200" > /service/tinydns/root/data + echo "=www.$NICK.ano:$GIT_IP:86400" >> /service/tinydns/root/data + echo "+git.$NICK.ano:$GIT_IP:86400" >> /service/tinydns/root/data + echo "+$NICK.ano:$GIT_IP:86400" >> /service/tinydns/root/data + echo "+a.anons.$NICK.ano:$TINYDNS_ANO_IP:3600" >> /service/tinydns/root/data + echo ".1.in-addr.arpa::a.anons.$NICK.ano" >> /service/tinydns/root/data + echo ".2.in-addr.arpa::a.anons.$NICK.ano" >> /service/tinydns/root/data + echo ".ano::a.anons.$NICK.ano" >> /service/tinydns/root/data + echo ".ntwrk::a.anons.$NICK.ano" >> /service/tinydns/root/data + #( 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 -- cgit v1.2.3 From 527a2e2ab7fa215d151e2ad2dd3d05d0729e3e9f Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sat, 26 Nov 2011 20:06:20 +0000 Subject: patched peer2anonet bootstrap bug --- contrib/peer2anonet/peer2anonet | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index dd8a76a..e704913 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -30,13 +30,6 @@ mkdir -p /services/bird mkdir -p /etc/peer2anonet mkdir -p /etc/peer2anonet/peers -if [ -e /etc/peer2anonet/p2a.conf ]; then - source /etc/peer2anonet/p2a.conf -else - echo "peer2anonet: needs --configure prior to usage" - exit 1 -fi - CONFIGURE(){ echo -e '\nCONFIGURE:\n' read -p " Enter your AnoNet subnet: " P2A_NET @@ -397,6 +390,13 @@ 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 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') 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 57bd3a12fe83f64460a733d3134bf1f8a2dbae2c Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 27 Nov 2011 01:23:46 +0000 Subject: peer2anonet ucspi-tcp conf-cc bug fix --- contrib/peer2anonet/peer2anonet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 6f5bbb2..4301081 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -329,7 +329,7 @@ INSTALL_UCSPI_TCP(){ gunzip ucspi-tcp-0.88.tar tar -xf ucspi-tcp-0.88.tar cd ucspi-tcp-0.88 - sed -i 's/gcc/gcc -include errno.h/g' src/conf-cc + sed -i 's/gcc/gcc -include errno.h/g' conf-cc make make setup check } -- cgit v1.2.3 From 7089f390e5ea7db717ccc19aa3f17f5c980b1486 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 27 Nov 2011 01:36:44 +0000 Subject: updated peer2anonet --- contrib/peer2anonet/peer2anonet | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 4301081..5be1501 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -391,15 +391,15 @@ CONFIGURE_DNS(){ tinydns-conf Gtinydns Gdnslog /services/tinydns $TINYDNS_IP ( cd / ; ln -s /services/tinydns /service/tinydns ) - echo ".$NICK.ano:$TINYDNS_IP:a:259200" > /service/tinydns/root/data - echo "=www.$NICK.ano:$GIT_IP:86400" >> /service/tinydns/root/data - echo "+git.$NICK.ano:$GIT_IP:86400" >> /service/tinydns/root/data - echo "+$NICK.ano:$GIT_IP:86400" >> /service/tinydns/root/data - echo "+a.anons.$NICK.ano:$TINYDNS_ANO_IP:3600" >> /service/tinydns/root/data - echo ".1.in-addr.arpa::a.anons.$NICK.ano" >> /service/tinydns/root/data - echo ".2.in-addr.arpa::a.anons.$NICK.ano" >> /service/tinydns/root/data - echo ".ano::a.anons.$NICK.ano" >> /service/tinydns/root/data - echo ".ntwrk::a.anons.$NICK.ano" >> /service/tinydns/root/data + 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 "+a.anons.$NICK.ano:$TINYDNS_ANO_IP:3600" >> /services/tinydns/root/data + echo ".1.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data + echo ".2.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data + echo ".ano::a.anons.$NICK.ano" >> /services/tinydns/root/data + echo ".ntwrk::a.anons.$NICK.ano" >> /services/tinydns/root/data #( 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 ) -- cgit v1.2.3 From 84c0679b186f301016ba38ee050e64f79d321e6e Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 27 Nov 2011 04:31:20 +0000 Subject: updated peer2anonet --- contrib/peer2anonet/peer2anonet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 5be1501..a4ae655 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -416,7 +416,7 @@ CONFIGURE_DNS(){ ./scripts/nameserver_autogen/tinydns_tld_datafile > /service/tinydns-ano/root/data ( cd /service/tinydns-ano/root ; make ) - ( cd /service ; svc -t dnscache tinydns* ) + ( cd /service ; sleep 5 ; svc -t dnscache tinydns tinydns-ano tinydns-root ) } -- cgit v1.2.3 From 8053cd43a5a09800af3c54a9779f7b3cf329edae Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 27 Nov 2011 05:24:07 +0000 Subject: updated peer2anonet... again --- contrib/peer2anonet/peer2anonet | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index a4ae655..d506f9a 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -1,4 +1,5 @@ #!/bin/bash +# if [[ $(id -u) != 0 ]]; then echo "peer2anonet: root privileges required." exit 1 -- cgit v1.2.3 From 6be939956eba532960b9a227281bfda091ef9eec Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 27 Nov 2011 05:47:00 +0000 Subject: reverted back to www.srw.ano/dns configuration for a.ns.$USER.ano on ./contrib/peer2anonet/peer2anonet --configure-dns. everything else seems to be working aside from --configure-dns. If you look in function CONFIGURE_DNS() you can see the code, if you find working solution let me know. i've had success on my system with the commented lines, but uncommented lines fail for tinydns/root/data. dunno, maybe, sometimes... if you fix it before i do let me know. d3v11@d3v11.ano /relayhell/d3v11 --- contrib/peer2anonet/peer2anonet | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index d506f9a..9a2eab2 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -392,19 +392,19 @@ CONFIGURE_DNS(){ tinydns-conf Gtinydns Gdnslog /services/tinydns $TINYDNS_IP ( cd / ; ln -s /services/tinydns /service/tinydns ) - 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 "+a.anons.$NICK.ano:$TINYDNS_ANO_IP:3600" >> /services/tinydns/root/data - echo ".1.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data - echo ".2.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data - echo ".ano::a.anons.$NICK.ano" >> /services/tinydns/root/data - echo ".ntwrk::a.anons.$NICK.ano" >> /services/tinydns/root/data - #( 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 ) + #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 "+a.anons.$NICK.ano:$TINYDNS_ANO_IP:3600" >> /services/tinydns/root/data + #echo ".1.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data + #echo ".2.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data + #echo ".ano::a.anons.$NICK.ano" >> /services/tinydns/root/data + #echo ".ntwrk::a.anons.$NICK.ano" >> /services/tinydns/root/data + ( 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 -- cgit v1.2.3 From 4c6208f1bcdec52da40edeff6d1ef52d15d48dbf Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 27 Nov 2011 07:25:09 +0000 Subject: update test for --configure-dns --- contrib/peer2anonet/peer2anonet | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 9a2eab2..015b5e8 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -391,21 +391,21 @@ CONFIGURE_DNS(){ ( cd / ; ln -s /services/dnscache /service/dnscache ) 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 "+a.anons.$NICK.ano:$TINYDNS_ANO_IP:3600" >> /services/tinydns/root/data + echo ".1.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data + echo ".2.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data + echo ".ano::a.anons.$NICK.ano" >> /services/tinydns/root/data + echo ".ntwrk::a.anons.$NICK.ano" >> /services/tinydns/root/data + #( cd /services/tinydns/root ; ./add-ns $TINYDNS_DOMAIN $TINYDNS_IP ) + #( cd /services/tinydns/root ; ./add-alias $GIT_DOMAIN $GIT_IP ) + #( cd /services/tinydns/root ; ./add-alias $TINYDNS_ANO_IP $TINYDNS_ROOT_IP ) + #( cd /services/tinydns/root ; ./add-alias $TINYDNS_ANO_DOMAIN $TINYDNS_ANO_IP ) + #( cd /services/tinydns/root ; make ) ( cd / ; ln -s /services/tinydns /service/tinydns ) - #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 "+a.anons.$NICK.ano:$TINYDNS_ANO_IP:3600" >> /services/tinydns/root/data - #echo ".1.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data - #echo ".2.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data - #echo ".ano::a.anons.$NICK.ano" >> /services/tinydns/root/data - #echo ".ntwrk::a.anons.$NICK.ano" >> /services/tinydns/root/data - ( 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 ) -- cgit v1.2.3 From b3db408bcfe9543ae527ad32b6e84f34a4940ac3 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Mon, 28 Nov 2011 08:45:47 +0000 Subject: update for peer2anonet --- contrib/peer2anonet/peer2anonet | 61 +++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 18 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 015b5e8..51d24d7 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -1,12 +1,12 @@ #!/bin/bash -# if [[ $(id -u) != 0 ]]; then echo "peer2anonet: root privileges required." exit 1 fi if [ -e /services/bird ]; then - [ -e /etc/peer2anonet/bird.tar ] || ( cd /services ; tar cf /etc/peer2anonet/bird.tar bird ) + [ -e /etc/peer2anonet/bird.tar ] || ( cd /services ; echo "peer2anonet: backing up /services/bird to /etc/peer2anonet/bird.tar" ;\ + tar cf /etc/peer2anonet/bird.tar bird ) fi [ -e contrib/peer2anonet/peer2anonet ] || echo "peer2anonet: not in \$RESDB_ROOT" @@ -243,6 +243,7 @@ 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 -t "/service/$PEER" done test -L /service/bird || ln -s /services/bird /service/bird echo configure | birdc @@ -341,6 +342,8 @@ INSTALL_DJBDNS(){ [[ $(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 tcpserver`) == X ]] && echo ' error: cannot find tcpserver' + [[ $(echo X`which tcpserver`) == X ]] && exit 1 cd /usr/local/src wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz gunzip djbdns-1.05.tar @@ -359,14 +362,35 @@ CONFIGURE_DNS(){ exit 0 fi + if [ -e /services/dnscache ]; then + [ -e /etc/peer2anonet/dnscache.tar ] || ( cd /services ; echo "creating /etc/peer2anonet/dnscache.tar backup" ;\ + tar cf /etc/peer2anonet/dnscache.tar dnscache ) + fi + if [ -e /services/tinydns ]; then + [ -e /etc/peer2anonet/tinydns.tar ] || ( cd /services ; echo "creating /etc/peer2anonet/tinydns.tar backup" ;\ + tar cf /etc/peer2anonet/tinydns.tar tinydns ) + fi + if [ -e /services/tinydns-ano ]; then + [ -e /etc/peer2anonet/tinydns-ano.tar ] || ( cd /services ; echo "creating /etc/peer2anonet/tinydns-ano.tar backup" ;\ + tar cf /etc/peer2anonet/tinydns-ano.tar tinydns-ano ) + fi + if [ -e /services/tinydns-root ]; then + [ -e /etc/peer2anonet/tinydns-root.tar ] || ( cd /services ; echo "creating /etc/peer2anonet/tinydns-root.tar backup" ;\ + 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) + 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" + TINYDNS_IP=`cat db/dom/ano/$NICK/ns/$(ls db/dom/ano/$NICK/ns)` + TINYDNS_DOMAIN=`ls db/dom/ano/$NICK/ns` GIT_IP=`cat conf/gitd_ip` GIT_DOMAIN="git.$NICK.ano" @@ -388,35 +412,36 @@ CONFIGURE_DNS(){ 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 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 "+a.anons.$NICK.ano:$TINYDNS_ANO_IP:3600" >> /services/tinydns/root/data - echo ".1.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data - echo ".2.in-addr.arpa::a.anons.$NICK.ano" >> /services/tinydns/root/data - echo ".ano::a.anons.$NICK.ano" >> /services/tinydns/root/data - echo ".ntwrk::a.anons.$NICK.ano" >> /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 $TINYDNS_DOMAIN $TINYDNS_IP ) #( cd /services/tinydns/root ; ./add-alias $GIT_DOMAIN $GIT_IP ) #( cd /services/tinydns/root ; ./add-alias $TINYDNS_ANO_IP $TINYDNS_ROOT_IP ) #( cd /services/tinydns/root ; ./add-alias $TINYDNS_ANO_DOMAIN $TINYDNS_ANO_IP ) - #( cd /services/tinydns/root ; make ) - ( cd / ; ln -s /services/tinydns /service/tinydns ) + ( cd /services/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 ) + ./scripts/nameserver_autogen/tinydns_root_datafile > /services/tinydns-root/root/data + ( cd /services/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 ) + ./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 ) } -- cgit v1.2.3 From b415dff970c2cf4b409aa57847512b8bbb31d8e3 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Mon, 28 Nov 2011 08:56:10 +0000 Subject: updated peer2anonet --- contrib/peer2anonet/peer2anonet | 53 +++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 23 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 51d24d7..7525b01 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -5,7 +5,7 @@ if [[ $(id -u) != 0 ]]; then fi if [ -e /services/bird ]; then - [ -e /etc/peer2anonet/bird.tar ] || ( cd /services ; echo "peer2anonet: backing up /services/bird to /etc/peer2anonet/bird.tar" ;\ + [ -e /etc/peer2anonet/bird.tar ] || ( cd /services ; echo "creating /etc/peer2anonet/bird.tar backup" ;\ tar cf /etc/peer2anonet/bird.tar bird ) fi @@ -64,66 +64,66 @@ UPDATE(){ for PEER in `ls /etc/peer2anonet/peers`; do if [ -e /etc/peer2anonet/peers/"$PEER"/remote_ip ]; then if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/remote_ip`) == 'X' ]]; then - echo " error: /etc/peer2anonet/peers/$PEER/remote_ip is void" + echo " fatal error: /etc/peer2anonet/peers/$PEER/remote_ip is void" exit 1 fi else - echo " error: /etc/peer2anonet/peers/$PEER/remote_ip not exists" + echo " fatal error: /etc/peer2anonet/peers/$PEER/remote_ip not exists" exit 1 fi if [ -e /etc/peer2anonet/peers/"$PEER"/peering_ip ]; then if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/peering_ip`) == 'X' ]]; then - echo " error: /etc/peer2anonet/peers/$PEER/peering_ip is void" + echo " fatal error: /etc/peer2anonet/peers/$PEER/peering_ip is void" exit 1 fi else - echo " error: /etc/peer2anonet/peers/$PEER/peering_ip not exists" + echo " fatal error: /etc/peer2anonet/peers/$PEER/peering_ip not exists" exit 1 fi if [ -e /etc/peer2anonet/peers/"$PEER"/port ]; then if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/port`) == 'X' ]]; then - echo " error: /etc/peer2anonet/peers/$PEER/port is void" + echo " fatal error: /etc/peer2anonet/peers/$PEER/port is void" exit 1 fi else - echo " error: /etc/peer2anonet/peers/$PEER/port not exists" + echo " fatal error: /etc/peer2anonet/peers/$PEER/port not exists" exit 1 fi if [ -e /etc/peer2anonet/peers/"$PEER"/asn ]; then if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/asn`) == 'X' ]]; then - echo " error: /etc/peer2anonet/peers/$PEER/asn is void" + echo " fatal error: /etc/peer2anonet/peers/$PEER/asn is void" exit 1 fi else - echo " error: /etc/peer2anonet/peers/$PEER/asn not exists" + echo " fatal error: /etc/peer2anonet/peers/$PEER/asn not exists" exit 1 fi if [ -e /etc/peer2anonet/peers/"$PEER"/pubkey ]; then if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/pubkey`) == 'X' ]]; then - echo " error: /etc/peer2anonet/peers/$PEER/pubkey is void" + echo " fatal error: /etc/peer2anonet/peers/$PEER/pubkey is void" exit 1 fi else - echo " error: /etc/peer2anonet/peers/$PEER/pubkey not exists" + echo " fatal error: /etc/peer2anonet/peers/$PEER/pubkey not exists" exit 1 fi if [ -e /etc/peer2anonet/peers/"$PEER"/seckey ]; then if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/seckey`) == 'X' ]]; then - echo " error: /etc/peer2anonet/peers/$PEER/seckey is void" + echo " fatal error: /etc/peer2anonet/peers/$PEER/seckey is void" exit 1 fi else - echo " error: /etc/peer2anonet/peers/$PEER/seckey not exists" + echo " fatal error: /etc/peer2anonet/peers/$PEER/seckey not exists" exit 1 fi done else - echo " error: peering configurations not exists" + echo " fatal error: peering configurations not exists" exit 1 fi @@ -292,18 +292,18 @@ RM_PEER(){ echo -e " removed /etc/peer2anonet/peers/$PEER\n" else echo - echo -e " error: /etc/peer2anonet/peers/$PEER not exists\n" + echo -e " fatal error: /etc/peer2anonet/peers/$PEER not exists\n" exit 1 fi } INSTALL_DAEMONTOOLS(){ echo -e '\nINSTALL DAEMONTOOLS:\n' - [[ $(echo X`which gcc`) == X ]] && echo ' error: cannot find gcc' + [[ $(echo X`which gcc`) == X ]] && echo ' fatal 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 ]] && echo ' fatal 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 ]] && echo ' fatal error: cannot find csh' [[ $(echo X`which csh`) == X ]] && exit 1 mkdir -p /package chmod 1755 /package @@ -322,9 +322,9 @@ INSTALL_DAEMONTOOLS(){ INSTALL_UCSPI_TCP(){ echo -e '\nINSTALL UCSPI-TCP:\n' - [[ $(echo X`which gcc`) == X ]] && echo ' error: cannot find gcc' + [[ $(echo X`which gcc`) == X ]] && echo ' fatal 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 ]] && echo ' fatal error: cannot find make' [[ $(echo X`which make`) == X ]] && exit 1 cd /usr/local/src wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz @@ -338,12 +338,14 @@ 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 ]] && echo ' fatal 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 ]] && echo ' fatal error: cannot find make' [[ $(echo X`which make`) == X ]] && exit 1 - [[ $(echo X`which tcpserver`) == X ]] && echo ' error: cannot find tcpserver' + [[ $(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 @@ -362,6 +364,11 @@ CONFIGURE_DNS(){ 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/dnscache ]; then [ -e /etc/peer2anonet/dnscache.tar ] || ( cd /services ; echo "creating /etc/peer2anonet/dnscache.tar backup" ;\ tar cf /etc/peer2anonet/dnscache.tar dnscache ) -- cgit v1.2.3 From 7965217d61e03d84a51f8ae284c6a9fbe655134c Mon Sep 17 00:00:00 2001 From: d3v11 Date: Mon, 28 Nov 2011 19:49:16 +0000 Subject: updates to peer2anonet --- contrib/peer2anonet/peer2anonet | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 7525b01..7fdc78e 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -401,15 +401,23 @@ CONFIGURE_DNS(){ 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 + ip addr add $TINYDNS_ROOT_IP/32 dev lo > /dev/null 2>&1 + ip addr add $TINYDNS_IP/32 dev lo > /dev/null 2>&1 + ip addr add $TINYDNS_ANO_IP/32 dev lo > /dev/null 2>&1 + ip addr add $GIT_IP/32 dev lo > /dev/null 2>&1 + + if [[ $(cat /etc/rc.local) != *"ip addr add $TINYDNS_ROOT_IP/32 dev lo &"* ]]; then + echo "ip addr add $TINYDNS_ROOT_IP/32 dev lo &" >> /etc/rc.local + fi + if [[ $(cat /etc/rc.local) != *"ip addr add $TINYDNS_IP/32 dev lo &"* ]]; then + echo "ip addr add $TINYDNS_IP/32 dev lo &" >> /etc/rc.local + fi + if [[ $(cat /etc/rc.local) != *"ip addr add $TINYDNS_ANO_IP/32 dev lo &"* ]]; then + echo "ip addr add $TINYDNS_ANO_IP/32 dev lo &" >> /etc/rc.local + fi + if [[ $(cat /etc/rc.local) != *"ip addr add $GIT_IP/32 dev lo &"* ]]; then + echo "ip addr add $GIT_IP/32 dev lo &" >> /etc/rc.local + fi useradd Gdnscache useradd Gdnslog -- cgit v1.2.3 From 803c9b7614373632ee0ac4f219717e4ddc9fedf2 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 29 Nov 2011 04:13:54 +0000 Subject: bugfixes --- contrib/peer2anonet/peer2anonet | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 7fdc78e..d6214cb 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -430,20 +430,28 @@ 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 + #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 $TINYDNS_DOMAIN $TINYDNS_IP ) #( cd /services/tinydns/root ; ./add-alias $GIT_DOMAIN $GIT_IP ) #( cd /services/tinydns/root ; ./add-alias $TINYDNS_ANO_IP $TINYDNS_ROOT_IP ) #( cd /services/tinydns/root ; ./add-alias $TINYDNS_ANO_DOMAIN $TINYDNS_ANO_IP ) - ( cd /services/tinydns/root ; make ) + #( cd /services/tinydns/root ; 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 ./scripts/nameserver_autogen/tinydns_root_datafile > /services/tinydns-root/root/data -- cgit v1.2.3 From 9cbe7933d2a9124e21308fddb587d3ab2f4a7e7b Mon Sep 17 00:00:00 2001 From: d3v11 Date: Tue, 29 Nov 2011 05:23:06 +0000 Subject: updated peer2anonet --- contrib/peer2anonet/peer2anonet | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index d6214cb..10a14ff 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -396,8 +396,8 @@ CONFIGURE_DNS(){ 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/$(ls db/dom/ano/$NICK/ns)` - TINYDNS_DOMAIN=`ls db/dom/ano/$NICK/ns` + TINYDNS_IP=`cat conf/tinydns__srvrip` + TINYDNS_DOMAIN=`cat conf/tinydns__srvrname` GIT_IP=`cat conf/gitd_ip` GIT_DOMAIN="git.$NICK.ano" @@ -439,11 +439,6 @@ CONFIGURE_DNS(){ #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 $TINYDNS_DOMAIN $TINYDNS_IP ) - #( cd /services/tinydns/root ; ./add-alias $GIT_DOMAIN $GIT_IP ) - #( cd /services/tinydns/root ; ./add-alias $TINYDNS_ANO_IP $TINYDNS_ROOT_IP ) - #( cd /services/tinydns/root ; ./add-alias $TINYDNS_ANO_DOMAIN $TINYDNS_ANO_IP ) - #( cd /services/tinydns/root ; make ) ( cd /services/tinydns/root ./add-ns $NICK.ano $TINYDNS_IP -- cgit v1.2.3 From 8333b7173e409bc7a3c208bd1541c2ce202315f9 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Tue, 29 Nov 2011 07:20:10 +0000 Subject: peer2anonet now asks for the local port --- contrib/peer2anonet/peer2anonet | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 10a14ff..4e6aad3 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -82,13 +82,23 @@ UPDATE(){ exit 1 fi - if [ -e /etc/peer2anonet/peers/"$PEER"/port ]; then - if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/port`) == 'X' ]]; then - echo " fatal error: /etc/peer2anonet/peers/$PEER/port is void" + if [ -e /etc/peer2anonet/peers/"$PEER"/remote_port ]; then + if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/remote_port`) == 'X' ]]; then + echo " fatal error: /etc/peer2anonet/peers/$PEER/remote_port is void" exit 1 fi else - echo " fatal error: /etc/peer2anonet/peers/$PEER/port not exists" + echo " fatal error: /etc/peer2anonet/peers/$PEER/remote_port not exists" + exit 1 + fi + + if [ -e /etc/peer2anonet/peers/"$PEER"/local_port ]; then + if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/local_port`) == 'X' ]]; then + echo " fatal error: /etc/peer2anonet/peers/$PEER/local_port is void" + exit 1 + fi + else + echo " fatal error: /etc/peer2anonet/peers/$PEER/local_port not exists" exit 1 fi @@ -184,7 +194,8 @@ protocol direct direct_AnoNet_routes { table AnoNet_routes; mkdir -p /services/"$PEER" REMOTEIP=`cat /etc/peer2anonet/peers/"$PEER"/remote_ip` PEERIP=`cat /etc/peer2anonet/peers/"$PEER"/peering_ip` - PEERPORT=`cat /etc/peer2anonet/peers/"$PEER"/port` + PEERPORT=`cat /etc/peer2anonet/peers/"$PEER"/remote_port` + LOCALPORT=`cat /etc/peer2anonet/peers/"$PEER"/local_port` PEERASN=`cat /etc/peer2anonet/peers/"$PEER"/asn` PUBKEY=`cat /etc/peer2anonet/peers/"$PEER"/pubkey` SECKEY=`cat /etc/peer2anonet/peers/"$PEER"/seckey` @@ -213,7 +224,7 @@ protocol bgp $PEER { table AnoNet_routes; export REMOTE_ADDRESS=$REMOTEIP export REMOTE_PORT=$PEERPORT -export LOCAL_PORT=20${PEERASN:0:4} +export LOCAL_PORT=$LOCALPORT export PRIVATE_KEY=$SECKEY export PUBLIC_KEY=$PUBKEY export TUN_MODE=1 @@ -262,6 +273,7 @@ CONFIGURE_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 local port: " LOCALPORT read -p " Enter your peer's asn: " PEERASN read -p " Enter your peer's public key: " PUBKEY read -p " Enter your private key: " SECKEY @@ -270,6 +282,7 @@ CONFIGURE_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 $LOCALPORT >/etc/peer2anonet/peers/"$PEER"/local_port echo $PEERASN >/etc/peer2anonet/peers/"$PEER"/asn echo $PUBKEY >/etc/peer2anonet/peers/"$PEER"/pubkey echo $SECKEY >/etc/peer2anonet/peers/"$PEER"/seckey -- 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') 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 From b84466c4696da563bda7d4c3a9df0153b8f6ce62 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Tue, 29 Nov 2011 09:33:20 +0000 Subject: updated readme for peer2anonet --- contrib/peer2anonet/README.html | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/README.html b/contrib/peer2anonet/README.html index b536411..c0c6f3a 100644 --- a/contrib/peer2anonet/README.html +++ b/contrib/peer2anonet/README.html @@ -26,23 +26,25 @@ USAGE: - ./contrib/peer2anonet/peer2anonet --configure generate a new local configuration and exit + From $RESDB_ROOT do: - ./contrib/peer2anonet/peer2anonet --update regenerate peer configurations + ./contrib/peer2anonet/peer2anonet --configure generate a new local configuration and exit - ./contrib/peer2anonet/peer2anonet --configure-peer generate a new peer configuration and update + ./contrib/peer2anonet/peer2anonet --update regenerate peer configurations - ./contrib/peer2anonet/peer2anonet --rm-peer remove a peer configuration and update + ./contrib/peer2anonet/peer2anonet --configure-peer generate a new peer configuration and update - ./contrib/peer2anonet/peer2anonet --install-daemontools installs daemontools + ./contrib/peer2anonet/peer2anonet --rm-peer remove a peer configuration and update - ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp installs ucspi-tcp + ./contrib/peer2anonet/peer2anonet --install-daemontools installs daemontools - ./contrib/peer2anonet/peer2anonet --install-djbdns installs djbdns + ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp installs ucspi-tcp - ./contrib/peer2anonet/peer2anonet --configure-dns configures dnscache and tinydns zones + ./contrib/peer2anonet/peer2anonet --install-djbdns installs djbdns - ./contrib/peer2anonet/peer2anonet --update-dns updates tinydns-ano zone + ./contrib/peer2anonet/peer2anonet --configure-dns configures dnscache and tinydns zones + + ./contrib/peer2anonet/peer2anonet --update-dns updates tinydns-ano zone RTFM: -- cgit v1.2.3 From 68fe68277bcfef8c6b693d62443d2f3cd75e1bf1 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Tue, 29 Nov 2011 09:49:46 +0000 Subject: bugfix for peer2anonet --configure-peer --- contrib/peer2anonet/peer2anonet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index bfa671b..152f4a4 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -282,7 +282,7 @@ CONFIGURE_PEER(){ 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 $PEERPORT >/etc/peer2anonet/peers/"$PEER"/remote_port echo $LOCALPORT >/etc/peer2anonet/peers/"$PEER"/local_port echo $PEERASN >/etc/peer2anonet/peers/"$PEER"/asn echo $PUBKEY >/etc/peer2anonet/peers/"$PEER"/pubkey -- cgit v1.2.3 From 0f06728a072580506cdaf255e4d1ca69bdabc71d Mon Sep 17 00:00:00 2001 From: d3v11 Date: Tue, 29 Nov 2011 10:08:33 +0000 Subject: updated peer2anonet readme --- contrib/peer2anonet/README.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/README.html b/contrib/peer2anonet/README.html index c0c6f3a..6866354 100644 --- a/contrib/peer2anonet/README.html +++ b/contrib/peer2anonet/README.html @@ -57,10 +57,10 @@ 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 + Enter your AnoNet subnet: 1.1.5.0 + Enter your AnoNet router: 1.1.5.1 + Enter your peering ip: 1.1.5.2 + Enter your AnoNet asn: 1150 CONFIGURE PEER: -- cgit v1.2.3