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

Fixed APT cacher conf.

parent 6775d7e9
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
source /root/envsetup/conf.sh
# migrate to Ubuntu 16.04 / apply sources.list
if ( cat /etc/lsb-release | grep '14.04' ); then
if ( rgrep '14.04' /etc/lsb-release >/dev/null ); then
# upgrade to Ubuntu 16.04
apt-get update
apt-get dist-upgrade -y
......
#!/bin/bash
source /root/envsetup/conf.sh
#APT_CACHER_PWD=$(cat ${CONF} | egrep ^APT_CACHER_PWD | head -1 | awk -F "=" '{print$2}')
APT_CACHER_PWD=$(pwgen 12)
# installation cm
# install cm
apt-get install -y campus-manager
# configure nginx
sed -i "s@server_name skyreach;@server_name ${CM_SERVER_NAME};@" /etc/nginx/sites-available/skyreach.conf
service nginx restart
# installation cache local
# install apt cacher
apt-get install -y apt-cacher-ng
# secure it
echo "AdminAuth: ${APT_CACHER_USER}:${APT_CACHER_PWD}" >> /etc/apt-cacher-ng/security.conf
service apt-cacher-ng restart
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
# proxy
if [ ${PROXY} = "1" ]; then
......@@ -24,21 +27,13 @@ if [ ${PROXY} = "1" ]; then
fi
fi
# configure nginx
python3 /root/envsetup/envsetup.py 7
# devrait être inutile mais pb constaté avec jenkins
sed -i "s@server_name skyreach;@server_name ${CM_SERVER_NAME};@" /etc/nginx/sites-available/skyreach.conf
#~mv /etc/nginx/sites-enabled/skyreach.conf.tmp /etc/nginx/sites-enabled/skyreach.conf
service nginx restart
# 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 ( cat /etc/lsb-release | grep '14.04' ); then
if ( rgrep '14.04' /etc/lsb-release >/dev/null ); then
update-rc.d iptables-persistent enable
service iptables-persistent save || true
else
......
......@@ -66,9 +66,6 @@ MONITOR_ADMIN_PWD='test'
CM_SERVER_NAME='campusmanager'
CM_SUPERUSER_PWD='test'
CM_ADMIN_PWD='test'
# APT cacher (dependency of CM)
APT_CACHER_USER='admin'
#APT_CACHER_PWD=AUTOMATICALLY GENERATED
# -- MySQL --
# if no password is set, it will not be changed or set
......
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