# HG changeset patch # User Nick # Date 1326746654 0 # Node ID 9b9bfc7c8dc57228479b5b57503c56c3cb38802c # Parent 944bbc3f0727031e00ccb8d9aa1f73e9d8b1deaa# Parent 4cf1f2c3e40f77c107681bceae72e8f2d5bdf7e9 Merge commit '0f221e9b06d668695c6ec75e6f722398eab68d8f' diff -r 944bbc3f0727 -r 9b9bfc7c8dc5 contrib/peer2anonet/README.html --- a/contrib/peer2anonet/README.html Sat Jan 14 00:25:06 2012 +0000 +++ b/contrib/peer2anonet/README.html Mon Jan 16 20:44:14 2012 +0000 @@ -2,135 +2,125 @@
 DESCRIPTION:
 
-    peer2anonet is an autoconfiguration utility for setting
-    up core services on AnoNet2. Enjoy :-).
+    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.
+    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:
+REPORT BULLSHIT TO:
         
-            /relayhell/d3v11
+    /relayhell/d3v11
 
-        EMAIL:
-        
-            d3v11@d3v11.ano
+    d3v11@d3v11.ano
 
 USAGE:
 
-    From $RESDB_ROOT do:
+    ./contrib/peer2anonet/peer2anonet --help
+    ./contrib/peer2anonet/peer2anonet --rtfm
 
-        ./contrib/peer2anonet/peer2anonet --configure             generate a new local configuration and exit
-
-        ./contrib/peer2anonet/peer2anonet --update                regenerate peer configurations
+TORIFY:
 
-        ./contrib/peer2anonet/peer2anonet --configure-peer        generate a new peer configuration and update
+    --install-* flags should be compatible with Tor:
 
-        ./contrib/peer2anonet/peer2anonet --rm-peer               remove a peer configuration and update
-
-        ./contrib/peer2anonet/peer2anonet --install-daemontools   installs daemontools
+    export http_proxy='http://127.0.0.1:8118/'
+    ./contrib/peer2anonet/peer2anonet --install-*
 
-        ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp     installs ucspi-tcp
+    torify ./contrib/peer2anonet/peer2anonet --install-*
 
-        ./contrib/peer2anonet/peer2anonet --install-djbdns        installs djbdns
+    usewithtor ./contrib/peer2anonet/peer2anonet --install-*
 
-        ./contrib/peer2anonet/peer2anonet --configure-dns         configures dnscache and tinydns zones
+CONFIGURE:
 
-        ./contrib/peer2anonet/peer2anonet --update-dns            updates tinydns-ano zone
+    I highly recommend that before you use peer2anonet
+    you ./configure resdb with tinydns support.
 
-RTFM:
+    ./contrib/peer2anonet/peer2anonet --configure
 
-    CONFIGURE:
+    EXAMPLES:
 
-        I highly recommend that before you use peer2anonet
-        you ./configure resdb with tinydns support.
-
-        ./contrib/peer2anonet/peer2anonet --configure
+        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
 
-        EXAMPLES:
+CONFIGURE PEER:
 
-            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
+    ./contrib/peer2anonet/peer2anonet --configure-peer
+
+    KEY PAIRS:
 
-    CONFIGURE PEER:
+        before running peer2anonet to configure peers
+        you can use quicktun to generate keypairs:
 
-        ./contrib/peer2anonet/peer2anonet --configure-peer
+        quicktun.keypair < /dev/random
 
-            KEY PAIRS:
+    EXAMPLES:
 
-                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 *
 
-                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 *
+    /SERVICE/$PEER/RUN CHANGES:
 
-            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:
 
-                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:
+        If /etc/peer2anonet/bird.conf exists, then
+        peer2anonet will not create a new bird. Instead
+        it will use this bird.conf and append new protocols
+        to it. 
 
-                If /etc/peer2anonet/bird.conf exists, then peer2anonet
-                will not create a new bird. Instead it will use this
-                bird.conf and append new protocols to it. 
-
-                /etc/peer2anonet/peers/$PEER/* contains:
+        /etc/peer2anonet/peers/$PEER/* contains:
                 
-                    asn  local_port  peering_ip  pubkey  remote_ip  remote_port  run  seckey
+        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:
+        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.
 
-        If you did not ./configure resdb with tinydns support
-        then you need to do that before using this function.
+CONFIGURE DNS:
 
-        also before using you will need to have installed
-        daemontools, djbdns, and ucspi-tcp. peer2anonet
-        can do this for you with --install-* options.
+    If you did not ./configure resdb with tinydns support
+    then you need to do that before using this function.
 
-        ./contrib/peer2anonet/peer2anonet --configure-dns
+    also before using you will need to have installed
+    daemontools, djbdns, and ucspi-tcp. peer2anonet
+    can do this for you with --install-* options.
 
-        UPDATE DNS:
+    ./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:
+    After a successful `--configure-dns', you can now
+    enjoy to use `--update-dns' to bring your AnoNet
+    domains up to speed.
 
-        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.
+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 -r 944bbc3f0727 -r 9b9bfc7c8dc5 contrib/peer2anonet/peer2anonet --- a/contrib/peer2anonet/peer2anonet Sat Jan 14 00:25:06 2012 +0000 +++ b/contrib/peer2anonet/peer2anonet Mon Jan 16 20:44:14 2012 +0000 @@ -12,6 +12,9 @@ [ -e contrib/peer2anonet/peer2anonet ] || echo "peer2anonet: not in \$RESDB_ROOT" [ -e contrib/peer2anonet/peer2anonet ] || exit 1 +[ -w /etc/rc.local ] && chmod +x /etc/rc.local +[ -w /etc/rc.d/rc.local ] && chmod +x /etc/rc.d/rc.local + USAGE(){ echo -e '\npeer2anonet:' echo -e '\n ./contrib/peer2anonet/peer2anonet --configure generate a new local configuration and exit' @@ -263,7 +266,8 @@ fi chmod +x /services/"$PEER"/run test -L "/service/$PEER" || ln -s "/services/$PEER" "/service/$PEER" - svc -t "/service/$PEER" + sleep 1 + svc -d "/service/$PEER" ; svc -u "/service/$PEER" done test -L /service/bird || ln -s /services/bird /service/bird echo configure | birdc @@ -327,6 +331,16 @@ [[ $(echo X`which make`) == X ]] && exit 1 [[ $(echo X`which csh`) == X ]] && echo ' fatal error: cannot find csh' [[ $(echo X`which csh`) == X ]] && exit 1 + + if [ -w /etc/inittab ]; then : + elif [ -w /etc/rc.local ] && ! [ -w /etc/inittab ]; then + sed -i "s/exit 0/csh -cf \'\/command\/svscanboot \&\'/" /etc/rc.local + chmod +x /etc/rc.local + else + echo ' fatal error: cannot create reliable startup' + exit 1 + fi + mkdir -p /package chmod 1755 /package cd /package @@ -337,9 +351,6 @@ 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(){ @@ -427,24 +438,44 @@ GIT_IP=`cat conf/gitd_ip` || exit 1 GIT_DOMAIN="git.$NICK.ano" + ./scripts/add_dom $NICK.ano $NICK $TINYDNS_DOMAIN/$TINYDNS_IP > /dev/null 2>&1 + + if [ -w /etc/rc.local ]; then + 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 + elif [ -w /etc/rc.d/rc.local ]; then + if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $TINYDNS_ROOT_IP/32 dev lo &"* ]]; then + echo "ip addr add $TINYDNS_ROOT_IP/32 dev lo &" >> /etc/rc.d/rc.local + fi + if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $TINYDNS_IP/32 dev lo &"* ]]; then + echo "ip addr add $TINYDNS_IP/32 dev lo &" >> /etc/rc.d/rc.local + fi + if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $TINYDNS_ANO_IP/32 dev lo &"* ]]; then + echo "ip addr add $TINYDNS_ANO_IP/32 dev lo &" >> /etc/rc.d/rc.local + fi + if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $GIT_IP/32 dev lo &"* ]]; then + echo "ip addr add $GIT_IP/32 dev lo &" >> /etc/rc.d/rc.local + fi + else + echo " fatal error: cannot reliably assign ip's to startup" + exit 1 + fi + 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 useradd Gtinydns