From 2593778a5a299df5a40adcbad5df4a59cb3b5e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 11 Aug 2024 09:16:54 +0200 Subject: [PATCH] cleaning --- manifest.toml | 25 +++++++++++-------------- scripts/backup | 12 +----------- scripts/install | 10 ++++------ scripts/remove | 2 -- scripts/restore | 10 ++++------ scripts/upgrade | 9 ++++----- 6 files changed, 24 insertions(+), 44 deletions(-) diff --git a/manifest.toml b/manifest.toml index 737ad51..7c032ed 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,7 @@ admindoc = "https://wiki.z-hub.io/display/ZP/Documentation" code = "https://github.com/Z-Hub/Z-Push" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.20" architectures = "all" multi_instance = true @@ -47,21 +47,18 @@ ram.runtime = "50M" [resources.permissions] main.url = "/" - main.allowed = "visitors" # should it always be public ? - - # FIXME: watdo with this ... - #REMOVEME? ynh_permission_create --permission="autodiscover" --url="re:$domain_regex/[Aa]uto[Dd]iscover/.*" --allowed="visitors" --show_tile="false" --protected="true" + main.allowed = "visitors" [resources.apt] packages = [ - "php7.4-soap", - "php7.4-imap", - "php7.4-xsl", - "php7.4-curl", - "php7.4-xml", - "php7.4-ldap", - "php7.4-cli", - "php7.4-mbstring", - "php7.4-memcached", + "php8.3-soap", + "php8.3-imap", + "php8.3-xsl", + "php8.3-curl", + "php8.3-xml", + "php8.3-ldap", + "php8.3-cli", + "php8.3-mbstring", + "php8.3-memcached", "libawl-php", ] diff --git a/scripts/backup b/scripts/backup index b0b2b76..b7bf856 100755 --- a/scripts/backup +++ b/scripts/backup @@ -28,23 +28,13 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="$data_dir" --is_big #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= - ynh_backup --src_path="/etc/logrotate.d/$app" #================================================= diff --git a/scripts/install b/scripts/install index 8ae9a48..3fc9fd3 100755 --- a/scripts/install +++ b/scripts/install @@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers path="/Microsoft-Server-ActiveSync" timezone="$(cat /etc/timezone)" -log_dir="/var/log/$app/" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -42,10 +41,10 @@ ynh_add_fpm_config # Create a dedicated NGINX config ynh_add_nginx_config -mkdir -p $log_dir -chmod 750 "$log_dir" -chmod -R o-rwx "$log_dir" -chown -R $app:www-data "$log_dir" +mkdir -p "/var/log/$app/" +chmod 750 "/var/log/$app/" +chmod -R o-rwx "/var/log/$app/" +chown -R $app:www-data "/var/log/$app/" ynh_use_logrotate @@ -119,7 +118,6 @@ ynh_add_config --template="backend/config-searchldap.php" --destination="$instal #Copy XMLElement.php ln -s /usr/share/awl/inc/XML* /var/www/$app/include/ - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 6822235..1387cb0 100755 --- a/scripts/remove +++ b/scripts/remove @@ -25,8 +25,6 @@ ynh_remove_nginx_config # Remove the dedicated PHP-FPM config ynh_remove_fpm_config -ynh_secure_remove --file="$log_dir" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 6e26b08..9982843 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,8 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -log_dir="/var/log/$app/" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -42,10 +40,10 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/logrotate.d/$app" -mkdir -p $log_dir -chmod 750 "$log_dir" -chmod -R o-rwx "$log_dir" -chown -R $app:www-data "$log_dir" +mkdir -p "/var/log/$app/" +chmod 750 "/var/log/$app/" +chmod -R o-rwx "/var/log/$app/" +chown -R $app:www-data "/var/log/$app/" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 1de9596..e33c549 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,7 +16,6 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) timezone="$(cat /etc/timezone)" -log_dir="/var/log/$app/" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -67,10 +66,10 @@ ynh_add_fpm_config # Create a dedicated NGINX config ynh_add_nginx_config -mkdir -p $log_dir -chmod 750 "$log_dir" -chmod -R o-rwx "$log_dir" -chown -R $app:www-data "$log_dir" +mkdir -p "/var/log/$app/" +chmod 750 "/var/log/$app/" +chmod -R o-rwx "/var/log/$app/" +chown -R $app:www-data "/var/log/$app/" ynh_use_logrotate --non-append