1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kavita_ynh.git synced 2024-09-03 19:26:30 +02:00

fix data config not kept between updates

This commit is contained in:
OniriCorpe 2023-08-22 17:32:13 +02:00
parent 12ee4c421e
commit c1a5b26d86
3 changed files with 15 additions and 2 deletions

View file

@ -32,8 +32,11 @@ ynh_change_url_nginx_config
#=================================================
ynh_backup_if_checksum_is_different --file="$install_dir/config/appsettings.json"
key=$(ynh_app_setting_get --app="$app" --key=key)
domain="$new_domain"
ynh_app_setting_set --app="$app" --key=domain --value="$domain"
url_path=${new_path#/}
ynh_app_setting_set --app="$app" --key=url_path --value="$url_path"
ynh_add_config --template="../conf/appsettings.json.example" --destination="$install_dir/config/appsettings.json"

View file

@ -39,8 +39,11 @@ yunohost service add "$app" --description="Cross platform reading server" --log=
#=================================================
ynh_script_progression --message="Modifying a config file..." --weight=1
key=$(ynh_string_random --length=24)
key=$(ynh_string_random --length=70)
ynh_app_setting_set --app="$app" --key=key --value="$key"
url_path=${path#/}
ynh_app_setting_set --app="$app" --key=url_path --value="$url_path"
ynh_add_config --template="../conf/appsettings.json.example" --destination="$install_dir/config/appsettings.json"
chmod 600 "$install_dir/config/appsettings.json"

View file

@ -45,7 +45,14 @@ chmod +x "$install_dir"/Kavita
#=================================================
ynh_script_progression --message="Modifying a config file..." --weight=1
key=$(ynh_string_random --length=24)
key=$(ynh_app_setting_get --app="$app" --key=storage_s3_bucket)
if [ -z "$key" ] || [ "$key" == "super secret unguessable key that is longer because we require it" ]
then
key=$(ynh_string_random --length=70)
ynh_app_setting_set --app="$app" --key=key --value="$key"
fi
url_path=${path#/}
ynh_add_config --template="../conf/appsettings.json.example" --destination="$install_dir/config/appsettings.json"