mirror of
https://github.com/YunoHost-Apps/dolibarr_ynh.git
synced 2024-09-03 18:35:53 +02:00
Merge branch 'testing' of github.com:YunoHost-Apps/dolibarr_ynh into testing
This commit is contained in:
commit
20bdc3a145
5 changed files with 34 additions and 18 deletions
|
@ -27,7 +27,6 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
|
@ -53,7 +52,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Backing up php-fpm configuration..." --weight=1
|
ynh_print_info --message="Backing up php-fpm configuration..." --weight=1
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
ynh_backup --src_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
|
|
|
@ -84,8 +84,6 @@ ynh_setup_source --dest_dir="$final_path"
|
||||||
# Create necessary files
|
# Create necessary files
|
||||||
datadir=$final_path/documents
|
datadir=$final_path/documents
|
||||||
touch $final_path/htdocs/conf/conf.php
|
touch $final_path/htdocs/conf/conf.php
|
||||||
mkdir -p $datadir
|
|
||||||
chmod go-w $datadir
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
@ -240,10 +238,12 @@ ynh_store_file_checksum --file="$final_path/htdocs/conf/conf.php"
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions on app files
|
||||||
chown -R root: "$final_path"
|
chown -R root: "$final_path"
|
||||||
chown -R $app: "$datadir"
|
|
||||||
chmod 644 "$final_path/htdocs/conf/conf.php"
|
chmod 644 "$final_path/htdocs/conf/conf.php"
|
||||||
|
mkdir -p "$datadir"
|
||||||
|
chown -R $app: "$datadir"
|
||||||
|
chmod go-w $datadir
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP LOGROTATE
|
# SETUP LOGROTATE
|
||||||
|
@ -261,8 +261,7 @@ ynh_script_progression --message="Configuring SSOwat..." --weight=1
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
then
|
then
|
||||||
# unprotected_uris allows SSO credentials to be passed anyway.
|
ynh_permission_update --permission "main" --add "visitors"
|
||||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -56,6 +56,12 @@ ynh_script_progression --message="Removing php-fpm configuration..." --weight=1
|
||||||
# Remove the dedicated php-fpm config
|
# Remove the dedicated php-fpm config
|
||||||
ynh_remove_fpm_config
|
ynh_remove_fpm_config
|
||||||
|
|
||||||
|
# Delete old static pool.d conf
|
||||||
|
old_php_version=7.0
|
||||||
|
if [ -f /etc/php/$old_php_version/fpm/pool.d/$app.conf ]; then
|
||||||
|
ynh_secure_remove --file=/etc/php/$old_php_version/fpm/pool.d/$app.conf
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE LOGROTATE CONFIGURATION
|
# REMOVE LOGROTATE CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -29,7 +29,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
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_user=$db_name
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
datadir=$final_path/documents/
|
||||||
|
|
||||||
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
||||||
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
|
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
|
||||||
|
@ -79,7 +79,7 @@ chown -R root: $final_path
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Reconfiguring PHP-FPM..." --weight=50
|
ynh_print_info --message="Reconfiguring PHP-FPM..." --weight=50
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies"
|
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies"
|
||||||
|
|
||||||
|
@ -101,6 +101,17 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SECURE FILES AND DIRECTORIES
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Set permissions on app files
|
||||||
|
chown -R root: "$final_path"
|
||||||
|
chmod 644 "$final_path/htdocs/conf/conf.php"
|
||||||
|
mkdir -p "$datadir"
|
||||||
|
chown -R $app: "$datadir"
|
||||||
|
chmod go-w $datadir
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -108,7 +119,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=1
|
ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
ynh_systemd_action --service_name=php$YNH_PHP_VERSION-fpm --action=reload
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -25,7 +25,7 @@ language=$(ynh_app_setting_get --app=$app --key=language)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
current_version=$(ynh_app_setting_get --app=$app --key=version)
|
current_version=$(ynh_app_setting_get --app=$app --key=version)
|
||||||
update_version=$(ynh_app_upstream_version "../manifest.json")
|
update_version=$(ynh_app_upstream_version "../manifest.json")
|
||||||
datadir=$final_path/documents
|
datadir=$final_path/documents/
|
||||||
|
|
||||||
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
||||||
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
|
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
|
||||||
|
@ -123,7 +123,7 @@ fi
|
||||||
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1
|
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config YNH_PHP_VERSION
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
|
@ -138,13 +138,15 @@ ynh_system_user_create --username=$app
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=2
|
ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=2
|
||||||
|
|
||||||
|
# Delete old static pool.d conf
|
||||||
|
old_php_version=7.0
|
||||||
|
if [ -f "/etc/php/$old_php_version/fpm/pool.d/$app.conf" ]; then
|
||||||
|
ynh_secure_remove --file="/etc/php/$old_php_version/fpm/pool.d/$app.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies"
|
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies"
|
||||||
|
|
||||||
# Delete existing ini configuration file (backward compatibility)
|
|
||||||
if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then
|
|
||||||
ynh_secure_remove --file=/etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
|
@ -213,7 +215,6 @@ ynh_use_logrotate --non-append
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions on app files
|
# Set permissions on app files
|
||||||
# Set permissions to app files
|
|
||||||
chown -R root: "$final_path"
|
chown -R root: "$final_path"
|
||||||
chmod 644 "$final_path/htdocs/conf/conf.php"
|
chmod 644 "$final_path/htdocs/conf/conf.php"
|
||||||
mkdir -p "$datadir"
|
mkdir -p "$datadir"
|
||||||
|
|
Loading…
Add table
Reference in a new issue