From 54de20ca6829ac1e027defd1910dbcf83115d8c2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Thu, 25 Jan 2024 20:45:22 +0100 Subject: [PATCH] During synchronize_users, fetch token independently such that it's redacted by yunohost logging mechanism --- scripts/_common.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 2c8bb18..77e1188 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -41,6 +41,8 @@ function set_users_login_source() { function synchronize_users() { ynh_print_info --message="Synchronizing forgejo users" + # Fetch the token independently such that it's redacted by Yunohost logging mechanism + forgejo_api_token=$(ynh_app_setting_get --app=$app --key=forgejo_api_token) # User synchronization must be launched using API : no cli exists for this purpose (https://codeberg.org/forgejo/forgejo/issues/953) - curl --url https://${domain}${path}/api/v1/admin/cron/sync_external_users -X POST -H "Authorization: token $(ynh_app_setting_get --app=$app --key=forgejo_api_token)" -kfsS -} \ No newline at end of file + curl --url https://${domain}${path}/api/v1/admin/cron/sync_external_users -X POST -H "Authorization: token $forgejo_api_token" -kfsS +}