From 8efcb6bc7b777433cbd0423021ef8e7629d48142 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 18:51:24 +0100 Subject: [PATCH] Fix --- conf/nginx.conf | 14 ++++++++++---- scripts/install | 8 ++++---- scripts/remove | 8 ++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 508fc0a..2424f64 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,9 +1,15 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Path to source - alias __FINALPATH__/ ; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header x-forwarded-for $remote_addr; - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; + proxy_pass http://127.0.0.1:__PORT__; + proxy_redirect default; + + # Websocket support (from version 1.4) + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; } diff --git a/scripts/install b/scripts/install index 2aa3206..4ffd8e5 100644 --- a/scripts/install +++ b/scripts/install @@ -48,11 +48,11 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url #================================================= # FIND AND OPEN A PORT #================================================= -# ynh_script_progression --message="Finding an available port..." --weight=1 +ynh_script_progression --message="Finding an available port..." --weight=1 -# # Find an available port -# port=$(ynh_find_port --port=7778) -# ynh_app_setting_set --app=$app --key=port --value=$port +# Find an available port +port=$(ynh_find_port --port=7778) +ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # CREATE DEDICATED USER diff --git a/scripts/remove b/scripts/remove index 65fc0d6..d09b0bd 100644 --- a/scripts/remove +++ b/scripts/remove @@ -45,11 +45,11 @@ ynh_remove_systemd_config #================================================= ynh_script_progression --message="Removing KiwiIRC main directory..." --weight=6 -# Remove the app directory securely -ynh_secure_remove --file="$final_path" - -ynh_secure_remove --file="/var/www/webircgateway" +# # Remove the app directory securely +# ynh_secure_remove --file="$final_path" +# ynh_secure_remove --file="/var/www/webircgateway" +dpkg --remove kiwiirc #================================================= # REMOVE NGINX CONFIGURATION #=================================================