1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tiki_ynh.git synced 2024-09-04 01:15:54 +02:00
This commit is contained in:
Éric Gaspar 2024-06-24 11:06:10 +02:00
parent 7eee6be3aa
commit ec128d2008
5 changed files with 10 additions and 56 deletions

View file

@ -19,15 +19,11 @@ ynh_backup "$install_dir"
ynh_backup "$data_dir" ynh_backup "$data_dir"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf" ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf"
#================================================= #=================================================

View file

@ -5,18 +5,6 @@ source /usr/share/yunohost/helpers
ynh_app_setting_set --key=php_upload_max_filesize --value=256M ynh_app_setting_set --key=php_upload_max_filesize --value=256M
# REMOVEME ? Everything about fpm_footprint is removed in helpers2.1... | fpm_footprint="low"
# REMOVEME ? Everything about fpm_free_footprint is removed in helpers2.1... | fpm_free_footprint=0
# REMOVEME ? Everything about fpm_usage is removed in helpers2.1... | fpm_usage="low"
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
# REMOVEME ? Everything about fpm_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value=$fpm_footprint
# REMOVEME ? Everything about fpm_free_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_free_footprint --value=$fpm_free_footprint
# REMOVEME ? Everything about fpm_usage is removed in helpers2.1... | ynh_app_setting_set --key=fpm_usage --value=$fpm_usage
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -39,10 +27,8 @@ chown -R $app:www-data "$install_dir"
#================================================= #=================================================
ynh_script_progression "Configuring NGINX web server..." ynh_script_progression "Configuring NGINX web server..."
# Create a dedicated NGINX config
ynh_config_add_nginx ynh_config_add_nginx
# Create a dedicated PHP-FPM config
ynh_config_add_phpfpm ynh_config_add_phpfpm
#================================================= #=================================================

View file

@ -8,13 +8,10 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression "Removing system configurations related to $app..." ynh_script_progression "Removing system configurations related to $app..."
# Remove the app-specific logrotate config
ynh_config_remove_logrotate ynh_config_remove_logrotate
# Remove the dedicated NGINX config
ynh_config_remove_nginx ynh_config_remove_nginx
# Remove the dedicated PHP-FPM config
ynh_config_remove_phpfpm ynh_config_remove_phpfpm
#================================================= #=================================================

View file

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers

View file

@ -10,24 +10,6 @@ ynh_app_setting_set_default --key=php_upload_max_filesize --value=256M
#================================================= #=================================================
ynh_script_progression "Ensuring downward compatibility..." ynh_script_progression "Ensuring downward compatibility..."
# If fpm_footprint doesn't exist, create it
if [ -z "${fpm_footprint:-}" ]; then
fpm_footprint=low
# REMOVEME ? Everything about fpm_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value=$fpm_footprint
fi
# If fpm_free_footprint doesn't exist, create it
if [ -z "${fpm_free_footprint:-}" ]; then
fpm_free_footprint=0
# REMOVEME ? Everything about fpm_free_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_free_footprint --value=$fpm_free_footprint
fi
# If fpm_usage doesn't exist, create it
if [ -z "${fpm_usage:-}" ]; then
fpm_usage=low
# REMOVEME ? Everything about fpm_usage is removed in helpers2.1... | ynh_app_setting_set --key=fpm_usage --value=$fpm_usage
fi
# If release_cycle doesn't exist, create it # If release_cycle doesn't exist, create it
# FIXME: maybe replace with: ynh_app_setting_set_default --key=release_cycle --value=longterm # FIXME: maybe replace with: ynh_app_setting_set_default --key=release_cycle --value=longterm
if [ -z "${release_cycle:-}" ]; then if [ -z "${release_cycle:-}" ]; then
@ -38,21 +20,17 @@ fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression "Upgrading source files..."
if ynh_app_upstream_version_changed # Download, check integrity, uncompress and patch the source from app.src
source_id_to_use="main"
if [[ "$release_cycle" == "longterm" ]]
then then
ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
source_id_to_use="main"
if [[ "$release_cycle" == "longterm" ]]
then
source_id_to_use="lts" source_id_to_use="lts"
fi
ynh_setup_source --dest_dir="$install_dir" --source_id="$source_id_to_use"
fi fi
ynh_setup_source --dest_dir="$install_dir" --source_id="$source_id_to_use"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
@ -60,14 +38,12 @@ chown -R $app:www-data "$install_dir"
(cd "$install_dir" && ynh_exec_as_app php${php_version} --define apc.enable_cli=1 console.php database:update) (cd "$install_dir" && ynh_exec_as_app php${php_version} --define apc.enable_cli=1 console.php database:update)
#================================================= #=================================================
# NGINX CONFIGURATION # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression "Upgrading NGINX web server configuration..." ynh_script_progression "Upgrading system configurations related to $app..."
# Create a dedicated NGINX config
ynh_config_add_nginx ynh_config_add_nginx
# Create a dedicated PHP-FPM config
ynh_config_add_phpfpm ynh_config_add_phpfpm
#================================================= #=================================================