diff --git a/scripts/install b/scripts/install index 0ec1c34..b4d93cf 100644 --- a/scripts/install +++ b/scripts/install @@ -97,15 +97,8 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Configuring ttrss..." --weight=1 -cp ../conf/config.php "$final_path/config.php" - -# Change variables in ttrss configuration -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.php" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php" -ynh_replace_string --match_string="__DOMAIN_PATH__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php" - -# Recalculate and store the config file checksum into the app settings -ynh_store_file_checksum --file="$final_path/config.php" +domain_path=$(https://$domain$path_url) +ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php" #================================================= # SETUP SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index 9919054..0605b4c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -127,18 +127,8 @@ then mv "$tmpdir" "$final_path" ynh_secure_remove --file="$tmpdir" - # Verify the checksum and backup the file if it's different - ynh_backup_if_checksum_is_different --file="$final_path/config.php" - - cp ../conf/config.php "$final_path/config.php" - - # Change variables in ttrss configuration - ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.php" - ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php" - ynh_replace_string --match_string="__DOMAIN_PATH__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php" - - # Recalculate and store the config file checksum into the app settings - ynh_store_file_checksum --file="$final_path/config.php" + domain_path=$(https://$domain$path_url) + ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php" #================================================= # UPGRADE DATABASE