mirror of
https://github.com/YunoHost-Apps/paheko_ynh.git
synced 2024-09-03 19:56:22 +02:00
try also keep the file config.local.user.php
This commit is contained in:
parent
f7be51ecc1
commit
ca062df330
4 changed files with 21 additions and 11 deletions
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* NE PAS MODIFIER CE FICHIER. Il est regénéré automatiquement à chaque mise à jour de Yunohost
|
* NE PAS MODIFIER CE FICHIER. Il est regénéré automatiquement à chaque mise à jour de Yunohost
|
||||||
*
|
*
|
||||||
* Pour ajouter vos configurations personnalisées, rendez-vous dans le fichier config.local.user.php
|
* Pour ajouter vos configurations personnalisées, rendez-vous dans le fichier data/config.local.user.php
|
||||||
*/
|
*/
|
||||||
require '__INSTALL_DIR__/config.local.yunohost.php';
|
require '__INSTALL_DIR__/config.local.yunohost.php';
|
||||||
require '__INSTALL_DIR__/config.local.user.php';
|
require '__INSTALL_DIR__/data/config.local.user.php';
|
||||||
|
|
|
@ -50,7 +50,7 @@ ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key
|
||||||
# Install configuration files
|
# Install configuration files
|
||||||
ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php"
|
ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php"
|
||||||
ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php"
|
ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php"
|
||||||
ynh_add_config --template="config.local.user.php" --destination="$install_dir/config.local.user.php"
|
ynh_add_config --template="config.local.user.php" --destination="$install_dir/data/config.local.user.php"
|
||||||
|
|
||||||
# Permissions on files and directories
|
# Permissions on files and directories
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
|
@ -61,7 +61,7 @@ find "$install_dir/data" -type d -exec chmod 770 {} +
|
||||||
find "$install_dir/data" -type f -exec chmod 660 {} +
|
find "$install_dir/data" -type f -exec chmod 660 {} +
|
||||||
chmod 440 "$install_dir/config.local.php"
|
chmod 440 "$install_dir/config.local.php"
|
||||||
chmod 440 "$install_dir/config.local.yunohost.php"
|
chmod 440 "$install_dir/config.local.yunohost.php"
|
||||||
chmod 660 "$install_dir/config.local.user.php"
|
chmod 660 "$install_dir/data/config.local.user.php"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -26,7 +26,12 @@ find "$install_dir/data" -type d -exec chmod 770 {} +
|
||||||
find "$install_dir/data" -type f -exec chmod 660 {} +
|
find "$install_dir/data" -type f -exec chmod 660 {} +
|
||||||
chmod 440 "$install_dir/config.local.php"
|
chmod 440 "$install_dir/config.local.php"
|
||||||
chmod 440 "$install_dir/config.local.yunohost.php"
|
chmod 440 "$install_dir/config.local.yunohost.php"
|
||||||
|
|
||||||
|
if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh4; then
|
||||||
chmod 660 "$install_dir/config.local.user.php"
|
chmod 660 "$install_dir/config.local.user.php"
|
||||||
|
else
|
||||||
|
chmod 660 "$install_dir/data/config.local.user.php"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
|
|
|
@ -38,6 +38,10 @@ ynh_script_progression --message="Backup of the DB in temporary file...." --weig
|
||||||
tmp_data_backup=$(mktemp -d)
|
tmp_data_backup=$(mktemp -d)
|
||||||
rsync -a $install_dir/data/ $tmp_data_backup/
|
rsync -a $install_dir/data/ $tmp_data_backup/
|
||||||
|
|
||||||
|
if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh4; then
|
||||||
|
mv $install_dir/config.local.user.php $tmp_data_backup/
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -47,7 +51,7 @@ then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=5
|
ynh_script_progression --message="Upgrading source files..." --weight=5
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$install_dir" --keep="config.local.user.php" --full_replace=1
|
ynh_setup_source --dest_dir="$install_dir" --full_replace=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
|
@ -77,11 +81,8 @@ ynh_add_nginx_config
|
||||||
ynh_script_progression --message="Updating a configuration file..." --weight=5
|
ynh_script_progression --message="Updating a configuration file..." --weight=5
|
||||||
|
|
||||||
if ynh_compare_current_package_version --comparison lt --version 1.1.15~ynh1; then
|
if ynh_compare_current_package_version --comparison lt --version 1.1.15~ynh1; then
|
||||||
chmod 750 "$install_dir/config.local.user.php"
|
chmod 750 "$install_dir/data/config.local.user.php"
|
||||||
ynh_add_config --template="config.local.user.php" --destination="$install_dir/config.local.user.php"
|
ynh_add_config --template="config.local.user.php" --destination="$install_dir/data/config.local.user.php"
|
||||||
fi
|
|
||||||
if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh3; then
|
|
||||||
ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/config.local.user.php"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# NOTE: Don't overwrite config.local.user.php
|
# NOTE: Don't overwrite config.local.user.php
|
||||||
|
@ -96,6 +97,10 @@ ynh_script_progression --message="Restore datas..." --weight=5
|
||||||
# Sync data directory backup
|
# Sync data directory backup
|
||||||
rsync -a $tmp_data_backup/ $install_dir/data/
|
rsync -a $tmp_data_backup/ $install_dir/data/
|
||||||
|
|
||||||
|
if ynh_compare_current_package_version --comparison le --version 1.2.11~ynh4; then
|
||||||
|
ynh_replace_string --match_string="namespace Garradin;" --replace_string="namespace Paheko;" --target_file="$install_dir/data/config.local.user.php"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# FIX PERMISSIONS
|
# FIX PERMISSIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -110,7 +115,7 @@ find "$install_dir/data" -type d -exec chmod 770 {} +
|
||||||
find "$install_dir/data" -type f -exec chmod 660 {} +
|
find "$install_dir/data" -type f -exec chmod 660 {} +
|
||||||
chmod 440 "$install_dir/config.local.php"
|
chmod 440 "$install_dir/config.local.php"
|
||||||
chmod 440 "$install_dir/config.local.yunohost.php"
|
chmod 440 "$install_dir/config.local.yunohost.php"
|
||||||
chmod 660 "$install_dir/config.local.user.php"
|
chmod 660 "$install_dir/data/config.local.user.php"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# FINALISE UPGRADE
|
# FINALISE UPGRADE
|
||||||
|
|
Loading…
Add table
Reference in a new issue