Browse Source

scripts - add firewall rules

Émile Morel 10 years ago
parent
commit
0447d24fda
2 changed files with 8 additions and 0 deletions
  1. 4 0
      scripts/install
  2. 4 0
      scripts/remove

+ 4 - 0
scripts/install

@@ -77,6 +77,10 @@ sudo sed "s|<TPL:NGINX_LOCATION>|${url_path}|g" -i /var/www/torclient/config.php
 # Copy init script
 sudo install -o root -g root -m 0755 ../conf/init_ynh-torclient /etc/init.d/ynh-torclient
 
+# Update firewall for DHCP
+sudo yunohost firewall allow --no-upnp UDP 9053
+sudo yunohost firewall allow --no-upnp TCP 9040
+
 # Set default inits
 #php-fpm is already installed by yunohost hotspot app
 sudo service php-fpm stop

+ 4 - 0
scripts/remove

@@ -27,6 +27,10 @@ sudo yunohost service remove ynh-torclient
 sudo rm -f /etc/init.d/ynh-torclient
 sudo rm -f /tmp/.ynh-torclient-*
 
+# Update firewall for DHCP
+sudo yunohost firewall disallow UDP 9053
+sudo yunohost firewall disallow TCP 9040
+
 # Remove confs
 sudo rm -rf /etc/tor*
 sudo rm -f /etc/nginx/conf.d/${domain}.d/torclient.conf