From 73173b86ad97c33cfaa7de73edf337b54f2042e4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 19:18:24 +0100 Subject: [PATCH] Fix --- conf/nginx.conf | 34 ++++++++++++++++++++-------------- conf/systemd.service | 14 -------------- scripts/install | 12 ++++++------ 3 files changed, 26 insertions(+), 34 deletions(-) delete mode 100644 conf/systemd.service diff --git a/conf/nginx.conf b/conf/nginx.conf index f4bb9b0..19d6268 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,15 +1,21 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { - - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header x-forwarded-for $remote_addr; - - proxy_pass http://127.0.0.1:__PORT__/kiwi/; - 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"; +location / { + index index.html; + root /usr/share/kiwiirc/; } + +location /webirc/ { + # Forward incoming requests to local webircgateway socket + proxy_pass http://127.0.0.1:__PORT__/webirc/; + + # Set http version and headers + proxy_http_version 1.1; + + # Add X-Forwarded-* headers + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-For $remote_addr; + + # Allow upgrades to websockets + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; +} \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service deleted file mode 100644 index defb1a1..0000000 --- a/conf/systemd.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Websocket gateway to IRC networks -Documentation=https://github.com/kiwiirc/webircgateway -After=network.target - -[Service] -User=__APP__ -Group=__APP__ -ExecStart=/var/www/webircgateway/kiwiirc --config=/var/www/webircgateway/config.conf -ExecReload=/usr/bin/kill -USR1 $MAINPID -LimitNOFILE=1048576 - -[Install] -WantedBy=multi-user.target diff --git a/scripts/install b/scripts/install index f06dd46..fb02465 100644 --- a/scripts/install +++ b/scripts/install @@ -31,11 +31,11 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +# final_path=/var/www/$app +# test ! -e "$final_path" || ynh_die --message="This path already contains a folder" -# Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +# # Register (book) web path +# ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST @@ -108,10 +108,10 @@ ynh_add_nginx_config #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +#ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config -ynh_add_systemd_config +#ynh_add_systemd_config # #================================================= # # MODIFY A CONFIG FILE