Skip to content
Snippets Groups Projects
Commit 9645ecb1 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Removed apt cacher ng setup (refs #20417).

parent 84e9ec45
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,7 @@ server { ...@@ -52,7 +52,7 @@ server {
} }
# APT proxy # APT proxy
location /apt { location /apt {
location ~ ^/apt/(http|https)/([\w\.\-\_]+.ubuntu.com/ubuntu|ftp.debian.org/debian|mozilla.debian.net|panel.ubicast.eu/packaging/apt)/(.*)$ { location ~ ^/apt/(http|https)/([\w\.\-\_]+.ubuntu.com/ubuntu|ftp.debian.org/debian|mozilla.debian.net|panel.ubicast.eu)/(.*)$ {
resolver 127.0.0.1; resolver 127.0.0.1;
proxy_pass $1://$2/$3; proxy_pass $1://$2/$3;
proxy_cache uc-apt-cache; proxy_cache uc-apt-cache;
......
...@@ -6,31 +6,3 @@ apt-get install -y campus-manager ...@@ -6,31 +6,3 @@ apt-get install -y campus-manager
# configure nginx # configure nginx
sed -i "s@server_name skyreach;@server_name ${CM_SERVER_NAME};@" /etc/nginx/sites-available/skyreach.conf sed -i "s@server_name skyreach;@server_name ${CM_SERVER_NAME};@" /etc/nginx/sites-available/skyreach.conf
service nginx restart service nginx restart
# install apt cacher
apt-get install -y apt-cacher-ng
# secure it
if ( ! rgrep 'AdminAuth: admin:' /etc/apt-cacher-ng/security.conf >/dev/null ); then
APT_CACHER_PWD="$(pwgen 12)"
echo "AdminAuth: admin:${APT_CACHER_PWD}" >> /etc/apt-cacher-ng/security.conf
service apt-cacher-ng restart
fi
# iptables rules for port 3142
DEBIAN_FRONTEND=noninteractive apt-get install -y iptables-persistent
iptables -A INPUT -p tcp -s localhost --destination-port 3142 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 3142 -j DROP
iptables-save
# the save using "service" command fails on VM
if ( rgrep '14.04' /etc/lsb-release >/dev/null ); then
update-rc.d iptables-persistent enable
service iptables-persistent save || true
else
update-rc.d netfilter-persistent enable
service netfilter-persistent save || true
fi
LIG=$(grep -n "^iface lo inet loopback" /etc/network/interfaces | awk -F ":" '{print$1}')
LIG=$(( ${LIG} + 1 ))
sed -i "${LIG}i\pre-up iptables-restore < /etc/iptables/rules.v4" /etc/network/interfaces
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment