From 7961f561f8fd7a44ab0a3ecb1351574f510a5bbf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Tue, 4 Dec 2018 23:56:26 +0100 Subject: [PATCH] chg: bootstrap user needs to add domain before making himself admin (via sql) afterwards the primary bootstrapper cannot add more domains to the org. Change-Id: Ibb551d420f6648fbeaf550e46067f377871ae42d --- bootstrap-user | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bootstrap-user b/bootstrap-user index da8c327..d1bbaa5 100755 --- a/bootstrap-user +++ b/bootstrap-user @@ -78,6 +78,7 @@ function register { } function check_error { cat > $folder/page_output + cat $folder/page_output >> $folder/log if grep -q "error-msgs" $folder/page_output; then cat $folder/page_output exit 1 @@ -148,14 +149,15 @@ if ! grep -q '^[0-9]\+$' <<< $mgmOid; then fi printf "Management Organisation id is \"%s\"\n" "$mgmOid" +printf "adding org-domain for org %s: %s\n" "$mgmOid" "$hostname" +csrf=$(mcurl orga/$mgmOid | csrf "head -n 4" "tail -n 1") +domainName="$hostname" +mcurl orga/$mgmOid -d "domain=$domainName&addDomain=action&csrf=$csrf" | check_error + echo "using SQL to add self as orgadmin for organisation" sudo lxc-attach -n postgres-primary -- su -c "psql -d gigi" postgres <