aboutsummaryrefslogtreecommitdiffstats
path: root/lava-master
diff options
context:
space:
mode:
Diffstat (limited to 'lava-master')
-rw-r--r--lava-master/Dockerfile2
-rwxr-xr-xlava-master/entrypoint.d/01_setup.sh7
2 files changed, 7 insertions, 2 deletions
diff --git a/lava-master/Dockerfile b/lava-master/Dockerfile
index 5bf989a..6396253 100644
--- a/lava-master/Dockerfile
+++ b/lava-master/Dockerfile
@@ -39,6 +39,8 @@ COPY apache2/ /etc/apache2/
# Fixes 'postgresql ERROR: invalid locale name: "en_US.UTF-8"' when restoring a backup
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen en_US.UTF-8
+COPY pg_lava_password /root
+
# TODO: send this fix to upstream
RUN sed -i 's,find /root/entrypoint.d/ -type f,find /root/entrypoint.d/ -type f | sort,' /root/entrypoint.sh
# TODO: send this fix to upstream
diff --git a/lava-master/entrypoint.d/01_setup.sh b/lava-master/entrypoint.d/01_setup.sh
index 53db47e..95b180b 100755
--- a/lava-master/entrypoint.d/01_setup.sh
+++ b/lava-master/entrypoint.d/01_setup.sh
@@ -1,8 +1,11 @@
#!/bin/bash
# always reset the lavaserver user, since its password could have been reseted in a "docker build --nocache"
-if [ ! -e /root/pg_lava_password ];then
- < /dev/urandom tr -dc A-Za-z0-9 | head -c16 > /root/pg_lava_password
+if [ ! -s /root/pg_lava_password ];then
+ echo "DEBUG: Generating a random LAVA password"
+ < /dev/urandom tr -dc A-Za-z0-9 | head -c16 > /root/pg_lava_password
+else
+ echo "DEBUG: use the given LAVA password"
fi
sudo -u postgres psql -c "ALTER USER lavaserver WITH PASSWORD '$(cat /root/pg_lava_password)';" || exit $?
if [ -e /etc/lava-server/instance.conf ];then