1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/paheko_ynh.git synced 2024-09-03 19:56:22 +02:00

Generate secret_key on upgrade if it does not exist and store it

This commit is contained in:
Florent 2023-02-02 16:54:06 +01:00 committed by Florent F
parent b0451fc730
commit 111912e8e1

View file

@ -68,6 +68,13 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# If secret_key doesn't exist, create it
if [[ -z "$secret_key" ]]; then
secret_key=$(ynh_string_random --length=50)
ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all