From 3ebc296682446a98a430e359c9b2b67189c298ec Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 29 Jan 2012 00:37:55 +0000 Subject: added ./contrib/peer2anonet/peer2anonet --setup-qmail :-) --- contrib/peer2anonet/peer2anonet | 121 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 657557a..8a06432 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -25,6 +25,7 @@ USAGE(){ 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 --install-nacl installs nacl' + echo -e '\n ./contrib/peer2anonet/peer2anonet --setup-qmail installs and configures qmail' 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 @@ -370,6 +371,124 @@ INSTALL_UCSPI_TCP(){ make setup check } +SETUP_QMAIL(){ + echo -e '\nSETUP QMAIL:\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 + + NICK=`cat conf/git_name` || exit 1 + MX_IP=`cat conf/gitd_ip` || exit 1 + MX_DOMAIN="a.mx.$NICK.ano" || exit 1 + + echo "@$NICK.ano:$MX_IP:a:12801:86400">>/services/tinydns/root/data || + echo ' fatal error: needs ./contrib/peer2anonet/peer2nonet --install-daemontools' && + exit 1 + + if [ -e /services/tinydns ]; then + ( + cd /services + echo "creating /etc/peer2anonet/tinydns.tar backup" + tar cf /etc/peer2anonet/tinydns.tar tinydns + ) + fi + + ( + cd /services/tinydns/root + make + cd /service + sleep 5 + svc -t dnscache tinydns tinydns-ano tinydns-root + ) + + useradd qmaillog || exit 1 + + if [ -w /etc/rc.local ]; then + if [[ $(cat /etc/rc.local) != *"ip addr add $MX_IP/32 dev lo &"* ]]; then + echo "ip addr add $MX_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 $MX_IP/32 dev lo &"* ]]; then + echo "ip addr add $MX_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 $MX_IP/32 dev lo > /dev/null 2>&1 + + if [ -e '/var/qmail/bin/qmail-qmtpd' ] || ! [ -e '/var/qmail/bin/qmail-smtpd' ]; then + cd /usr/local/src + wget http://www.srn.ano/software/qmail-1.03.tar.gz + tar xzf qmail-1.03.tgz + cd qmail-1.03 + wget -O- http://www.srn.ano/patches/qmail-1.03-qmtpc.patch | patch -p1 + mkdir /var/qmail + groupadd nofiles + useradd -g nofiles -d /var/qmail/alias alias + useradd -g nofiles -d /var/qmail qmaild + useradd -g nofiles -d /var/qmail qmaill + useradd -g nofiles -d /var/qmail qmailp + groupadd qmail + useradd -g qmail -d /var/qmail qmailq + useradd -g qmail -d /var/qmail qmailr + useradd -g qmail -d /var/qmail qmails + sed -i 's/gcc/gcc -include errno.h/g' conf-cc + make setup check + ./config-fast $MX_DOMAIN + echo yourdomain.ano >>/var/qmail/control/locals + echo yourdomain.ano >>/var/qmail/control/rcpthosts + (cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root) + chmod 644 ~alias/.qmail* + fi + + mkdir -p /services/qmail + mkdir -p /services/qmail/log + mkdir -p /services/qmail/log/main + chown qmaillog /services/qmail/log/main + echo -e '#!/bin/sh\nexec env - PATH="/var/qmail/bin:/usr/local/bin:/usr/bin:/bin" qmail-start ./Mailbox' >/services/qmail/run + chmod +x /services/qmail/run + echo -e '#!/bin/sh\nexec setuidgid qmaillog multilog t s10000 n4 ./main' >/services/qmail/log/run + chmod +x /services/qmail/log/run + + ( cd / ; ln -s /services/qmail /service ) + + mkdir -p /services/qmail-smtpd + mkdir -p /services/qmail-smtpd/log + mkdir -p /services/qmail-smtpd/log/main + chown qmaillog /services/qmail-smtpd/log/main + echo -e echo -e '#!/bin/sh\nexec envuidgid qmaild tcpserver -U -c 100 '$MX_IP' smtp /var/qmail/bin/qmail-smtpd' >/services/qmail-smtpd/run + chmod +x /services/qmail-smtpd/run + echo -e '#!/bin/sh\nexec setuidgid qmaillog multilog t s10000 n4 ./main' >/services/qmail-smtpd/log/run + chmod +x /services/qmail-smtpd/log/run + + ( cd / ; ln -s /services/qmail-smtpd /service ) + + mkdir -p /services/qmail-qmtpd + mkdir -p /services/qmail-qmtpd/log + mkdir -p /services/qmail-qmtpd/log/main + chown qmaillog /services/qmail-qmtpd/log/main + echo -e echo -e '#!/bin/sh\nexec envuidgid qmaild tcpserver -U -c 100 '$MX_IP' qmtp /var/qmail/bin/qmail-qmtpd' >/services/qmail-qmtpd/run + chmod +x /services/qmail-qmtpd/run + echo -e '#!/bin/sh\nexec setuidgid qmaillog multilog t s10000 n4 ./main' >/services/qmail-qmtpd/log/run + chmod +x /services/qmail-qmtpd/log/run + + ( cd / ; ln -s /services/qmail-qmtpd /service ) + + ( + cd / + [ -e /usr/sbin/sendmail ] && mv /usr/sbin/sendmail /usr/sbin/sendmail.bak + ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail + ) + + echo 'export MAIL=~/Mailbox' >>/etc/profile + INSTALL_DJBDNS(){ echo -e '\nINSTALL DJBDNS:\n' [[ $(echo X`which gcc`) == X ]] && echo ' fatal error: cannot find gcc' @@ -594,6 +713,8 @@ elif [ "$1" == '--install-djbdns' ]; then INSTALL_DJBDNS elif [ "$1" == '--install-nacl' ]; then INSTALL_NACL +elif [ "$1" == '--setup-qmail' ]; then + SETUP_QMAIL elif [ "$1" == '--configure-dns' ]; then CONFIGURE_DNS elif [ "$1" == '--update-dns' ]; then -- cgit v1.2.3 From 063910fbc22d4d22489d53843cf08b0590b079af Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 29 Jan 2012 01:09:53 +0000 Subject: added documentation for --setup-qmail and fixed autoinstaller for tor users. please see TORIFY section of the README or view www.d3v11.ano/peer2anonet --- contrib/peer2anonet/README.html | 19 +++++++++++++++++++ contrib/peer2anonet/peer2anonet | 1 + 2 files changed, 20 insertions(+) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/README.html b/contrib/peer2anonet/README.html index 4fb5721..1f6e227 100644 --- a/contrib/peer2anonet/README.html +++ b/contrib/peer2anonet/README.html @@ -32,6 +32,9 @@ export http_proxy='http://127.0.0.1:8118/' ./contrib/peer2anonet/peer2anonet --install-* + You can use torify or usewithtor on most options + but setting http_proxy is more reliable. + torify ./contrib/peer2anonet/peer2anonet --install-* usewithtor ./contrib/peer2anonet/peer2anonet --install-* @@ -116,6 +119,22 @@ enjoy to use `--update-dns' to bring your AnoNet domains up to speed. +SETUP QMAIL: + + 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. + + setup-qmail will download and install qmail if it + isn't already installed and configure your + mx domain as a.mx.$nick.ano with the ip of your + resdb git-daemon ip. + + ./contrib/peer2anonet/peer2anonet --setup-qmail + COMPLAIN: If this README doesn't tell you what you need to know diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 8a06432..61412e7 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -428,6 +428,7 @@ SETUP_QMAIL(){ wget http://www.srn.ano/software/qmail-1.03.tar.gz tar xzf qmail-1.03.tgz cd qmail-1.03 + unset http_proxy wget -O- http://www.srn.ano/patches/qmail-1.03-qmtpc.patch | patch -p1 mkdir /var/qmail groupadd nofiles -- cgit v1.2.3 From 1e4204f91537ab860193572de2cb7e628731ec53 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 29 Jan 2012 01:14:05 +0000 Subject: fixes for fatal error status --- 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 61412e7..e7784c7 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -387,7 +387,7 @@ SETUP_QMAIL(){ MX_DOMAIN="a.mx.$NICK.ano" || exit 1 echo "@$NICK.ano:$MX_IP:a:12801:86400">>/services/tinydns/root/data || - echo ' fatal error: needs ./contrib/peer2anonet/peer2nonet --install-daemontools' && + echo ' fatal error: needs ./contrib/peer2anonet/peer2nonet --configure-dns' && exit 1 if [ -e /services/tinydns ]; then -- cgit v1.2.3 From ef4e4deca9736b5497f3c5767f666c3904e168df Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 29 Jan 2012 01:15:15 +0000 Subject: spellcheck --- contrib/peer2anonet/peer2anonet | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index e7784c7..e9ab2df 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -377,9 +377,9 @@ SETUP_QMAIL(){ [[ $(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 ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --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 ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-daemontools' [[ $(echo X`which svscanboot`) == X ]] && exit 1 NICK=`cat conf/git_name` || exit 1 @@ -387,7 +387,7 @@ SETUP_QMAIL(){ MX_DOMAIN="a.mx.$NICK.ano" || exit 1 echo "@$NICK.ano:$MX_IP:a:12801:86400">>/services/tinydns/root/data || - echo ' fatal error: needs ./contrib/peer2anonet/peer2nonet --configure-dns' && + echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --configure-dns' && exit 1 if [ -e /services/tinydns ]; then @@ -496,9 +496,9 @@ INSTALL_DJBDNS(){ [[ $(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 ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --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 ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-daemontools' [[ $(echo X`which svscanboot`) == X ]] && exit 1 cd /usr/local/src wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz @@ -518,9 +518,9 @@ 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 ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --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 ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-daemontools' [[ $(echo X`which svscanboot`) == X ]] && exit 1 if [ -e /services/dnscache ]; then @@ -641,9 +641,9 @@ INSTALL_DJBDNS(){ [[ $(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 ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --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 ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-daemontools' [[ $(echo X`which svscanboot`) == X ]] && exit 1 cd /usr/local/src wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz @@ -663,9 +663,9 @@ UPDATE_DNS(){ exit 0 fi - [[ $(echo X`which tcpserver`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2nonet --install-ucspi-tcp' + [[ $(echo X`which tcpserver`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --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 ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-daemontools' [[ $(echo X`which svscanboot`) == X ]] && exit 1 if [ -e /services/tinydns-ano ]; then -- cgit v1.2.3 From 9f0810c78cd3b9333ccc6488fed0d3265e9871c2 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 29 Jan 2012 01:18:19 +0000 Subject: bugfixes --- contrib/peer2anonet/peer2anonet | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index e9ab2df..c0b496b 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -386,16 +386,16 @@ SETUP_QMAIL(){ MX_IP=`cat conf/gitd_ip` || exit 1 MX_DOMAIN="a.mx.$NICK.ano" || exit 1 - echo "@$NICK.ano:$MX_IP:a:12801:86400">>/services/tinydns/root/data || - echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --configure-dns' && - exit 1 - if [ -e /services/tinydns ]; then ( cd /services echo "creating /etc/peer2anonet/tinydns.tar backup" tar cf /etc/peer2anonet/tinydns.tar tinydns + echo "@$NICK.ano:$MX_IP:a:12801:86400">>/services/tinydns/root/data ) + else + echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --configure-dns' && + exit 1 fi ( -- cgit v1.2.3 From 82ff6232a9b55fa0e6d5b7d2a97799be9b363efa Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 29 Jan 2012 01:20:12 +0000 Subject: bugfixes --- 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 c0b496b..ca4bc65 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -394,7 +394,7 @@ SETUP_QMAIL(){ echo "@$NICK.ano:$MX_IP:a:12801:86400">>/services/tinydns/root/data ) else - echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --configure-dns' && + echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --configure-dns' exit 1 fi -- cgit v1.2.3 From e8cb9da4f1c911c1ce9eda54e92404dc95a7b648 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 29 Jan 2012 08:57:25 +0000 Subject: added user warning for qmail --- contrib/peer2anonet/README.html | 6 ++++++ contrib/peer2anonet/peer2anonet | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'contrib/peer2anonet') diff --git a/contrib/peer2anonet/README.html b/contrib/peer2anonet/README.html index 1f6e227..0bf6db8 100644 --- a/contrib/peer2anonet/README.html +++ b/contrib/peer2anonet/README.html @@ -121,6 +121,12 @@ SETUP QMAIL: + WARN: + + You should patch or firewall off qmail from + reaching IcannNet so someone cannot harvest + your IP with the mailerdaemon response. + If you did not ./configure resdb with tinydns support then you need to do that before using this function. diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index ca4bc65..0f0564c 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -373,6 +373,12 @@ INSTALL_UCSPI_TCP(){ SETUP_QMAIL(){ echo -e '\nSETUP QMAIL:\n' + + echo -e '\tWARN:\n' + echo -e '\tYou should patch or firewall off qmail from' + echo -e '\treaching IcannNet so someone cannot harvest' + echo -e '\tyour IP with the mailerdaemon response.' + [[ $(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' -- cgit v1.2.3