diff --git a/conf/config.ini b/conf/config.ini index 48b1529..e348efd 100644 --- a/conf/config.ini +++ b/conf/config.ini @@ -14,16 +14,16 @@ hash_seed = [database] type = mysql filename = -username = __DBUSER__ -password = __DBPWD__ -database = __DBNAME__ +username = __DB_USER__ +password = __DB_PWD__ +database = __DB_NAME__ host = localhost port = 3306 [app] site_name = WriteFreely site_description = WriteFreely_Blogs -host = __DOMAIN_URL__ +host = https://__DOMAIN____PATH_URL__ theme = write editor = disable_js = false @@ -34,7 +34,7 @@ wf_modesty = false chorus = false forest = false disable_drafts = false -single_user = __SINGLEUSER__ +single_user = __SINGLE_USER__ open_registration = true min_username_len = 3 max_blogs = 4 diff --git a/scripts/install b/scripts/install index 8e23900..94e78c2 100755 --- a/scripts/install +++ b/scripts/install @@ -129,23 +129,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Modifying a config file..." -# setup application config -cp "../conf/config.ini" "$final_path/config.ini" - -ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$final_path/config.ini" -ynh_replace_string --match_string="__DBUSER__" --replace_string="$db_name" --target_file="$final_path/config.ini" -ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$final_path/config.ini" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.ini" -ynh_replace_string --match_string="__DOMAIN_URL__" --replace_string="https://$domain" --target_file="$final_path/config.ini" -ynh_replace_string --match_string="__SINGLEUSER__" --replace_string="$single_user" --target_file="$final_path/config.ini" - -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= -ynh_script_progression --message="Storing the config file checksum..." - -# Calculate and store the config file checksum into the app settings -ynh_store_file_checksum --file="$final_path/config.ini" +ynh_add_config --template="../conf/config.ini" --destination="$final_path/config.ini" #================================================= # MAKE SETUP diff --git a/scripts/upgrade b/scripts/upgrade index 5467c58..01a493b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,10 @@ admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) port=$(ynh_app_setting_get --app=$app --key=port) +single_user=$(ynh_app_setting_get --app=$app --key=single_user) architecture=$(ynh_detect_arch) @@ -52,7 +55,6 @@ ynh_app_setting_delete --app=$app --key=private ynh_app_setting_delete --app=$app --key=local_timeline # Close a port - if yunohost firewall list | grep -q "\- $port$" then echo "Close port $port" >&2 @@ -142,14 +144,11 @@ ynh_script_progression --message="Upgrading systemd configuration..." ynh_add_systemd_config #================================================= -# STORE THE CONFIG FILE CHECKSUM +# MODIFY A CONFIG FILE #================================================= -ynh_script_progression --message="Storing the config file checksum..." +ynh_script_progression --message="Modifying a config file..." -ynh_backup_if_checksum_is_different --file="$final_path/config.ini" - -# Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file="$final_path/config.ini" +ynh_add_config --template="../conf/config.ini" --destination="$final_path/config.ini" #================================================= # GENERIC FINALIZATION