From fa96f09938c09b920732216838fba484bc16b011 Mon Sep 17 00:00:00 2001 From: Tobias Ollive Date: Wed, 7 Apr 2021 10:22:07 +0200 Subject: [PATCH] use port name for http_port --- conf/nginx.conf | 2 +- conf/systemd.service | 2 +- scripts/install | 8 ++++---- scripts/upgrade | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 68bc6c2..57fffa5 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,5 @@ location / { - proxy_pass http://localhost:__PORT_HTTP__/; + proxy_pass http://localhost:__PORT__/; proxy_set_header Host $host; proxy_buffering off; } diff --git a/conf/systemd.service b/conf/systemd.service index dfa0318..b47ba1a 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -4,7 +4,7 @@ After=network.target [Service] Type=simple -Environment="PTL_PORT_HTTP=__HTTP_PORT__" +Environment="PTL_PORT_HTTP=__PORT__" Environment="__YNH_NODE_LOAD_PATH__" User=__APP__ Group=__APP__ diff --git a/scripts/install b/scripts/install index 5768dab..7e2ce07 100644 --- a/scripts/install +++ b/scripts/install @@ -56,9 +56,9 @@ ynh_app_setting_set --app=$app --key=path_url --value=$path_url ynh_script_progression --message="Finding an available port..." # Find an available port -http_port=$(ynh_find_port --port=8001) +port=$(ynh_find_port --port=8001) https_port=$(ynh_find_port --port=8002) -ynh_app_setting_set --app=$app --key=http_port --value=$http_port +ynh_app_setting_set --app=$app --key=port --value=$port ynh_app_setting_set --app=$app --key=https_port --value=$https_port #================================================= @@ -83,7 +83,7 @@ ynh_setup_source --dest_dir="$final_path" ynh_script_progression --message="Configuring nginx web server..." # Create a dedicated nginx config -ynh_add_nginx_config http_port +ynh_add_nginx_config #================================================= # CREATE DEDICATED USER @@ -123,7 +123,7 @@ yunohost service add $app --description="The news reader that doesn't know you" ynh_script_progression --message="Configuring a systemd service..." # Create a dedicated systemd config -ynh_add_systemd_config --others_var="http_port ynh_node_load_PATH" +ynh_add_systemd_config --others_var="port ynh_node_load_PATH" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 02a0628..671e4ef 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,7 +19,7 @@ app=$YNH_APP_INSTANCE_NAME 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) -http_port=$(ynh_app_setting_get --app=$app --key=http_port) +port=$(ynh_app_setting_get --app=$app --key=port) https_port=$(ynh_app_setting_get --app=$app --key=https_port) #=================================================