Install a web server on mesh clients for the zeronet tracker
This commit is contained in:
parent
bb7af17742
commit
87d5c2ac57
|
@ -6043,6 +6043,7 @@ function configure_firewall_for_zeronet {
|
||||||
iptables -A INPUT -i $WIFI_INTERFACE -p udp --dport $ZERONET_PORT -j ACCEPT
|
iptables -A INPUT -i $WIFI_INTERFACE -p udp --dport $ZERONET_PORT -j ACCEPT
|
||||||
iptables -A INPUT -i $WIFI_INTERFACE -p tcp --dport $ZERONET_PORT -j ACCEPT
|
iptables -A INPUT -i $WIFI_INTERFACE -p tcp --dport $ZERONET_PORT -j ACCEPT
|
||||||
iptables -A INPUT -i $WIFI_INTERFACE -p udp --dport $TRACKER_PORT -j ACCEPT
|
iptables -A INPUT -i $WIFI_INTERFACE -p udp --dport $TRACKER_PORT -j ACCEPT
|
||||||
|
iptables -A INPUT -i $WIFI_INTERFACE -p tcp --dport $TRACKER_PORT -j ACCEPT
|
||||||
iptables -A INPUT -i $WIFI_INTERFACE -p udp --dport 1900 -j ACCEPT
|
iptables -A INPUT -i $WIFI_INTERFACE -p udp --dport 1900 -j ACCEPT
|
||||||
save_firewall_settings
|
save_firewall_settings
|
||||||
echo 'configure_firewall_for_zeronet' >> $COMPLETION_FILE
|
echo 'configure_firewall_for_zeronet' >> $COMPLETION_FILE
|
||||||
|
@ -7391,7 +7392,7 @@ function import_email {
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_web_server {
|
function install_web_server {
|
||||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if grep -Fxq "install_web_server" $COMPLETION_FILE; then
|
if grep -Fxq "install_web_server" $COMPLETION_FILE; then
|
||||||
|
|
|
@ -13,6 +13,24 @@ ZERONET_DIR=~/zeronet
|
||||||
ZERONET_URL=http://127.0.0.1:43110
|
ZERONET_URL=http://127.0.0.1:43110
|
||||||
TRACKER_PORT=6969
|
TRACKER_PORT=6969
|
||||||
|
|
||||||
|
function install_web_server {
|
||||||
|
if [ -d /etc/nginx ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo apt-get -y remove --purge apache2
|
||||||
|
if [ -d /etc/apache2 ]; then
|
||||||
|
sudo rm -rf /etc/apache2
|
||||||
|
fi
|
||||||
|
# install nginx
|
||||||
|
sudo apt-get -y install nginx
|
||||||
|
|
||||||
|
if [ ! -d /etc/nginx ]; then
|
||||||
|
echo 'Unable to install web server'
|
||||||
|
exit 51
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function install_zeronet {
|
function install_zeronet {
|
||||||
if [ -d $ZERONET_DIR ]; then
|
if [ -d $ZERONET_DIR ]; then
|
||||||
return
|
return
|
||||||
|
@ -42,6 +60,7 @@ fi
|
||||||
|
|
||||||
if [[ $SERVER_INSTALLATION == "no" ]]; then
|
if [[ $SERVER_INSTALLATION == "no" ]]; then
|
||||||
if [ ! -f /tmp/meshtype ]; then
|
if [ ! -f /tmp/meshtype ]; then
|
||||||
|
install_web_server
|
||||||
install_zeronet
|
install_zeronet
|
||||||
sudo batman start
|
sudo batman start
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
|
@ -78,9 +97,9 @@ cd $ZERONET_DIR
|
||||||
|
|
||||||
existing_bttrack=$(ps aux | grep bttrack | wc -l)
|
existing_bttrack=$(ps aux | grep bttrack | wc -l)
|
||||||
if [ $existing_bttrack -lt "2" ]; then
|
if [ $existing_bttrack -lt "2" ]; then
|
||||||
if [ ! -d ~/.bttrack ]; then
|
if [ ! -d ~/.bttrack ]; then
|
||||||
mkdir ~/.bttrack
|
mkdir ~/.bttrack
|
||||||
fi
|
fi
|
||||||
bttrack --port ${TRACKER_PORT} --dfile ~/.bttrack/dstate --logfile ~/.bttrack/tracker.log --nat_check 0 --scrape_allowed full --ipv6_enabled 0 &
|
bttrack --port ${TRACKER_PORT} --dfile ~/.bttrack/dstate --logfile ~/.bttrack/tracker.log --nat_check 0 --scrape_allowed full --ipv6_enabled 0 &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue