From 993807bced41d7932f207cb39e207b7e979d1855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Feb 2023 21:57:45 +0100 Subject: [PATCH] cleaning --- conf/extra_php-fpm.conf | 2 +- conf/nextcloud.cron | 2 +- scripts/_common.sh | 2 ++ scripts/install | 2 +- scripts/restore | 6 +++--- scripts/upgrade | 20 ++++++++++---------- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf index 5657e27..4e9d349 100644 --- a/conf/extra_php-fpm.conf +++ b/conf/extra_php-fpm.conf @@ -10,7 +10,7 @@ php_value[default_charset] = UTF-8 ; The following parameters are nevertheless recommended for Nextcloud ; see here: https://docs.nextcloud.com/server/15/admin_manual/installation/server_tuning.html#enable-php-opcache php_value[opcache.enable_cli]=1 -php_value[opcache.interned_strings_buffer]=16 +php_value[opcache.interned_strings_buffer]=32 php_value[opcache.max_accelerated_files]=10000 php_value[opcache.memory_consumption]=128 php_value[opcache.save_comments]=1 diff --git a/conf/nextcloud.cron b/conf/nextcloud.cron index c2a825c..31bfe2f 100644 --- a/conf/nextcloud.cron +++ b/conf/nextcloud.cron @@ -1 +1 @@ -*/15 * * * * __APP__ /usr/bin/php__PHPVERSION__ --define apc.enable_cli=1 -f __INSTALL_DIR__/cron.php +*/5 * * * * __APP__ /usr/bin/php__PHPVERSION__ --define apc.enable_cli=1 -f __INSTALL_DIR__/cron.php diff --git a/scripts/_common.sh b/scripts/_common.sh index 225eaa9..f90cf7b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,6 +4,8 @@ # COMMON VARIABLES #================================================= +YNH_PHP_VERSION="8.1" + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index a36dc11..c3a77f8 100755 --- a/scripts/install +++ b/scripts/install @@ -72,7 +72,7 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Check if .well-known is available for this domain if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" then - ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." + ynh_print_warn --message="Another app already uses the domain $domain to serve a CalDAV/CardDAV feature. You may encounter issues when dealing with your calendar or address book." # Remove lines about .well-known/carddav and caldav with sed. sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "../conf/nginx.conf" diff --git a/scripts/restore b/scripts/restore index 79712c7..a9c6b3a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -53,9 +53,9 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" # Check if .well-known is available for this domain if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" then - ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." + ynh_print_warn --message="Another app already uses the domain $domain to serve a CalDAV/CardDAV feature. You may encounter issues when dealing with your calendar or address book." - # Remove lines about .well-known/carddav and caldav with sed. + # Remove lines about .well-known/CardDAV and CalDAV with sed. sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "/etc/nginx/conf.d/$domain.d/$app.conf" fi @@ -123,7 +123,7 @@ ynh_script_progression --message="Restoring the Fail2Ban configuration..." --wei ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" -# Make sure a log file exists (mostly for CI tests) +# Make sure a log file exists (mostly for CI tests) logfile="/home/yunohost.app/$app/data/nextcloud.log" if [ ! -f "$logfile" ]; then touch "$logfile" diff --git a/scripts/upgrade b/scripts/upgrade index d7b8c9e..9fc6a5e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -59,9 +59,9 @@ fi # Create a permission if needed -if ! ynh_permission_exists --permission="api"; then - ynh_permission_create --permission="api" --label="api" --url="re:$domain\/.well-known\/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true" -fi +#if ! ynh_permission_exists --permission="api"; then +# ynh_permission_create --permission="api" --label="api" --url="re:$domain\/.well-known\/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true" +#fi # Delete existing ini configuration file (backward compatibility) if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then @@ -71,7 +71,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=30 +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=30 # Made a backup only after the version 11.0.0 # Before, the datas will be always saved. @@ -86,14 +86,14 @@ then ynh_app_setting_set --app=$app --key=backup_core_only --value=1 # Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade + ynh_backup_before_upgrade # Remove the option backup_core_only after the backup. ynh_app_setting_delete $app backup_core_only -#REMOVEME? ynh_clean_setup () { + ynh_clean_setup () { # restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup + ynh_restore_upgradebackup } fi @@ -130,7 +130,7 @@ ynh_systemd_action --service_name=nginx --action=reload --line_match="Reloaded" # Check if .well-known is available for this domain if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" then - ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." + ynh_print_warn --message="Another app already uses the domain $domain to serve a CalDAV/CardDAV feature. You may encounter issues when dealing with your calendar or address book." # Remove lines about .well-known/carddav and caldav with sed. sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "../conf/nginx.conf" @@ -174,7 +174,7 @@ local mount_id=$(exec_occ files_external:create --output=json \ || exec_occ files_external:option "$mount_id" enable_sharing true } # Define app's data directory -#REMOVEME? data_dir="/home/yunohost.app/$app/data" +data_dir="/home/yunohost.app/$app/data" if [ "$upgrade_type" == "UPGRADE_APP" ] then @@ -266,7 +266,7 @@ EOF done ) - # Replace the old nextcloud by the new one + # Replace the old Nextcloud by the new one ynh_secure_remove --file="$install_dir" mv "$tmpdir" "$install_dir" ynh_secure_remove --file="$tmpdir"