1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piwigo_ynh.git synced 2024-09-03 20:06:03 +02:00

Add ynh_add_config

This commit is contained in:
ericgaspar 2021-02-17 10:34:21 +01:00
parent 3b5d9d9ec0
commit 442a796ed1
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 8 additions and 17 deletions

View file

@ -1,8 +1,8 @@
<?php
$conf['dblayer'] = 'mysqli';
$conf['db_base'] = '__DBTOCHANGE__';
$conf['db_user'] = '__USERTOCHANGE__';
$conf['db_password'] = '__PASSTOCHANGE__';
$conf['db_base'] = '__DB_NAME__';
$conf['db_user'] = '__DB_NAME__';
$conf['db_password'] = '__DB_PWD__';
$conf['db_host'] = 'localhost';
$prefixeTable = '';

View file

@ -69,7 +69,7 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
# BACKUP THE DATA DIRECTORY
#=================================================
ynh_backup --src_path="/home/yunohost.app/${app}/upload" --is_big
ynh_backup --src_path="/home/yunohost.app/$app/upload" --is_big
#=================================================
# END OF SCRIPT

View file

@ -181,11 +181,7 @@ cp ../conf/config.inc.php $final_path/local/config/
ynh_store_file_checksum --file="$final_path/local/config/config.inc.php"
# Setup database in local/config/database.inc.php
ynh_replace_string --match_string="__DBTOCHANGE__" --replace_string="$db_name" --target_file=../conf/database.inc.php
ynh_replace_string --match_string="__USERTOCHANGE__" --replace_string="$db_name" --target_file=../conf/database.inc.php
ynh_replace_string --match_string="__PASSTOCHANGE__" --replace_string="$db_pwd" --target_file=../conf/database.inc.php
cp ../conf/database.inc.php $final_path/local/config/database.inc.php
ynh_add_config --template="../conf/database.inc.php" --destination="$final_path/local/config/database.inc.php"
# Calculate and store the database config file checksum
ynh_store_file_checksum --file="$final_path/local/config/database.inc.php"

View file

@ -130,7 +130,7 @@ chown -R $app: /home/yunohost.app/$app
#=================================================
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=2
ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload
#=================================================

View file

@ -24,6 +24,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
admin_pwd=$(ynh_app_setting_get --app=$app --key=admin_pwd)
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
#=================================================
# CHECK VERSION
@ -223,13 +224,7 @@ ynh_store_file_checksum --file="$final_path/local/config/config.inc.php"
# Make a backup of the original database config file if modified
ynh_backup_if_checksum_is_different --file="$final_path/local/config/database.inc.php"
# Setup database in local/config/database.inc.php
ynh_replace_string --match_string="__DBTOCHANGE__" --replace_string="$db_name" --target_file=../conf/database.inc.php
ynh_replace_string --match_string="__USERTOCHANGE__" --replace_string="$db_name" --target_file=../conf/database.inc.php
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
ynh_replace_string --match_string="__PASSTOCHANGE__" --replace_string="$db_pwd" --target_file=../conf/database.inc.php
cp ../conf/database.inc.php $final_path/local/config/database.inc.php
ynh_add_config --template="../conf/database.inc.php" --destination="$final_path/local/config/database.inc.php"
# Calculate and store the database config file checksum
ynh_store_file_checksum --file="$final_path/local/config/database.inc.php"