diff --git a/scripts/install b/scripts/install index 0ec1c34..61f9753 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 @@ -130,7 +123,7 @@ ynh_script_progression --message="Initializing database..." --weight=6 ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" \ < "$final_path/schema/ttrss_schema_mysql.sql" -ynh_exec_as $app php"${phpversion}" ${final_path}/update.php --update-schema +ynh_exec_as $app php${phpversion} ${final_path}/update.php --update-schema #================================================= # START TTRSS IN BACKGROUND diff --git a/scripts/upgrade b/scripts/upgrade index 9919054..68d0bde 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