From 2c58f5cce808ea76f9d8f5758fa754f5292cb142 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 17 Mar 2021 23:15:47 +0100 Subject: [PATCH] Fix --- check_process | 2 -- manifest.json | 14 +------------- pull_request_template.md | 8 -------- scripts/install | 6 +++--- scripts/upgrade | 32 +++++++++++++------------------- 5 files changed, 17 insertions(+), 45 deletions(-) diff --git a/check_process b/check_process index 339a040..ed5281f 100644 --- a/check_process +++ b/check_process @@ -14,8 +14,6 @@ upgrade=1 from_commit=7960d347424cb1cb931c91f2628dd829288184e1 backup_restore=1 multi_instance=0 - incorrect_path=1 - port_already_use=0 change_url=1 ;;; Options Email= diff --git a/manifest.json b/manifest.json index c7a87db..8d171b8 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "julien.malik@paraiso.me" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.7" }, "multi_instance": false, "services": [ @@ -27,29 +27,17 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Baïkal", - "fr": "Choisissez un domaine pour Baïkal" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Baïkal", - "fr": "Choisissez un chemin pour Baïkal" - }, "example": "/baikal", "default": "/baikal" }, { "name": "password", "type": "password", - "ask": { - "en": "Set the password for the administration", - "fr": "Définissez le mot de passe pour l'administration" - }, "example": "mysecret" } ] diff --git a/pull_request_template.md b/pull_request_template.md index f501dd4..0a198cf 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -11,14 +11,6 @@ - [ ] Upgrade from last version tested. - [ ] Can be reviewed and tested. -## Validation ---- -*Minor decision* -- **Upgrade previous version** : -- [ ] **Code review** : -- [ ] **Approval (LGTM)** : -- [ ] **Approval (LGTM)** : - ## Package_check results --- * An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/install b/scripts/install index 91021c1..3f438a4 100644 --- a/scripts/install +++ b/scripts/install @@ -153,12 +153,12 @@ chmod 640 "$final_path/config/baikal.yaml" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=2 +ynh_script_progression --message="Configuring permissions..." --weight=2 # Allow public access on / -ynh_permission_update --permission "main" --add "visitors" +ynh_permission_update --permission="main" --add="visitors" # But restrain on /admin -ynh_permission_create --permission "admin" --url "/admin" --allowed "all_users" +ynh_permission_create --permission="admin" --url="/admin" --allowed="all_users" #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index 72aa84b..bf14dd8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,6 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) #================================================= # CHECK VERSION @@ -45,6 +46,18 @@ if [ -z "$db_name" ]; then ynh_app_setting_set --app=$app --key=db_name --value=$db_name fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + +if ! ynh_permission_exists --permission="admin"; then + # Create the required permissions + ynh_permission_create --permission="admin" --url="/admin" --allowed="all_users" +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -142,11 +155,9 @@ then ynh_app_setting_set --app=$app --key=password_hash --value=$password_hash fi ynh_replace_string --match_string="__PASSWORDHASH__" --replace_string="${password_hash}" --target_file="$bk_conf" - ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$bk_conf" ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$bk_conf" ynh_replace_string --match_string="__DBUSER__" --replace_string="$db_name" --target_file="$bk_conf" - db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_replace_string --match_string="__DBPASS__" --replace_string="$db_pwd" --target_file="$bk_conf" deskey=$(ynh_app_setting_get --app=$app --key=encrypt_key) @@ -183,23 +194,6 @@ chown -R root: "$final_path" chown $app "$final_path/config/baikal.yaml" chmod 640 "$final_path/config/baikal.yaml" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=2 - -# Upgrade from the legacy permissions system -protected_uris=$(ynh_app_setting_get --app="$app" --key=protected_uris) - -if [ -n "${protected_uris}" ]; then - ynh_app_setting_delete --app="$app" --key=protected_uris - - # Allow public access on / - ynh_permission_update --permission "main" --add "visitors" - # But restrain on /admin - ynh_permission_create --permission "admin" --url "/admin" --allowed "all_users" -fi - #================================================= # RELOAD NGINX #=================================================