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 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 tcp --dport $TRACKER_PORT -j ACCEPT
|
||||
iptables -A INPUT -i $WIFI_INTERFACE -p udp --dport 1900 -j ACCEPT
|
||||
save_firewall_settings
|
||||
echo 'configure_firewall_for_zeronet' >> $COMPLETION_FILE
|
||||
|
@ -7391,7 +7392,7 @@ function import_email {
|
|||
}
|
||||
|
||||
function install_web_server {
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" ]]; then
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "install_web_server" $COMPLETION_FILE; then
|
||||
|
|
|
@ -13,6 +13,24 @@ ZERONET_DIR=~/zeronet
|
|||
ZERONET_URL=http://127.0.0.1:43110
|
||||
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 {
|
||||
if [ -d $ZERONET_DIR ]; then
|
||||
return
|
||||
|
@ -42,6 +60,7 @@ fi
|
|||
|
||||
if [[ $SERVER_INSTALLATION == "no" ]]; then
|
||||
if [ ! -f /tmp/meshtype ]; then
|
||||
install_web_server
|
||||
install_zeronet
|
||||
sudo batman start
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
|
Loading…
Reference in New Issue