From bb2dfbc96e995a65dd81f8c6295e9fbd8373e172 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Dec 2020 20:43:30 +0100 Subject: [PATCH] The install script expose a port on the outside with 'yunohost firewall allow' but doesn't use 'yunohost service add' with --needs_exposed_ports ... --- scripts/install | 2 +- scripts/restore | 11 ++++++++++- scripts/upgrade | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index e1d9ec5..10a1496 100644 --- a/scripts/install +++ b/scripts/install @@ -162,7 +162,7 @@ chown -R $app: $final_path #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Syncthing" +yunohost service add $app --description "$app daemon for Syncthing" --needs_exposed_ports $sync_port #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index bbb0233..b51c5ca 100644 --- a/scripts/restore +++ b/scripts/restore @@ -31,6 +31,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) sync_home=$(ynh_app_setting_get --app=$app --key=sync_home) +sync_port=$(ynh_app_setting_get --app=$app --key=sync_port) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -44,6 +45,14 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS +#================================================= +# OPEN A PORT +#================================================= +ynh_script_progression --message="Configuring firewall..." + +# Open the port +ynh_exec_warn_less yunohost firewall allow TCP $sync_port + #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= @@ -98,7 +107,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Syncthing" +yunohost service add $app --description "$app daemon for Syncthing" --needs_exposed_ports $sync_port #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 00a379a..96ad24e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -180,7 +180,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Syncthing" +yunohost service add $app --description "$app daemon for Syncthing" --needs_exposed_ports $sync_port #================================================= # GENERIC FINALIZATION