From be50f16913d2877a6695c8b25d36313a13b255c0 Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Wed, 18 Jul 2018 14:40:37 +0200 Subject: Permit to choose the FQDN printed in email --- lava-master/scripts/setup.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lava-master/scripts/setup.sh') 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 -- cgit 1.2.3-korg From b19b71ab89761e801c27038f093d76655efabfbf Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Thu, 26 Jul 2018 16:48:53 +0200 Subject: Permit to configure email for LAVA users --- README.md | 1 + lava-master/scripts/setup.sh | 4 ++++ lavalab-gen.py | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'lava-master/scripts/setup.sh') diff --git a/README.md b/README.md index 30c2313..a3364b4 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,7 @@ masters: - name: LAVA username token: The token of this user (optional) password: Password the this user (generated if not provided) + email: email of the user (optional) superuser: yes/no (default no) staff: yes/no (default no) tokens: diff --git a/lava-master/scripts/setup.sh b/lava-master/scripts/setup.sh index e217a96..426876f 100755 --- a/lava-master/scripts/setup.sh +++ b/lava-master/scripts/setup.sh @@ -58,6 +58,10 @@ if [ -e /root/lava-users ];then echo "Adding token to user $USER" lava-server manage tokens add --user $USER --secret $TOKEN || exit 1 fi + if [ ! -z "$EMAIL" ];then + echo "Adding email to user $USER" + lava-server manage users update --email $EMAIL $USER || exit 1 + fi fi done fi diff --git a/lavalab-gen.py b/lavalab-gen.py index 4c77c2b..2d21fe7 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -160,7 +160,7 @@ def main(): need_zmq_auth_gen = True if "users" in worker: for user in worker["users"]: - keywords_users = [ "name", "staff", "superuser", "password", "token" ] + keywords_users = [ "name", "staff", "superuser", "password", "token", "email" ] for keyword in user: if not keyword in keywords_users: print("WARNING: unknown keyword %s" % keyword) @@ -173,6 +173,9 @@ def main(): password = user["password"] ftok.write("PASSWORD=" + password + "\n") # libyaml convert yes/no to true/false... + if "email" in user: + email = user["email"] + ftok.write("EMAIL=" + email + "\n") if "staff" in user: value = user["staff"] if value is True: -- cgit 1.2.3-korg