Browse Source

Use zeronet branch

Bob Mottram 9 years ago
parent
commit
9af505d1f4
1 changed files with 19 additions and 2 deletions
  1. 19
    2
      src/freedombone

+ 19
- 2
src/freedombone View File

@@ -401,8 +401,10 @@ TOX_NODE=
401 401
 #  '144.76.60.215,2a01:4f8:191:64d6::1,33445,04119E835DF3E78BACF0F84235B300546AF8B936F035185E2A8E9E0A67C8924F,sonOfRa,DE'
402 402
 #)
403 403
 
404
-ZERONET_REPO='https://github.com/HelloZeroNet/ZeroNet.git'
404
+#ZERONET_REPO='https://github.com/HelloZeroNet/ZeroNet.git'
405
+ZERONET_REPO='https://github.com/bashrc/ZeroNet.git'
405 406
 ZERONET_PORT=15441
407
+TRACKER_PORT=51413
406 408
 
407 409
 # Default diffie-hellman key length in bits
408 410
 DH_KEYLENGTH=1024
@@ -761,6 +763,9 @@ function read_configuration {
761 763
   fi
762 764
 
763 765
   if [ -f $CONFIGURATION_FILE ]; then
766
+      if grep -q "TRACKER_PORT" $CONFIGURATION_FILE; then
767
+          TRACKER_PORT=$(grep "TRACKER_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
768
+      fi
764 769
       if grep -q "ZERONET_PORT" $CONFIGURATION_FILE; then
765 770
           ZERONET_PORT=$(grep "ZERONET_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
766 771
       fi
@@ -1616,12 +1621,18 @@ function install_zeronet {
1616 1621
       return
1617 1622
   fi
1618 1623
 
1619
-  apt-get -y install python python-msgpack python-gevent python-pip
1624
+  apt-get -y install python python-msgpack python-gevent
1625
+  apt-get -y install python-pip transmission-daemon
1620 1626
   pip install msgpack-python --upgrade
1621 1627
 
1622 1628
   useradd -d /opt/zeronet/ -s /bin/false zeronet
1623 1629
   git clone $ZERONET_REPO /opt/zeronet
1630
+  if [ ! -d /opt/zeronet ]; then
1631
+      exit 56823
1632
+  fi
1624 1633
   sudo chown -R zeronet:zeronet /opt/zeronet
1634
+  cd /opt/zeronet
1635
+  git checkout bashrc/bootstrap-file
1625 1636
 
1626 1637
   echo '[Unit]' > /etc/systemd/system/zeronet.service
1627 1638
   echo 'Description=Zeronet Server' >> /etc/systemd/system/zeronet.service
@@ -1639,6 +1650,11 @@ function install_zeronet {
1639 1650
   echo '[Install]' >> /etc/systemd/system/zeronet.service
1640 1651
   echo 'WantedBy=multi-user.target' >> /etc/systemd/system/zeronet.service
1641 1652
 
1653
+  # publish regularly
1654
+  if ! grep -Fxq "zeronetavahi" /etc/crontab; then
1655
+      echo "* *       * * *   root    zeronetavahi > /dev/null" >> /etc/crontab
1656
+  fi
1657
+
1642 1658
   systemctl enable zeronet.service
1643 1659
   systemctl start zeronet.service
1644 1660
 
@@ -6001,6 +6017,7 @@ function configure_firewall_for_zeronet {
6001 6017
   fi
6002 6018
   iptables -A INPUT -i $WIFI_INTERFACE -p udp --dport $ZERONET_PORT -j ACCEPT
6003 6019
   iptables -A INPUT -i $WIFI_INTERFACE -p tcp --dport $ZERONET_PORT -j ACCEPT
6020
+  iptables -A INPUT -i $WIFI_INTERFACE -p udp --dport $TRACKER_PORT -j ACCEPT
6004 6021
   save_firewall_settings
6005 6022
   echo 'configure_firewall_for_zeronet' >> $COMPLETION_FILE
6006 6023
 }