From f9a4bd40d89eba61d1cbe8189f8db699d7dd913f Mon Sep 17 00:00:00 2001 From: chris0688 <109092856+chris0688@users.noreply.github.com> Date: Mon, 11 Jul 2022 19:47:01 +0200 Subject: [PATCH] add manual port change at install add the feature to change the portrange for tunnels manual on install --- manifest.json | 18 ++++++++++++++++++ scripts/install | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 2b57702..1097d35 100644 --- a/manifest.json +++ b/manifest.json @@ -40,6 +40,24 @@ "name": "password", "type": "password" } + { + "name": "first port" + "type": "firstport" + "ask": { + "en": "Enter the FIRST Port that should be used by Rport eg. port for tunnels (standard 20000)"" + "de": "Bitte geben Sie den LETZEN Port ein welcher von Rport für z.B. die Tunnels genutzt wird (Standart 20000)" + }, + "example": "20000" + }, + { + "name": "last port" + "type": "lastport" + "ask": { + "en": "Enter the LAST Port that should be used by Rport eg. port for tunnels (standard 30000)"" + "de": "Bitte geben Sie den LETZEN Port ein welcher von Rport für z.B. die Tunnels genutzt wird (Standart 30000)" + }, + "example": "30000" + } ] } } diff --git a/scripts/install b/scripts/install index 43ab9ca..abe1c38 100755 --- a/scripts/install +++ b/scripts/install @@ -76,9 +76,9 @@ ynh_app_setting_set --app=$app --key=api_port --value=$api_port guacd_port=$(ynh_find_port --port=$(($api_port + 1))) ynh_app_setting_set --app=$app --key=guacd_port --value=$guacd_port -used_start_port=$(ynh_find_port --port=20000) +used_start_port=$YNH_APP_ARG_FIRSTPORT ynh_app_setting_set --app=$app --key=used_start_port --value=$used_start_port -used_end_port=$(ynh_find_port --port=30000) +used_end_port=$YNH_APP_ARG_LASTPORT ynh_app_setting_set --app=$app --key=used_end_port --value=$used_end_port ynh_exec_warn_less yunohost firewall allow TCP $used_start_port:$used_end_port