1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/calibreweb_ynh.git synced 2024-09-03 18:16:20 +02:00

Merge pull request #52 from YunoHost-Apps/no-firewall-open

Port shouldn't be opened on the firewall ... it supposed to be only for reverse proxying
This commit is contained in:
Krakinou 2020-09-20 22:14:36 +02:00 committed by GitHub
commit 36a6191144
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 7 deletions

View file

@ -1,2 +0,0 @@
eclipse.preferences.version=1
encoding//conf/generate_password_hash.py=utf-8

View file

@ -67,14 +67,12 @@ ynh_app_setting_set $app is_public $is_public
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# FIND AND OPEN A PORT
# FIND AN AVAILABLE PORT
#=================================================
# Find a free port
port=$(ynh_find_port 8083)
# Open this port
ynh_script_progression --message="Opening port $port..." --weight=5
yunohost firewall allow --no-upnp TCP $port 2>&1
ynh_script_progression --message="Setting port $port..." --weight=5
ynh_app_setting_set $app port $port
#=================================================

View file

@ -51,7 +51,6 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
ynh_script_progression --message="reopening port $port..." --weight=5
yunohost firewall allow --no-upnp TCP $port 2>&1
ynh_app_setting_set $app port $port
#=================================================

View file

@ -56,6 +56,14 @@ else #on est encore en 0.6.0
current_upstream_app_version='0.6.0'
fi
#Close unwanted open port in firewall
if yunohost firewall list | grep -q "\- $port$"
then
ynh_script_progression --message="Closing port $port as it shouldn't be open..."
yunohost firewall disallow TCP $port 2>&1
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================