From 69389a3799cdb9a891cabfcb5e04e9b1a935b511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 29 Jan 2024 15:15:34 +0100 Subject: [PATCH] Use a index.html instead of return in nginx --- conf/nginx.conf | 11 ++++++----- conf/root_index.html | 7 +++++++ scripts/install | 9 +++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 conf/root_index.html diff --git a/conf/nginx.conf b/conf/nginx.conf index 436d7e5..5a7c4f8 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,8 +1,4 @@ -rewrite ^$ /; -location ~ ^/$ { - default_type text/plain; - return 200 "This is where Collabora Online is installed. To actually be useful, this needs to be integrated in a front-end such as Nextcloud for example."; -} +# rewrite ^$ / permanent; # static files location ^~ /browser { @@ -50,3 +46,8 @@ location ^~ /cool/adminws { proxy_set_header Host $host; proxy_read_timeout 36000s; } + +location / { + alias __INSTALL_DIR__/; + index index.html; +} diff --git a/conf/root_index.html b/conf/root_index.html new file mode 100644 index 0000000..f638df0 --- /dev/null +++ b/conf/root_index.html @@ -0,0 +1,7 @@ + + + + +This is where Collabora Online is installed. To actually be useful, this needs to be integrated in a front-end such as Nextcloud for example. + + diff --git a/scripts/install b/scripts/install index 615a4d6..4a2ac59 100644 --- a/scripts/install +++ b/scripts/install @@ -15,6 +15,15 @@ source /usr/share/yunohost/helpers ynh_app_setting_set --app="$app" --key=password --value="$password" +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Setting up source files..." --weight=1 + +ynh_add_config --template="root_index.html" --destination="$install_dir/index.html" + +chown -R "$app:www-data" "$install_dir" + #================================================= # CONFIGURE ONLYOFFICE #=================================================