From a3a9c82f00e7506968d31303d64ab71f0282ce8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 23 Jun 2024 14:36:26 +0200 Subject: [PATCH 1/2] Update READMEs --- ALL_README.md | 1 + README_es.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 2 +- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 README_es.md diff --git a/ALL_README.md b/ALL_README.md index a01b345..152f2e7 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,6 +1,7 @@ # All available README files by language - [Read the README in English](README.md) +- [Lea el README en español](README_es.md) - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..5171ce6 --- /dev/null +++ b/README_es.md @@ -0,0 +1,47 @@ + + +# squid3 para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/squid3.svg)](https://dash.yunohost.org/appci/app/squid3) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/squid3.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/squid3.maintain.svg) + +[![Instalar squid3 con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=squid3) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarsquid3 rapidamente y simplement en un servidor YunoHost.* +> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.* + +## Descripción general + +## Squid: Proxy with Optimising Web Delivery + +Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. + +## Special Thanks + +Thanks to **Fred** to write the instruction to configure Squid for YunoHost. French: + + +**Versión actual:** 4.13~ynh3 +## Documentaciones y recursos + +- Sitio web oficial: +- Catálogo YunoHost: +- Reportar un error: + +## Información para desarrolladores + +Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/squid3_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/squid3_ynh/tree/testing --debug +o +sudo yunohost app upgrade squid3 -u https://github.com/YunoHost-Apps/squid3_ynh/tree/testing --debug +``` + +**Mas informaciones sobre el empaquetado de aplicaciones:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index d771bd8..9366e11 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -3,7 +3,7 @@ 请勿手动编辑。 --> -# YunoHost 的 squid3 +# YunoHost 上的 squid3 [![集成程度](https://dash.yunohost.org/integration/squid3.svg)](https://dash.yunohost.org/appci/app/squid3) ![工作状态](https://ci-apps.yunohost.org/ci/badges/squid3.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/squid3.maintain.svg) From a336358355708ba713a127e5134cda548f900858 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sat, 31 Aug 2024 03:03:06 +0200 Subject: [PATCH 2/2] [autopatch] Automatic patch attempt for helpers 2.1 --- manifest.toml | 3 ++- scripts/_common.sh | 14 +------------- scripts/backup | 12 +++--------- scripts/install | 18 ++++++------------ scripts/remove | 16 +++++----------- scripts/restore | 20 +++++++------------- scripts/upgrade | 30 +++++++++++------------------- 7 files changed, 35 insertions(+), 78 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8672690..9381e19 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,8 @@ website = "http://www.squid-cache.org" cpe = "cpe:2.3:a:squid-cache:squid" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = false ldap = true diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..3d7f008 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,17 +1,5 @@ #!/bin/bash #================================================= -# COMMON VARIABLES -#================================================= - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 67eb21c..8fbdb12 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -14,12 +8,12 @@ source /usr/share/yunohost/helpers # BACKUP VARIOUS FILES #================================================= -ynh_backup --src_path="/etc/squid/squid.conf" +ynh_backup "/etc/squid/squid.conf" -ynh_backup --src_path="/var/log/squid" +ynh_backup "/var/log/squid" #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/install b/scripts/install index 7fe5059..8c5b7e7 100755 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -14,27 +8,27 @@ source /usr/share/yunohost/helpers #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." -ynh_add_config --template="squid.conf" --destination="/etc/squid/squid.conf" +ynh_config_add --template="squid.conf" --destination="/etc/squid/squid.conf" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 +ynh_script_progression "Adding system configurations related to $app..." yunohost service add "squid" --description "Squid3 a web proxy service" --log="/var/log/squid/access.log" --needs_exposed_ports "$port" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression "Starting $app's systemd service..." # Start a systemd service -ynh_systemd_action --service_name="squid" --action="restart" --log_path="/var/log/squid/cache.log" +ynh_systemctl --service="squid" --action="restart" --log_path="/var/log/squid/cache.log" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 4e7078f..21736bd 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,21 +1,15 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 +ynh_script_progression "Removing system configurations related to $app..." # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status "squid" >/dev/null; then +if ynh_hide_warnings yunohost service status "squid" >/dev/null; then yunohost service remove "squid" fi @@ -24,13 +18,13 @@ fi #================================================= # Remove a directory securely -ynh_secure_remove --file="/etc/squid/" +ynh_safe_rm "/etc/squid/" # Remove the log files -ynh_secure_remove --file="/var/log/squid" +ynh_safe_rm "/var/log/squid" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index a0907fa..faa3b0b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -13,28 +7,28 @@ source /usr/share/yunohost/helpers #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +ynh_script_progression "Adding $app's configuration..." -ynh_secure_remove --file="/etc/squid/squid.conf" -ynh_add_config --template="squid.conf" --destination="/etc/squid/squid.conf" +ynh_safe_rm "/etc/squid/squid.conf" +ynh_config_add --template="squid.conf" --destination="/etc/squid/squid.conf" #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 +ynh_script_progression "Restoring system configurations related to $app..." yunohost service add "squid" --description "Squid3 a web proxy service" --log="/var/log/squid/access.log" --needs_exposed_ports "$port" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression "Starting $app's systemd service..." # Start a systemd service -ynh_systemd_action --service_name="squid" --action="restart" --log_path="/var/log/squid/cache.log" +ynh_systemctl --service="squid" --action="restart" --log_path="/var/log/squid/cache.log" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 4eb33ad..6a5dd61 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,58 +1,50 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression "Ensuring downward compatibility..." if [[ -n "${squid:-}" ]]; then - ynh_app_setting_delete --app="$app" --key="squid" + ynh_app_setting_delete --key="squid" fi if [[ -n "${squid_name:-}" ]]; then - ynh_app_setting_delete --app="$app" --key="squid_name" + ynh_app_setting_delete --key="squid_name" fi -#================================================= -# STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name="squid" --action="stop" --log_path="/var/log/squid/cache.log" +ynh_systemctl --service="squid" --action="stop" --log_path="/var/log/squid/cache.log" #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." +ynh_script_progression "Updating configuration..." -ynh_add_config --template="squid.conf" --destination="/etc/squid/squid.conf" +ynh_config_add --template="squid.conf" --destination="/etc/squid/squid.conf" #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 +ynh_script_progression "Upgrading system configurations related to $app..." yunohost service add "squid" --description "Squid3 a web proxy service" --log="/var/log/squid/access.log" --needs_exposed_ports "$port" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name="squid" --action="restart" --log_path="/var/log/squid/cache.log" +ynh_systemctl --service="squid" --action="restart" --log_path="/var/log/squid/cache.log" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" +ynh_script_progression "Upgrade of $app completed"