1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mailman3_ynh.git synced 2024-09-03 19:36:17 +02:00

Fix rest_api_admin_* settings

This commit is contained in:
Salamandar 2024-05-17 16:37:11 +02:00
parent 73115d9dc6
commit 9e56257fce
3 changed files with 17 additions and 3 deletions

View file

@ -33,8 +33,8 @@ ynh_app_setting_set --app="$app" --key="db_pwd_web" --value="$db_pwd_web"
# mailman3 core configuration
rest_api_admin_user="rest_admin"
rest_api_admin_pwd=$(head -n15 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c15)
ynh_app_setting_set --app="$app" --key=rest_admin_user --value="$rest_api_admin_user"
ynh_app_setting_set --app="$app" --key=rest_admin_pwd --value="$rest_api_admin_pwd"
ynh_app_setting_set --app="$app" --key="rest_api_admin_user" --value="$rest_api_admin_user"
ynh_app_setting_set --app="$app" --key="rest_api_admin_pwd" --value="$rest_api_admin_pwd"
# hyperkitty configuration
archiver_key=$(head -n32 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c32)

View file

@ -20,16 +20,28 @@ ynh_systemd_action --service_name="$app-web" --action="stop"
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Create missing db_user_* as copy of db_name_*
if [ -z "$db_user_app" ]; then
db_user_app="$db_name_app"
ynh_app_setting_set --app="$app" --key="db_user_app" --value="$db_user_app"
fi
if [ -z "$db_user_web" ]; then
db_user_web="$db_name_web"
ynh_app_setting_set --app="$app" --key="db_user_web" --value="$db_user_web"
fi
# Migrate rest_admin_* -> rest_api_admin_*
if [ -z "$rest_api_admin_user" ]; then
rest_api_admin_user="$rest_admin_user"
ynh_app_setting_set --app="$app" --key="rest_api_admin_user" --value="$rest_api_admin_user"
ynh_app_setting_delete --app="$app" --key="rest_admin_user"
fi
if [ -z "$rest_api_admin_pwd" ]; then
rest_api_admin_pwd="$rest_admin_pwd"
ynh_app_setting_set --app="$app" --key="rest_api_admin_pwd" --value="$rest_api_admin_pwd"
ynh_app_setting_delete --app="$app" --key="rest_admin_pwd"
fi
#=================================================
# ADD A CONFIGURATION
#=================================================

View file

@ -4,6 +4,8 @@ test_format = 1.0
[default]
exclude = ["change_url"]
# -------------------------------
# Commits to test upgrade from
# -------------------------------