[debian-lan-devel] [debian-lan] 01/01: Switch from apt-cacher-ng to Squid as package cache.
Andreas B. Mundt
andi at alioth.debian.org
Fri Oct 18 18:30:26 UTC 2013
This is an automated email from the git hooks/post-receive script.
andi pushed a commit to branch master
in repository debian-lan.
commit 9f5be15c350c9fe8dc7031168364f2b26dac4927
Author: Andreas B. Mundt <andi at debian.org>
Date: Thu Oct 17 16:59:50 2013 +0200
Switch from apt-cacher-ng to Squid as package cache.
As apt-cacher-ng does not work reliably, it is replaced by Squid with
a customized configuration. The configuration modifications are
inspired by the configuration shiped with the squid-deb-proxy package.
<URL:http://sources.debian.net/src/squid-deb-proxy>
---
fai/config/files/etc/apt/apt.conf/CLIENT_A | 2 +-
fai/config/files/etc/fai/apt/sources.list/SERVER_A | 8 +++---
fai/config/files/etc/fai/nfsroot.conf/SERVER_A | 2 +-
fai/config/files/etc/rc.local/FAISERVER | 1 +
fai/config/files/var/www/index.html/GOSA | 2 --
fai/config/package_config/FAISERVER | 1 -
fai/config/scripts/FIREWALL/10-config | 5 ----
fai/config/scripts/GATEWAY_A/10-misc | 2 +-
fai/config/scripts/PROXY/10-config | 28 +++++++++++++++++++-
fai/config/scripts/SERVER_A/10-misc | 2 +-
10 files changed, 36 insertions(+), 17 deletions(-)
diff --git a/fai/config/files/etc/apt/apt.conf/CLIENT_A b/fai/config/files/etc/apt/apt.conf/CLIENT_A
index f1175e0..403cc54 100644
--- a/fai/config/files/etc/apt/apt.conf/CLIENT_A
+++ b/fai/config/files/etc/apt/apt.conf/CLIENT_A
@@ -1 +1 @@
-Acquire::http::Proxy "http://aptcache.intern:3142/";
+Acquire::http::Proxy "http://aptcache.intern:3128/";
diff --git a/fai/config/files/etc/fai/apt/sources.list/SERVER_A b/fai/config/files/etc/fai/apt/sources.list/SERVER_A
index e2360e4..f64802e 100644
--- a/fai/config/files/etc/fai/apt/sources.list/SERVER_A
+++ b/fai/config/files/etc/fai/apt/sources.list/SERVER_A
@@ -1,6 +1,6 @@
-deb http://aptcache.intern:3142/http.debian.net/debian/ wheezy main
-deb http://aptcache.intern:3142/security.debian.org/ stable/updates main
-deb http://aptcache.intern:3142/http.debian.net/debian/ wheezy-updates main
+deb http://http.debian.net/debian/ wheezy main
+deb http://security.debian.org/ stable/updates main
+deb http://http.debian.net/debian/ wheezy-updates main
## Backports repository:
-deb http://aptcache.intern:3142/http.debian.net/debian/ wheezy-backports main
+deb http://http.debian.net/debian/ wheezy-backports main
diff --git a/fai/config/files/etc/fai/nfsroot.conf/SERVER_A b/fai/config/files/etc/fai/nfsroot.conf/SERVER_A
index e46a35e..d999683 100644
--- a/fai/config/files/etc/fai/nfsroot.conf/SERVER_A
+++ b/fai/config/files/etc/fai/nfsroot.conf/SERVER_A
@@ -10,4 +10,4 @@ FAI_DEBOOTSTRAP_OPTS="--exclude=info"
# Configuration space
FAI_CONFIGDIR=/srv/fai/config
-FAI_DEBOOTSTRAP="wheezy http://aptcache:3142/http.debian.net/debian"
+FAI_DEBOOTSTRAP="wheezy http://http.debian.net/debian"
diff --git a/fai/config/files/etc/rc.local/FAISERVER b/fai/config/files/etc/rc.local/FAISERVER
index bc939df..51d7f4d 100755
--- a/fai/config/files/etc/rc.local/FAISERVER
+++ b/fai/config/files/etc/rc.local/FAISERVER
@@ -4,6 +4,7 @@
set -e
umask 0022
+export http_proxy="http://aptcache:3128"
############################
TIMEOUT=120
diff --git a/fai/config/files/var/www/index.html/GOSA b/fai/config/files/var/www/index.html/GOSA
index 0a5f452..96e33ab 100644
--- a/fai/config/files/var/www/index.html/GOSA
+++ b/fai/config/files/var/www/index.html/GOSA
@@ -10,8 +10,6 @@
<ul>
<li><a href="https://www.intern/gosa">GOsa System Administration</a></li>
<li><a href="https://print.intern:631">CUPS Print-Server Administration</a></li>
-<li><a href="http://aptcache.intern:3142/acng-report.html">Apt-Cacher-NG
- Maintenance</a></li>
<li><a href="https://syslog.intern/icinga">ICINGA System Monitoring</a></li>
<li><a href="https://syslog.intern/munin">Munin System Monitoring</a></li>
</ul>
diff --git a/fai/config/package_config/FAISERVER b/fai/config/package_config/FAISERVER
index f917bca..07ce5b2 100644
--- a/fai/config/package_config/FAISERVER
+++ b/fai/config/package_config/FAISERVER
@@ -8,7 +8,6 @@ genisoimage grub-pc
lftp
syslinux-common
-apt-cacher-ng
whois
git
diff --git a/fai/config/scripts/FIREWALL/10-config b/fai/config/scripts/FIREWALL/10-config
index 447ee7b..5b65c2e 100755
--- a/fai/config/scripts/FIREWALL/10-config
+++ b/fai/config/scripts/FIREWALL/10-config
@@ -126,11 +126,6 @@ sed -i "s/startup=0/startup=1/" ${target}/etc/default/shorewall
#Jetdirect(ACCEPT) \$FW loc
#
##
-## Allow apt-cacher-ng
-##
-#ACCEPT loc \$FW tcp 3142
-#
-##
## Allow TFTP
##
#TFTP(ACCEPT) loc \$FW
diff --git a/fai/config/scripts/GATEWAY_A/10-misc b/fai/config/scripts/GATEWAY_A/10-misc
index 2723043..04592bc 100755
--- a/fai/config/scripts/GATEWAY_A/10-misc
+++ b/fai/config/scripts/GATEWAY_A/10-misc
@@ -4,7 +4,7 @@ set -e
## Switch on apt-cacher-ng:
# FIXME: resolv.conf does not use the internal name server, so DNS fails here:
-ainsl -a /etc/apt/apt.conf '#Acquire::http::Proxy "http://aptcache.intern:3142/";'
+ainsl -a /etc/apt/apt.conf '#Acquire::http::Proxy "http://aptcache.intern:3128/";'
if [ "$FAI_ACTION" != "install" ] && [ "$CONVERT" != "true" ] ; then
exit 0
diff --git a/fai/config/scripts/PROXY/10-config b/fai/config/scripts/PROXY/10-config
index fb6ad23..bba8703 100755
--- a/fai/config/scripts/PROXY/10-config
+++ b/fai/config/scripts/PROXY/10-config
@@ -30,12 +30,38 @@ editfiles:
InsertLine "http_access allow localnet"
EndGroup
+ ## Package cache:
+ BeginGroupIfNoSuchLine 'maximum_object_size_in_memory 10240 KB'
+ LocateLineMatching '# maximum_object_size_in_memory .*'
+ InsertLine 'maximum_object_size_in_memory 10240 KB'
+ EndGroup
+
## Use disk cache:
- ReplaceAll "#cache_dir ufs /var/spool/squid3 100 16 256" With "cache_dir ufs /var/spool/squid3 1000 16 256"
+ BeginGroupIfNoSuchLine 'cache_dir aufs /var/spool/squid3 40000 16 256'
+ LocateLineMatching '#cache_dir .*'
+ InsertLine 'cache_dir aufs /var/spool/squid3 40000 16 256'
+ EndGroup
+
+ ## Package cache:
+ BeginGroupIfNoSuchLine 'maximum_object_size 512 MB'
+ LocateLineMatching '# maximum_object_size .*'
+ InsertLine 'maximum_object_size 512 MB'
+ EndGroup
## Define url_rewrite_program:
BeginGroupIfNoSuchLine "url_rewrite_program /usr/bin/adzapper.wrapper"
LocateLineMatching "# TAG: url_rewrite_program"
InsertLine "url_rewrite_program /usr/bin/adzapper.wrapper"
EndGroup
+
+ ## Package cache:
+ BeginGroupIfNoSuchLine 'refresh_pattern deb$(dollar) 129600 100% 129600'
+ LocateLineMatching "# TAG: refresh_pattern"
+ InsertLine 'refresh_pattern deb$(dollar) 129600 100% 129600'
+ InsertLine 'refresh_pattern udeb$(dollar) 129600 100% 129600'
+ InsertLine 'refresh_pattern tar.gz$(dollar) 129600 100% 129600'
+ InsertLine 'refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$(dollar) 0 0% 0'
+ InsertLine 'refresh_pattern \/Release(|\.gpg)$(dollar) 0 0% 0'
+ InsertLine 'refresh_pattern \/InRelease$(dollar) 0 0% 0'
+ EndGroup
}
diff --git a/fai/config/scripts/SERVER_A/10-misc b/fai/config/scripts/SERVER_A/10-misc
index 0a6eed8..9a39543 100755
--- a/fai/config/scripts/SERVER_A/10-misc
+++ b/fai/config/scripts/SERVER_A/10-misc
@@ -3,7 +3,7 @@
set -e
## Switch on apt-cacher-ng:
-ainsl -a /etc/apt/apt.conf 'Acquire::http::Proxy "http://aptcache.intern:3142/";'
+ainsl -a /etc/apt/apt.conf 'Acquire::http::Proxy "http://aptcache.intern:3128/";'
## Add a local user account.
## You need to define USERNAME in class/SERVER_A.var to enable:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/debian-lan.git
More information about the debian-lan-devel
mailing list