diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 8e4e3b8..0000000 --- a/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding//conf/generate_password_hash.py=utf-8 diff --git a/scripts/install b/scripts/install index 7db37be..8b96265 100755 --- a/scripts/install +++ b/scripts/install @@ -72,8 +72,7 @@ ynh_app_setting_set $app is_public $is_public # Find a free port port=$(ynh_find_port 8083) -# Open this port -ynh_script_progression --message="Opening port $port..." --weight=5 +ynh_script_progression --message="Setting port $port..." --weight=5 ynh_app_setting_set $app port $port #================================================= diff --git a/scripts/restore b/scripts/restore index bdcbcac..70df492 100755 --- a/scripts/restore +++ b/scripts/restore @@ -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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d330989..e5e31d6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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..." --weight=10 + yunohost firewall disallow TCP $port 2>&1 +fi + + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================