From fd2afa1df8f77e64fb25aa4a100837dc810d50cf Mon Sep 17 00:00:00 2001 From: SylvainCecchetto Date: Thu, 19 Oct 2017 21:38:10 +0200 Subject: [PATCH] Fix inaccess webserver with / path --- README.md | 1 - scripts/install | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b785d0d..e3d3b49 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,6 @@ Kodi for YunoHost ## To do * Test control web interface on Raspberry * Switch from skipped_uri to protected_uri and try if it still works for jsonrpc and image location -* Check if a "/" path still works * Write the upgrade and backup script * Check if webserver port (8080) is free diff --git a/scripts/install b/scripts/install index 4369a54..e992703 100644 --- a/scripts/install +++ b/scripts/install @@ -43,6 +43,7 @@ ynh_webpath_available $domain $path_url ynh_webpath_register $app $domain $path_url + #================================================= # STORE SETTINGS FROM MANIFEST #================================================= @@ -124,7 +125,16 @@ fi #================================================= # NGINX #================================================= -ynh_add_nginx_config +#ynh_add_nginx_config +finalnginxconf="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup_if_checksum_is_different "$finalnginxconf" +sudo cp ../conf/nginx.conf "$finalnginxconf" + +if [ "$path_url" == "/" ]; then + ynh_replace_string "__PATH__/" "/" "$finalnginxconf" +else + ynh_replace_string "__PATH__" "$path_url" "$finalnginxconf" +fi ynh_app_setting_set $app protected_uris "/"