diff --git a/check_process b/check_process index 67035eb..f10ca2f 100644 --- a/check_process +++ b/check_process @@ -1,9 +1,9 @@ ;; General ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" + path="/path" + admin="john" + is_public=1 ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/manifest.json b/manifest.json index 8c75d13..db9ffaf 100644 --- a/manifest.json +++ b/manifest.json @@ -23,7 +23,7 @@ "mysql" ], "requirements": { - "yunohost": ">= 4.1.7" + "yunohost": ">= 4.2.4" }, "arguments": { "install" : [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 624dae9..b04dd7b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -45,8 +45,8 @@ config_gogs() { fi ynh_replace_string "__REPOS_PATH__" "$REPO_PATH" "$final_path/custom/conf/app.ini" - ynh_replace_string "__DB_PWD__" "$dbpass" "$final_path/custom/conf/app.ini" - ynh_replace_string "__DB_NAME__" "$dbuser" "$final_path/custom/conf/app.ini" + ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/custom/conf/app.ini" + ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/custom/conf/app.ini" ynh_replace_string "__DOMAIN__" "$domain" "$final_path/custom/conf/app.ini" ynh_replace_string "__KEY__" "$key" "$final_path/custom/conf/app.ini" ynh_replace_string "__DATA_PATH__" "$DATA_PATH" "$final_path/custom/conf/app.ini" @@ -75,9 +75,9 @@ set_permission() { } set_access_settings() { - if [ "$is_public" = '1' ] + if [ $is_public -eq 1 ] then - ynh_app_setting_set $app unprotected_uris "/" + ynh_permission_update --permission="main" --add="visitors" else # For an access to the git server by https in private mode we need to allow the access to theses URL : # - "DOMAIN/PATH/USER/REPOSITORY/info/refs" diff --git a/scripts/install b/scripts/install index 6cabfed..077d7fe 100644 --- a/scripts/install +++ b/scripts/install @@ -203,11 +203,13 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= ynh_script_progression --message="Configuring SSOwat..." --weight=1 -# Make app public if necessary or protect it -if [ $is_public -eq 1 ] -then - ynh_permission_update --permission="main" --add="visitors" -fi +set_access_settings + +# # Make app public if necessary or protect it +# if [ $is_public -eq 1 ] +# then +# ynh_permission_update --permission="main" --add="visitors" +# fi #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index 32c4383..75b7251 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,6 +34,18 @@ architecture=$(ynh_detect_arch) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================