From e83c680c54f667f669079405c22c1559245a5489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 3 Aug 2024 09:49:44 +0200 Subject: [PATCH 1/3] minor typos --- scripts/_common.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 19c1859..4cdc018 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,8 +9,8 @@ #================================================= wait_nginx_reload() { - # Nginx may take some time to support the new configuration, - # wait for the nextcloud configuration file to disappear from nginx before checking the CalDAV/CardDAV URL. + # NGINX may take some time to support the new configuration, + # wait for the Nextcloud configuration file to disappear from NGINX before checking the CalDAV/CardDAV URL. timeout=30 for i in $(seq 1 $timeout); do if ! ynh_exec_warn_less nginx -T | grep --quiet "# configuration file /etc/nginx/conf.d/$domain.d/$app.conf:"; then @@ -18,7 +18,7 @@ wait_nginx_reload() { fi sleep 1 done - # Wait untils nginx has fully reloaded (avoid curl fail with http2) + # Wait untils NGINX has fully reloaded (avoid cURL fail with http2) sleep 2 } @@ -33,22 +33,22 @@ is_url_handled() { # Manage arguments with getopts ynh_handle_getopts_args "$@" - # Try to get the url with curl, and keep the http code and an eventual redirection url. + # Try to get the URL with cURL, and keep the http code and an eventual redirection URL. local curl_output="$(curl --insecure --silent --output /dev/null \ --write-out '%{http_code};%{redirect_url}' https://127.0.0.1$path --header "Host: $domain" --resolve $domain:443:127.0.0.1)" # Cut the output and keep only the first part to keep the http code local http_code="${curl_output%%;*}" - # Do the same thing but keep the second part, the redirection url + # Do the same thing but keep the second part, the redirection URL local redirection="${curl_output#*;}" - # Return 1 if the url isn't handled. - # Which means either curl got a 404 (or the admin) or the sso. - # A handled url should redirect to a publicly accessible url. - # Return 1 if the url has returned 404 + # Return 1 if the URL isn't handled. + # Which means either cURL got a 404 (or the admin) or the SSO. + # A handled URL should redirect to a publicly accessible URL. + # Return 1 if the URL has returned 404 if [ "$http_code" = "404" ] || [[ $redirection =~ "/yunohost/admin" ]]; then return 1 - # Return 1 if the url is redirected to the SSO + # Return 1 if the URL is redirected to the SSO elif [[ $redirection =~ "/yunohost/sso" ]]; then return 1 fi From a86e321c50f3c60e2c34842812b41b992277d2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 3 Aug 2024 09:52:05 +0200 Subject: [PATCH 2/3] Update backup --- scripts/backup | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/scripts/backup b/scripts/backup index da8f172..d56a518 100755 --- a/scripts/backup +++ b/scripts/backup @@ -28,42 +28,28 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="$data_dir" --is_big #================================================= -# BACKUP THE NGINX CONFIGURATION -#================================================= - -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION +# SYSTEM CONFIGURATION #================================================= +# Backup the PHP-FPM configuration ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= +# Backup the nginx configuration +ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +# Backup the logrotate configuration ynh_backup --src_path="/etc/logrotate.d/$app" -#================================================= -# BACKUP FAIL2BAN CONFIGURATION -#================================================= - +# Backup the Fail2Ban config ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" #================================================= -# BACKUP THE CRON FILE +# BACKUP VARIOUS FILES #================================================= ynh_backup --src_path="/etc/cron.d/$app" -#================================================= -# BACKUP LOGS -#================================================= - ynh_backup --src_path="/var/log/$app" #================================================= From 31fd6a50f4b127432b680c7630776259eacb230d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 3 Aug 2024 09:53:16 +0200 Subject: [PATCH 3/3] minor typos --- scripts/change_url | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index 8cadcea..2783932 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -48,7 +48,7 @@ then # Change hostname for activity notifications exec_occ config:system:set overwrite.cli.url --value="https://${new_domain}${new_path}" - # Reload php fpm, necessary for force nextcloud to re-read config.php, cf opcache.revalidate_freq + # Reload PHP-FPM, necessary for force Nextcloud to re-read config.php, cf opcache.revalidate_freq ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload fi