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

Changed conf generation (refs #19005).

parent 1163a2a2
No related branches found
No related tags found
No related merge requests found
......@@ -14,12 +14,16 @@ nameserver 192.168.40.6
EOF
# set ubicast account pwd
echo -e "${SHELL_UBICAST_PWD}\n${SHELL_UBICAST_PWD}" | (passwd -q ubicast)
if ( ! test -z ${SHELL_UBICAST_PWD} ); then
echo -e "${SHELL_UBICAST_PWD}\n${SHELL_UBICAST_PWD}" | passwd -q ubicast
fi
# create admin account
useradd -m admin --shell /bin/bash
echo -e "${SHELL_ADMIN_PWD}\n${SHELL_ADMIN_PWD}" | (passwd -q admin)
usermod -aG sudo admin
if ( ! test -z ${SHELL_ADMIN_PWD} ); then
echo -e "${SHELL_ADMIN_PWD}\n${SHELL_ADMIN_PWD}" | passwd -q admin
fi
# migrate to Ubuntu 16.04 / apply sources.list
if [ $(cat /etc/lsb-release | grep DISTRIB_RELEASE | awk -F "=" '{print$2}') = "16.04" ]
......
#!/bin/bash
source /root/envsetup/conf.sh
# Conf setup
sed -i "s@^NTP_SERVER1 = .*@NTP_SERVER1 = '${NTP}'@" /root/envsetup/conf.py
sed -i "s@^EMAIL_SMTP_SERVER = .*@EMAIL_SMTP_SERVER = '${EMAIL_SMTP_SERVER}'@" /root/envsetup/conf.py
sed -i "s@^MYSQL_ROOT_PWD = .*@MYSQL_ROOT_PWD = '${MYSQL_ROOT_PWD}'@" /root/envsetup/conf.py
# Wowza
sed -i "s@^wowza_server_name = .*@wowza_server_name = '${WOWZA}'@" /root/envsetup/conf.py
sed -i "s@^WOWZA_MANAGER_PWD = .*@WOWZA_MANAGER_PWD = '${WOWZA_MANAGER_PWD}'@" /root/envsetup/conf.py
sed -i "s@^WOWZA_LICENSE = .*@WOWZA_LICENSE = '${WOWZA_LICENSE}'@" /root/envsetup/conf.py
sed -i "s@^WOWZA_LIVE_PWD = .*@WOWZA_LIVE_PWD = '${WOWZA_LIVE_PWD}'@" /root/envsetup/conf.py
# MS
sed -i "s@^MS_SERVER_NAME = .*@MS_SERVER_NAME = '${MS_SERVER_NAME}'@" /root/envsetup/conf.py
sed -i "s@^MS_SUPERUSER_PWD = .*@MS_SUPERUSER_PWD = '${SUPERUSER_PWD}'@" /root/envsetup/conf.py
sed -i "s@^MS_ADMIN_PWD = .*@MS_ADMIN_PWD = '${ADMIN_PWD}'@" /root/envsetup/conf.py
# Autogenerate missing values
if [ "${MS_ID}" = "" ]; then
MS_ID=$(echo "$(hostname)_msuser")
fi
......@@ -22,22 +10,12 @@ if [ "${MS_API_KEY}" = "" ]; then
# respect API pattern
MS_API_KEY=$(echo $MS_API_KEY | sed "s@[iloILO]@$((${RANDOM} / 10000))@g")
fi
if [ "${MS_SECRET}" = "" ]; then
if [ "${MS_SECRET}" = "secret" ]; then
MS_SECRET=$(echo "$(pwgen 40)")
fi
sed -i "s@^MS_ID = .*@MS_ID = '${MS_ID}'@" /root/envsetup/conf.py
sed -i "s@^MS_API_KEY = .*@MS_API_KEY = '${MS_API_KEY}'@" /root/envsetup/conf.py
sed -i "s@^MS_SECRET = .*@MS_SECRET = '${MS_SECRET}'@" /root/envsetup/conf.py
# SK
sed -i "s@^CM_SERVER_NAME = .*@CM_SERVER_NAME = '${CM}'@" /root/envsetup/conf.py
sed -i "s@^CM_SUPERUSER_PWD = .*@CM_SUPERUSER_PWD = '${CM_SUPERUSER_PWD}'@" /root/envsetup/conf.py
sed -i "s@^CM_ADMIN_PWD = .*@CM_ADMIN_PWD = '${CM_ADMIN_PWD}'@" /root/envsetup/conf.py
# Monitor
sed -i "s@^MONITOR_SERVER_NAME = .*@MONITOR_SERVER_NAME = '${MONITOR}'@" /root/envsetup/conf.py
sed -i "s@^MONITOR_SUPERUSER_PWD = .*@MONITOR_SUPERUSER_PWD = '${MONITOR_SUPERUSER_PWD}'@" /root/envsetup/conf.py
sed -i "s@^MONITOR_ADMIN_PWD = .*@MONITOR_ADMIN_PWD = '${MONITOR_ADMIN_PWD}'@" /root/envsetup/conf.py
# Worker
sed -i "s@^CELERITY_SIGNING_KEY = .*@CELERITY_SIGNING_KEY = '${CELERITY_SIGNING_KEY}'@" /root/envsetup/conf.py
# IP for whitelist
sed -i "s@^MS_ID=.*@MS_ID='${MS_ID}'@" /root/envsetup/conf.sh
sed -i "s@^MS_API_KEY=.*@MS_API_KEY='${MS_API_KEY}'@" /root/envsetup/conf.sh
sed -i "s@^MS_SECRET=.*@MS_SECRET='${MS_SECRET}'@" /root/envsetup/conf.sh
# Worker IP for whitelist
CELERITY_WORKER_IP=$(ip addr show | grep inet | grep -v 127 | grep -v ":" | awk -F " " '{print$2}' | awk -F "/" '{print$1}')
sed -i "s@^CELERITY_CELERITY_WORKER_IP = .*@CELERITY_CELERITY_WORKER_IP = '${CELERITY_WORKER_IP}'@" /root/envsetup/conf.py
sed -i "s@^CELERITY_CELERITY_WORKER_IP=.*@CELERITY_CELERITY_WORKER_IP='${CELERITY_WORKER_IP}'@" /root/envsetup/conf.sh
......@@ -2,6 +2,6 @@
# Envsetup local configuration file
# See default configuration in default-conf.sh
source default-conf.sh
source /root/envsetup/default-conf.sh
# Put your configuration here
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