Commit 2846297f authored by Aleks's avatar Aleks
Browse files

'path' is sometime called path or path_url ... and it's a huge mess full of...

'path' is sometime called path or path_url ... and it's a huge mess full of nonsense but we gotta stick to it if we want things to work T.T...
parent af2ef3d2
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"example": "domain.org" "example": "domain.org"
}, },
{ {
"name": "path_url", "name": "path",
"type": "path", "type": "path",
"ask": { "ask": {
"en": "Choose a path for Neutrinet application", "en": "Choose a path for Neutrinet application",
......
...@@ -22,7 +22,7 @@ ynh_abort_if_errors ...@@ -22,7 +22,7 @@ ynh_abort_if_errors
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path_url) path_url=$(ynh_app_setting_get $app path)
app_user=$(ynh_app_setting_get $app app_user) app_user=$(ynh_app_setting_get $app app_user)
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
opt_path=$(ynh_app_setting_get $app opt_path) opt_path=$(ynh_app_setting_get $app opt_path)
......
...@@ -20,7 +20,7 @@ ynh_abort_if_errors ...@@ -20,7 +20,7 @@ ynh_abort_if_errors
#================================================= #=================================================
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH_URL path_url=$YNH_APP_ARG_PATH
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
app_user=$app app_user=$app
...@@ -42,7 +42,7 @@ ynh_webpath_register $app $domain $path_url ...@@ -42,7 +42,7 @@ ynh_webpath_register $app $domain $path_url
#================================================= #=================================================
ynh_app_setting_set $app domain $domain ynh_app_setting_set $app domain $domain
ynh_app_setting_set $app path_url $path_url ynh_app_setting_set $app path $path_url
ynh_app_setting_set $app app_user $app_user ynh_app_setting_set $app app_user $app_user
ynh_app_setting_set $app final_path $final_path ynh_app_setting_set $app final_path $final_path
ynh_app_setting_set $app opt_path $opt_path ynh_app_setting_set $app opt_path $opt_path
......
...@@ -16,7 +16,6 @@ source _common.sh ...@@ -16,7 +16,6 @@ source _common.sh
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path_url)
app_user=$(ynh_app_setting_get $app app_user) app_user=$(ynh_app_setting_get $app app_user)
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
opt_path=$(ynh_app_setting_get $app opt_path) opt_path=$(ynh_app_setting_get $app opt_path)
......
...@@ -22,7 +22,7 @@ ynh_abort_if_errors ...@@ -22,7 +22,7 @@ ynh_abort_if_errors
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path_url) path_url=$(ynh_app_setting_get $app path)
app_user=$(ynh_app_setting_get $app app_user) app_user=$(ynh_app_setting_get $app app_user)
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
opt_path=$(ynh_app_setting_get $app opt_path) opt_path=$(ynh_app_setting_get $app opt_path)
......
...@@ -16,8 +16,7 @@ source _common.sh ...@@ -16,8 +16,7 @@ source _common.sh
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
path=$(ynh_app_setting_get $app path) path_url=$(ynh_app_setting_get $app path)
path_url=$(ynh_app_setting_get $app path_url)
app_user=$(ynh_app_setting_get $app app_user) app_user=$(ynh_app_setting_get $app app_user)
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
opt_path=$(ynh_app_setting_get $app opt_path) opt_path=$(ynh_app_setting_get $app opt_path)
...@@ -58,26 +57,6 @@ if [[ -z $app_user ]]; then ...@@ -58,26 +57,6 @@ if [[ -z $app_user ]]; then
ynh_app_setting_set $app app_user $app_user ynh_app_setting_set $app app_user $app_user
fi fi
# Trim trailing slashes
path_url=$(sed 's@/*$@@' <<< $path_url)
if [[ -z $path_url ]]; then
path_url=$path
if [[ -z $path_url ]]; then
ynh_die "Missing path url!"
else
ynh_app_setting_set $app path_url $path_url
fi
fi
# path setting is needed by Yunohost
# when path is empty, Yunohost thinks the app is on the domain root
if [[ "$path" != "$path_url" ]]; then
path=$path_url
ynh_app_setting_set $app path $path
fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment