1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galene_ynh.git synced 2024-09-03 18:36:31 +02:00

Remove firewall allow for 8443 (#35)

* remove firewall allow for 8443
This commit is contained in:
Éric Gaspar 2021-04-09 15:56:10 +02:00 committed by GitHub
parent 824143672c
commit a4531a8816
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 10 deletions

View file

@ -85,7 +85,6 @@ port=$(ynh_find_port --port=8443)
turnserver_port=$(ynh_find_port --port=1194) turnserver_port=$(ynh_find_port --port=1194)
# Open the ports # Open the ports
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
ynh_exec_warn_less yunohost firewall allow Both $turnserver_port ynh_exec_warn_less yunohost firewall allow Both $turnserver_port
# Store opened ports # Store opened ports
@ -254,7 +253,7 @@ chmod 600 $final_path/data/ice-servers.json
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log" --needs_exposed_ports $port yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log"
yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_port yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_port
#================================================= #=================================================

View file

@ -87,11 +87,6 @@ ynh_remove_logrotate
#================================================= #=================================================
ynh_script_progression --message="Closing ports..." --weight=1 ynh_script_progression --message="Closing ports..." --weight=1
if yunohost firewall list | grep -q "\- $port$"
then
ynh_exec_warn_less yunohost firewall disallow TCP $port
fi
if yunohost firewall list | grep -q "\- $turnserver_port$" if yunohost firewall list | grep -q "\- $turnserver_port$"
then then
ynh_exec_warn_less yunohost firewall disallow Both $turnserver_port ynh_exec_warn_less yunohost firewall disallow Both $turnserver_port

View file

@ -96,7 +96,7 @@ systemctl enable coturn-$app.service --quiet
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log" --needs_exposed_ports $port yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log"
yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_port yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_port
#================================================= #=================================================
@ -127,7 +127,6 @@ fi
#================================================= #=================================================
# Ouvre le port dans le firewall # Ouvre le port dans le firewall
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
ynh_exec_warn_less yunohost firewall allow Both $turnserver_port ynh_exec_warn_less yunohost firewall allow Both $turnserver_port
#================================================= #=================================================

View file

@ -37,6 +37,12 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If open, close direct access to $port in firewall
if yunohost firewall list | grep -q "\- $port$"
then
ynh_exec_warn_less yunohost firewall disallow TCP $port
fi
# If final_path doesn't exist, create it # If final_path doesn't exist, create it
if [ -z "$final_path" ]; then if [ -z "$final_path" ]; then
final_path=/opt/yunohost/$app final_path=/opt/yunohost/$app
@ -270,7 +276,7 @@ ynh_use_logrotate --non-append
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log" --needs_exposed_ports $port yunohost service add $app --description="Videoconferencing server" --log="/var/log/$app/$app.log"
yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_port yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_port
#================================================= #=================================================