mirror of
https://github.com/YunoHost-Apps/squid3_ynh.git
synced 2024-09-03 20:26:11 +02:00
Merge pull request #13 from YunoHost-Apps/testing
Remove support for squid3
This commit is contained in:
commit
0b0e31f6e7
13 changed files with 37 additions and 59 deletions
|
@ -25,7 +25,7 @@ Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It r
|
||||||
Thanks to **Fred** to write the instruction to configure Squid for YunoHost. French: <https://memo-linux.com/installer-squid3-sur-un-serveur-yunohost/>
|
Thanks to **Fred** to write the instruction to configure Squid for YunoHost. French: <https://memo-linux.com/installer-squid3-sur-un-serveur-yunohost/>
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 4.13~ynh2
|
**Shipped version:** 4.13~ynh3
|
||||||
## Documentation and resources
|
## Documentation and resources
|
||||||
|
|
||||||
- Official app website: <http://www.squid-cache.org>
|
- Official app website: <http://www.squid-cache.org>
|
||||||
|
|
|
@ -25,7 +25,7 @@ Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It r
|
||||||
Thanks to **Fred** to write the instruction to configure Squid for YunoHost. French: <https://memo-linux.com/installer-squid3-sur-un-serveur-yunohost/>
|
Thanks to **Fred** to write the instruction to configure Squid for YunoHost. French: <https://memo-linux.com/installer-squid3-sur-un-serveur-yunohost/>
|
||||||
|
|
||||||
|
|
||||||
**Paketatutako bertsioa:** 4.13~ynh2
|
**Paketatutako bertsioa:** 4.13~ynh3
|
||||||
## Dokumentazioa eta baliabideak
|
## Dokumentazioa eta baliabideak
|
||||||
|
|
||||||
- Aplikazioaren webgune ofiziala: <http://www.squid-cache.org>
|
- Aplikazioaren webgune ofiziala: <http://www.squid-cache.org>
|
||||||
|
|
|
@ -25,7 +25,7 @@ Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It r
|
||||||
Thanks to **Fred** to write the instruction to configure Squid for YunoHost. French: <https://memo-linux.com/installer-squid3-sur-un-serveur-yunohost/>
|
Thanks to **Fred** to write the instruction to configure Squid for YunoHost. French: <https://memo-linux.com/installer-squid3-sur-un-serveur-yunohost/>
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 4.13~ynh2
|
**Version incluse :** 4.13~ynh3
|
||||||
## Documentations et ressources
|
## Documentations et ressources
|
||||||
|
|
||||||
- Site officiel de l’app : <http://www.squid-cache.org>
|
- Site officiel de l’app : <http://www.squid-cache.org>
|
||||||
|
|
|
@ -25,7 +25,7 @@ Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It r
|
||||||
Thanks to **Fred** to write the instruction to configure Squid for YunoHost. French: <https://memo-linux.com/installer-squid3-sur-un-serveur-yunohost/>
|
Thanks to **Fred** to write the instruction to configure Squid for YunoHost. French: <https://memo-linux.com/installer-squid3-sur-un-serveur-yunohost/>
|
||||||
|
|
||||||
|
|
||||||
**Versión proporcionada:** 4.13~ynh2
|
**Versión proporcionada:** 4.13~ynh3
|
||||||
## Documentación e recursos
|
## Documentación e recursos
|
||||||
|
|
||||||
- Web oficial da app: <http://www.squid-cache.org>
|
- Web oficial da app: <http://www.squid-cache.org>
|
||||||
|
|
|
@ -25,7 +25,7 @@ Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It r
|
||||||
Thanks to **Fred** to write the instruction to configure Squid for YunoHost. French: <https://memo-linux.com/installer-squid3-sur-un-serveur-yunohost/>
|
Thanks to **Fred** to write the instruction to configure Squid for YunoHost. French: <https://memo-linux.com/installer-squid3-sur-un-serveur-yunohost/>
|
||||||
|
|
||||||
|
|
||||||
**分发版本:** 4.13~ynh2
|
**分发版本:** 4.13~ynh3
|
||||||
## 文档与资源
|
## 文档与资源
|
||||||
|
|
||||||
- 官方应用网站: <http://www.squid-cache.org>
|
- 官方应用网站: <http://www.squid-cache.org>
|
||||||
|
|
|
@ -21,7 +21,7 @@ acl purge method PURGE
|
||||||
acl CONNECT method CONNECT
|
acl CONNECT method CONNECT
|
||||||
|
|
||||||
###Directive pour n’autoriser que les comptes enregistrés dans le LDAP de Yunohost
|
###Directive pour n’autoriser que les comptes enregistrés dans le LDAP de Yunohost
|
||||||
auth_param basic program /usr/lib/__SQUID_NAME__/basic_ldap_auth -b dc=yunohost,dc=org -h 127.0.0.1 -f "uid=%s"
|
auth_param basic program /usr/lib/squid/basic_ldap_auth -b dc=yunohost,dc=org -h 127.0.0.1 -f "uid=%s"
|
||||||
|
|
||||||
auth_param basic children 50
|
auth_param basic children 50
|
||||||
auth_param basic realm Web-Proxy
|
auth_param basic realm Web-Proxy
|
||||||
|
@ -44,9 +44,9 @@ dns_nameservers 127.0.0.1
|
||||||
##Port d'écoute du Proxy
|
##Port d'écoute du Proxy
|
||||||
http_port __PORT__
|
http_port __PORT__
|
||||||
forwarded_for off ### mode transparant, la vrai IP est cachée
|
forwarded_for off ### mode transparant, la vrai IP est cachée
|
||||||
cache_dir aufs /var/spool/__SQUID_NAME__ 10000 16 256
|
cache_dir aufs /var/spool/squid 10000 16 256
|
||||||
hierarchy_stoplist cgi-bin ?
|
hierarchy_stoplist cgi-bin ?
|
||||||
access_log /var/log/__SQUID_NAME__/access.log squid
|
access_log /var/log/squid/access.log squid
|
||||||
refresh_pattern ^ftp: 1440 20% 10080
|
refresh_pattern ^ftp: 1440 20% 10080
|
||||||
refresh_pattern ^gopher: 1440 0% 1440
|
refresh_pattern ^gopher: 1440 0% 1440
|
||||||
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
|
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
|
||||||
|
|
|
@ -7,7 +7,7 @@ name = "squid3"
|
||||||
description.en = "Caching proxy for the Web supporting HTTP, HTTPS, FTP and more."
|
description.en = "Caching proxy for the Web supporting HTTP, HTTPS, FTP and more."
|
||||||
description.fr = "Proxy cache pour le web, compatible HTTP, HTTPS, FTP et plus encore."
|
description.fr = "Proxy cache pour le web, compatible HTTP, HTTPS, FTP et plus encore."
|
||||||
|
|
||||||
version = "4.13~ynh2"
|
version = "4.13~ynh3"
|
||||||
|
|
||||||
maintainers = ["Anmol Sharma"]
|
maintainers = ["Anmol Sharma"]
|
||||||
|
|
||||||
|
@ -40,4 +40,12 @@ ram.runtime = "50M"
|
||||||
main.exposed = "TCP"
|
main.exposed = "TCP"
|
||||||
|
|
||||||
[resources.apt]
|
[resources.apt]
|
||||||
packages = ["squid3", "mailutils"]
|
packages = ["mailutils"]
|
||||||
|
|
||||||
|
packages_from_raw_bash = """
|
||||||
|
if [[ $YNH_DEBIAN_VERSION == "bullseye" ]]; then
|
||||||
|
echo "squid3";
|
||||||
|
elif [[ $YNH_DEBIAN_VERSION == "bookworm" ]]; then
|
||||||
|
echo "squid";
|
||||||
|
fi
|
||||||
|
"""
|
||||||
|
|
|
@ -8,23 +8,6 @@
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
find_squid_version() {
|
|
||||||
# See if squid3 folder exits
|
|
||||||
if [ -d "/etc/squid3" ]; then
|
|
||||||
squid_name="squid3"
|
|
||||||
|
|
||||||
# If squid3 folder is not found look for squid folder
|
|
||||||
elif [ -d "/etc/squid" ]; then
|
|
||||||
squid_name="squid"
|
|
||||||
|
|
||||||
# If both folders are not found then call ynh_die
|
|
||||||
else
|
|
||||||
ynh_die --message="No squid folder found in /etc. Looks like squid3 package is not installed. Try installing it manually."
|
|
||||||
fi
|
|
||||||
|
|
||||||
ynh_app_setting_set --app="$app" --key="squid_name" --value="$squid_name"
|
|
||||||
}
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -14,9 +14,9 @@ source /usr/share/yunohost/helpers
|
||||||
# BACKUP VARIOUS FILES
|
# BACKUP VARIOUS FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/$squid_name/squid.conf"
|
ynh_backup --src_path="/etc/squid/squid.conf"
|
||||||
|
|
||||||
ynh_backup --src_path="/var/log/$squid_name"
|
ynh_backup --src_path="/var/log/squid"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -9,12 +9,6 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# INITIALIZE AND STORE SETTINGS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
find_squid_version
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# APP INITIAL CONFIGURATION
|
# APP INITIAL CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -22,14 +16,14 @@ find_squid_version
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||||
|
|
||||||
ynh_add_config --template="squid.conf" --destination="/etc/$squid_name/squid.conf"
|
ynh_add_config --template="squid.conf" --destination="/etc/squid/squid.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SYSTEM CONFIGURATION
|
# SYSTEM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
yunohost service add "$squid_name" --description "Squid3 a web proxy service" --log="/var/log/$squid_name/access.log" --needs_exposed_ports "$port"
|
yunohost service add "squid" --description "Squid3 a web proxy service" --log="/var/log/squid/access.log" --needs_exposed_ports "$port"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
@ -37,7 +31,7 @@ yunohost service add "$squid_name" --description "Squid3 a web proxy service" --
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name="$squid_name" --action="restart" --log_path="/var/log/$squid_name/cache.log"
|
ynh_systemd_action --service_name="squid" --action="restart" --log_path="/var/log/squid/cache.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -15,8 +15,8 @@ source /usr/share/yunohost/helpers
|
||||||
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
# 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_name" >/dev/null; then
|
if ynh_exec_warn_less yunohost service status "squid" >/dev/null; then
|
||||||
yunohost service remove "$squid_name"
|
yunohost service remove "squid"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -24,10 +24,10 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Remove a directory securely
|
# Remove a directory securely
|
||||||
ynh_secure_remove --file="/etc/$squid_name/"
|
ynh_secure_remove --file="/etc/squid/"
|
||||||
|
|
||||||
# Remove the log files
|
# Remove the log files
|
||||||
ynh_secure_remove --file="/var/log/$squid_name"
|
ynh_secure_remove --file="/var/log/squid"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -15,17 +15,15 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding a configuration file..."
|
ynh_script_progression --message="Adding a configuration file..."
|
||||||
|
|
||||||
find_squid_version
|
ynh_secure_remove --file="/etc/squid/squid.conf"
|
||||||
|
ynh_add_config --template="squid.conf" --destination="/etc/squid/squid.conf"
|
||||||
ynh_secure_remove --file="/etc/$squid_name/squid.conf"
|
|
||||||
ynh_add_config --template="squid.conf" --destination="/etc/$squid_name/squid.conf"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEM CONFIGURATIONS
|
# RESTORE SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
yunohost service add "$squid_name" --description "Squid3 a web proxy service" --log="/var/log/$squid_name/access.log" --needs_exposed_ports "$port"
|
yunohost service add "squid" --description "Squid3 a web proxy service" --log="/var/log/squid/access.log" --needs_exposed_ports "$port"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
@ -33,7 +31,7 @@ yunohost service add "$squid_name" --description "Squid3 a web proxy service" --
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name="$squid_name" --action="restart" --log_path="/var/log/$squid_name/cache.log"
|
ynh_systemd_action --service_name="squid" --action="restart" --log_path="/var/log/squid/cache.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -15,13 +15,10 @@ source /usr/share/yunohost/helpers
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||||
|
|
||||||
if [[ -n "${squid:-}" ]]; then
|
if [[ -n "${squid:-}" ]]; then
|
||||||
squid_name="$squid"
|
|
||||||
ynh_app_setting_set --app="$app" --key="squid_name" --value="$squid_name"
|
|
||||||
ynh_app_setting_delete --app="$app" --key="squid"
|
ynh_app_setting_delete --app="$app" --key="squid"
|
||||||
fi
|
fi
|
||||||
|
if [[ -n "${squid_name:-}" ]]; then
|
||||||
if [[ -z "${squid_name:-}" ]]; then
|
ynh_app_setting_delete --app="$app" --key="squid_name"
|
||||||
find_squid_version
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -31,30 +28,28 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a systemd service..."
|
ynh_script_progression --message="Stopping a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$squid_name" --action="stop" --log_path="/var/log/$squid_name/cache.log"
|
ynh_systemd_action --service_name="squid" --action="stop" --log_path="/var/log/squid/cache.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE A CONFIG FILE
|
# UPDATE A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating a configuration file..."
|
ynh_script_progression --message="Updating a configuration file..."
|
||||||
|
|
||||||
find_squid_version
|
ynh_add_config --template="squid.conf" --destination="/etc/squid/squid.conf"
|
||||||
|
|
||||||
ynh_add_config --template="squid.conf" --destination="/etc/$squid_name/squid.conf"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REAPPLY SYSTEM CONFIGURATIONS
|
# REAPPLY SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
yunohost service add "$squid_name" --description "Squid3 a web proxy service" --log="/var/log/$squid_name/access.log" --needs_exposed_ports "$port"
|
yunohost service add "squid" --description "Squid3 a web proxy service" --log="/var/log/squid/access.log" --needs_exposed_ports "$port"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$squid_name" --action="restart" --log_path="/var/log/$squid_name/cache.log"
|
ynh_systemd_action --service_name="squid" --action="restart" --log_path="/var/log/squid/cache.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
Loading…
Add table
Reference in a new issue