diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | lava-master/Dockerfile | 2 | ||||
-rwxr-xr-x | lava-master/scripts/setup.sh | 6 | ||||
-rwxr-xr-x | lavalab-gen.py | 9 |
4 files changed, 17 insertions, 1 deletions
@@ -219,6 +219,7 @@ masters: zmq_auth_key: optional path to a public ZMQ key zmq_auth_key_secret: optional path to a private ZMQ key persistent_db: True/False (default False) Is the postgres DB is persistent over reboot + http_fqdn: The FQDN used to access the LAVA web interface users: - name: LAVA username token: The token of this user (optional) diff --git a/lava-master/Dockerfile b/lava-master/Dockerfile index 100b366..1270e32 100644 --- a/lava-master/Dockerfile +++ b/lava-master/Dockerfile @@ -29,6 +29,8 @@ RUN cd /usr/lib/python3/dist-packages && for patch in $(ls /root/lava-patch/*pat COPY zmq_auth/ /etc/lava-dispatcher/certificates.d/ +COPY lava_http_fqdn /root/ + EXPOSE 69/udp 80 3079 5555 5556 CMD /start.sh && while [ true ];do sleep 365d; done diff --git a/lava-master/scripts/setup.sh b/lava-master/scripts/setup.sh index dd0d58f..e217a96 100755 --- a/lava-master/scripts/setup.sh +++ b/lava-master/scripts/setup.sh @@ -21,6 +21,12 @@ if [ -e /db_lavaserver ];then fi chown -R lavaserver:lavaserver /var/lib/lava-server/default/media/job-output/ +# default site is set as example.com +if [ -e /root/lava_http_fqdn ];then + sudo -u postgres psql lavaserver -c "UPDATE django_site SET name = '$(cat /root/lava_http_fqdn)'" || exit $? + sudo -u postgres psql lavaserver -c "UPDATE django_site SET domain = '$(cat /root/lava_http_fqdn)'" || exit $? +fi + if [ -e /root/lava-users ];then for ut in $(ls /root/lava-users) do diff --git a/lavalab-gen.py b/lavalab-gen.py index f7f06f3..4c10109 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -87,7 +87,7 @@ def main(): sys.exit(1) masters = workers["masters"] for master in masters: - keywords_master = [ "name", "type", "host", "users", "tokens", "webadmin_https", "persistent_db", "zmq_auth", "zmq_auth_key", "zmq_auth_key_secret" ] + keywords_master = [ "name", "type", "host", "users", "tokens", "webadmin_https", "persistent_db", "zmq_auth", "zmq_auth_key", "zmq_auth_key_secret", "http_fqdn" ] for keyword in master: if not keyword in keywords_master: print("WARNING: unknown keyword %s" % keyword) @@ -138,6 +138,13 @@ def main(): else: cookie_secure = "false" session_cookie_secure = "false" + if "http_fqdn" in worker: + lava_http_fqdn = worker["http_fqdn"] + else: + lava_http_fqdn = "example.com" + f_fqdn = open("%s/lava_http_fqdn" % workerdir, 'w') + f_fqdn.write(lava_http_fqdn) + f_fqdn.close() fsettings = open("%s/settings.conf" % workerdir, 'w') fsettings.write(template_settings_conf.substitute(cookie_secure=cookie_secure, session_cookie_secure=session_cookie_secure)) fsettings.close() |