diff --git a/conf/nginx.conf b/conf/nginx.conf index e50388e..5a74de2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location / { +location ^~ __PATH__/ { proxy_pass http://127.0.0.1:__PORT__; proxy_redirect off; proxy_set_header Host $host; diff --git a/manifest.json b/manifest.json index a874298..922c325 100644 --- a/manifest.json +++ b/manifest.json @@ -6,12 +6,11 @@ "en": "OnlyOffice package for YunoHost.", "fr": "OnlyOffice pour YunoHost." }, - "url": "https://", + "url": "https://onlyoffice.com", "license": "free", "maintainer": { "name": "liberodark", "email": "liberodark@gmail.com", - "url": "https://onlyoffice.com" }, "requirements": { "yunohost": ">= 2.7.2" @@ -42,8 +41,17 @@ }, "example": "/onlyoffice", "default": "/onlyoffice" - } - - ] -} -} + }, + + { + "name": "is_public", + "type": "boolean", + "ask": { + "en": "Is it a public site ?", + "fr": "Est-ce un site public ?" + }, + "default": "true" + } + ] + } +} \ No newline at end of file diff --git a/scripts/install b/scripts/install index c79448c..64034d0 100644 --- a/scripts/install +++ b/scripts/install @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -source _common.sh +#source _common.sh source /usr/share/yunohost/helpers #================================================= @@ -26,8 +26,8 @@ ynh_abort_if_errors # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN -#path_url=$YNH_APP_ARG_PATH -#port=$YNH_APP_ARG_PORT +path_url=$YNH_APP_ARG_PATH +is_public=$YNH_APP_ARG_IS_PUBLIC ### If it's a multi-instance app, meaning it can be installed several times independently ### The id of the app as stated in the manifest is available as $YNH_APP_ID @@ -51,19 +51,20 @@ final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" # Normalize the url path syntax -path_url=$(ynh_normalize_url_path /) +path_url=$(ynh_normalize_url_path $path_url) # Check web path availability -ynh_webpath_available $domain / +ynh_webpath_available $domain $path_url # Register (book) web path -ynh_webpath_register $app $domain / +ynh_webpath_register $app $domain $path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= ynh_app_setting_set $app domain $domain -#ynh_app_setting_set $app port $port +ynh_app_setting_set $app path $path_url +ynh_app_setting_set $app is_public $is_public #================================================= # FIND AND OPEN A PORT @@ -201,8 +202,11 @@ cp -a ../conf/default.json /etc/onlyoffice/documentserver/default.json # SETUP SSOWAT #================================================= -# unprotected_uris allows SSO credentials to be passed anyway. -ynh_app_setting_set $app unprotected_uris "/" +# If app is public, add url to SSOWat conf as skipped_uris +if [ $is_public -eq 1 ]; then + # unprotected_uris allows SSO credentials to be passed anyway. + ynh_app_setting_set "$app" unprotected_uris "/" +fi # Reload services systemctl restart nginx