diff --git a/scripts/upgrade b/scripts/upgrade index 4512cc2..3200a9b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,12 +55,18 @@ fi # Ensure secrets are defined ynh_setup_source --dest_dir="$install_dir" --source_id=main -_set_permissions #================================================= # MIGRATION STEP 2 (Set undefined Vars) #================================================= +ynh_script_progression --message='Migrating missing settings...' + +# Must set permission before to call gitea command +chown -R "$app:$app" "$install_dir" +chmod -R u=rwX,g=rX,o= "$install_dir" +chmod +x "$install_dir/gitea" + if [[ -z "${internal_token:-}" ]]; then internal_token=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret INTERNAL_TOKEN) ynh_app_setting_set --app "$app" --key internal_token --value="$internal_token" @@ -106,6 +112,8 @@ ynh_secure_remove --file="$install_dir/templates" # Configure gitea with app.ini file ynh_add_config --template=app.ini --destination="$install_dir/custom/conf/app.ini" + +ynh_script_progression --message='Setting permissions...' _set_permissions # Update ldap config