1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mygpo_ynh.git synced 2024-09-03 19:55:52 +02:00

fix upgrade

This commit is contained in:
Salamandar 2024-03-04 16:37:46 +01:00
parent 454fd5e466
commit 20183e756a
2 changed files with 13 additions and 2 deletions

View file

@ -15,7 +15,7 @@ admin_email=$(ynh_user_get_info --username="$admin" --key="mail")
secret_key=$(ynh_string_random --length=64) secret_key=$(ynh_string_random --length=64)
staff_token=$(ynh_string_random --length=64) staff_token=$(ynh_string_random --length=64)
ynh_app_setting_set --app="$app" --key="random_key" --value="$secret_key" ynh_app_setting_set --app="$app" --key="secret_key" --value="$secret_key"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE

View file

@ -7,6 +7,12 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# INITIALIZE AND STORE SETTINGS
#=================================================
admin_email=$(ynh_user_get_info --username="$admin" --key="mail")
#================================================= #=================================================
# STOP SYSTEMD SERVICES # STOP SYSTEMD SERVICES
#================================================= #=================================================
@ -33,6 +39,12 @@ if [ -n "${data_path:-}" ]; then
ynh_app_setting_delete --app="$app" --key=admin_email ynh_app_setting_delete --app="$app" --key=admin_email
fi fi
if [[ -n "${random_key:-}" ]]; then
secret_key="$random_key"
ynh_app_setting_delete --app="$app" --key=random_key
ynh_app_setting_set --app="$app" --key=secret_key --value="$random_key"
fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -58,7 +70,6 @@ echo "django.core.mail.backends.console.EmailBackend" > "$env_path/EMAIL_BACKEND
echo "$data_dir" > "$env_path/MEDIA_ROOT" echo "$data_dir" > "$env_path/MEDIA_ROOT"
echo "$secret_key" > "$env_path/SECRET_KEY" echo "$secret_key" > "$env_path/SECRET_KEY"
echo "$app@$domain" > "$env_path/SERVER_EMAIL" echo "$app@$domain" > "$env_path/SERVER_EMAIL"
echo "$staff_token" > "$env_path/STAFF_TOKEN"
set_permissions set_permissions