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:
commit
36a6191144
4 changed files with 10 additions and 7 deletions
|
@ -1,2 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//conf/generate_password_hash.py=utf-8
|
|
@ -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
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue