1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hedgedoc_ynh.git synced 2024-09-03 19:25:52 +02:00
This commit is contained in:
ericgaspar 2021-03-10 22:30:33 +01:00
parent e90fcba04b
commit 83d571ae20
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 35 additions and 42 deletions

View file

@ -113,18 +113,16 @@ fi
ynh_backup_if_checksum_is_different --file="$final_path/config.json" ynh_backup_if_checksum_is_different --file="$final_path/config.json"
domain=$new_domain domain=$new_domain
path_url=${new_path:1} path_url=$new_path
# cp ../conf/config.json.example "$final_path/config.json" cp ../conf/config.json.example "$final_path/config.json"
# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.json" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.json"
# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config.json" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config.json"
# ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="$final_path/config.json" ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="$final_path/config.json"
# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.json" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.json"
# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.json" ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.json"
# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/config.json" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/config.json"
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json"
ynh_store_file_checksum --file="$final_path/config.json" ynh_store_file_checksum --file="$final_path/config.json"

View file

@ -135,27 +135,24 @@ ynh_add_systemd_config
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." --weight=1 ynh_script_progression --message="Modifying a config file..." --weight=1
# cp ../conf/config.json.example "$final_path/config.json" cp ../conf/config.json.example "$final_path/config.json"
path_url=${path_url:1}
# Main config File # Main config File
# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.json" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.json"
# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config.json" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config.json"
# ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="$final_path/config.json" ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="$final_path/config.json"
# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.json" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.json"
# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.json" ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.json"
# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/config.json" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/config.json"
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json"
ynh_store_file_checksum --file="$final_path/config.json" ynh_store_file_checksum --file="$final_path/config.json"
# cp ../conf/.sequelizerc.example "$final_path/.sequelizerc" cp ../conf/.sequelizerc.example "$final_path/.sequelizerc"
# # DB Config File # # DB Config File
# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.sequelizerc" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.sequelizerc"
# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/.sequelizerc" ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/.sequelizerc"
ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc"
ynh_store_file_checksum --file="$final_path/.sequelizerc" ynh_store_file_checksum --file="$final_path/.sequelizerc"
#================================================= #=================================================

View file

@ -127,35 +127,33 @@ then
popd || ynh_die popd || ynh_die
fi fi
# #================================================= #=================================================
# # MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
# #================================================= #=================================================
# ynh_script_progression --message="Modifying a config file..." --weight=2 ynh_script_progression --message="Modifying a config file..." --weight=2
# ynh_backup_if_checksum_is_different --file="$final_path/config.json" ynh_backup_if_checksum_is_different --file="$final_path/config.json"
# path_url=${path_url:1} cp ../conf/config.json.example "$final_path/config.json"
# # cp ../conf/config.json.example "$final_path/config.json"
# # # Main config File # # Main config File
# # ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.json" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.json"
# # ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config.json" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config.json"
# # ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="$final_path/config.json" ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="$final_path/config.json"
# # ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.json" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.json"
# # ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.json" ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.json"
# # ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/config.json" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/config.json"
# ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json" # Recalculate and store the checksum of the file for the next upgrade.
# # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$final_path/config.json"
# ynh_store_file_checksum --file="$final_path/config.json"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=2 ynh_script_progression --message="Configuring a systemd service..." --weight=2
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service"
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config