mirror of
https://github.com/YunoHost-Apps/writefreely_ynh.git
synced 2024-09-03 20:36:02 +02:00
ynh_add_config
This commit is contained in:
parent
a9189c577d
commit
299ff97b62
3 changed files with 12 additions and 29 deletions
|
@ -14,16 +14,16 @@ hash_seed =
|
||||||
[database]
|
[database]
|
||||||
type = mysql
|
type = mysql
|
||||||
filename =
|
filename =
|
||||||
username = __DBUSER__
|
username = __DB_USER__
|
||||||
password = __DBPWD__
|
password = __DB_PWD__
|
||||||
database = __DBNAME__
|
database = __DB_NAME__
|
||||||
host = localhost
|
host = localhost
|
||||||
port = 3306
|
port = 3306
|
||||||
|
|
||||||
[app]
|
[app]
|
||||||
site_name = WriteFreely
|
site_name = WriteFreely
|
||||||
site_description = WriteFreely_Blogs
|
site_description = WriteFreely_Blogs
|
||||||
host = __DOMAIN_URL__
|
host = https://__DOMAIN____PATH_URL__
|
||||||
theme = write
|
theme = write
|
||||||
editor =
|
editor =
|
||||||
disable_js = false
|
disable_js = false
|
||||||
|
@ -34,7 +34,7 @@ wf_modesty = false
|
||||||
chorus = false
|
chorus = false
|
||||||
forest = false
|
forest = false
|
||||||
disable_drafts = false
|
disable_drafts = false
|
||||||
single_user = __SINGLEUSER__
|
single_user = __SINGLE_USER__
|
||||||
open_registration = true
|
open_registration = true
|
||||||
min_username_len = 3
|
min_username_len = 3
|
||||||
max_blogs = 4
|
max_blogs = 4
|
||||||
|
|
|
@ -129,23 +129,7 @@ ynh_add_systemd_config
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Modifying a config file..."
|
ynh_script_progression --message="Modifying a config file..."
|
||||||
|
|
||||||
# setup application config
|
ynh_add_config --template="../conf/config.ini" --destination="$final_path/config.ini"
|
||||||
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"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MAKE SETUP
|
# MAKE SETUP
|
||||||
|
|
|
@ -24,7 +24,10 @@ admin=$(ynh_app_setting_get --app=$app --key=admin)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
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)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
|
single_user=$(ynh_app_setting_get --app=$app --key=single_user)
|
||||||
|
|
||||||
architecture=$(ynh_detect_arch)
|
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
|
ynh_app_setting_delete --app=$app --key=local_timeline
|
||||||
|
|
||||||
# Close a port
|
# Close a port
|
||||||
|
|
||||||
if yunohost firewall list | grep -q "\- $port$"
|
if yunohost firewall list | grep -q "\- $port$"
|
||||||
then
|
then
|
||||||
echo "Close port $port" >&2
|
echo "Close port $port" >&2
|
||||||
|
@ -142,14 +144,11 @@ ynh_script_progression --message="Upgrading systemd configuration..."
|
||||||
ynh_add_systemd_config
|
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"
|
ynh_add_config --template="../conf/config.ini" --destination="$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"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
Loading…
Add table
Reference in a new issue