From 3f8cb96a1863bb4288147e37f136ca8afa13e371 Mon Sep 17 00:00:00 2001 From: Shaleen Jain Date: Tue, 23 Aug 2022 16:12:09 +0000 Subject: [PATCH 1/3] dendrite: fix user-registration command --- .../usr-local-bin/matrix-dendrite-create-account.j2 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/matrix-dendrite/templates/dendrite/usr-local-bin/matrix-dendrite-create-account.j2 b/roles/matrix-dendrite/templates/dendrite/usr-local-bin/matrix-dendrite-create-account.j2 index 5332b964..7505566a 100644 --- a/roles/matrix-dendrite/templates/dendrite/usr-local-bin/matrix-dendrite-create-account.j2 +++ b/roles/matrix-dendrite/templates/dendrite/usr-local-bin/matrix-dendrite-create-account.j2 @@ -8,5 +8,10 @@ fi user=$1 password=$2 +admin=$3 -docker exec matrix-dendrite create-account -config /data/dendrite.yaml -username "$user" -password "$password" +if [ "$admin" -eq "1" ]; then + docker exec matrix-dendrite create-account -config /data/dendrite.yaml -username "$user" -password "$password" -admin -url http://localhost:{{ matrix_dendrite_http_bind_port }} +else + docker exec matrix-dendrite create-account -config /data/dendrite.yaml -username "$user" -password "$password" -url http://localhost:{{ matrix_dendrite_http_bind_port }} +fi From 3ff56bff1deb0ce048d8b4919afbd3fb2ffd28d2 Mon Sep 17 00:00:00 2001 From: Shaleen Jain Date: Tue, 23 Aug 2022 21:41:59 +0000 Subject: [PATCH 2/3] dendrite: disabled registration by default --- roles/matrix-dendrite/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/matrix-dendrite/defaults/main.yml b/roles/matrix-dendrite/defaults/main.yml index b2697858..90eedb91 100644 --- a/roles/matrix-dendrite/defaults/main.yml +++ b/roles/matrix-dendrite/defaults/main.yml @@ -83,7 +83,7 @@ matrix_dendrite_rate_limiting_threshold: 5 matrix_dendrite_rate_limiting_cooloff_ms: 500 # Controls whether people with access to the homeserver can register by themselves. -matrix_dendrite_registration_disabled: false +matrix_dendrite_registration_disabled: true # reCAPTCHA API for validating registration attempts matrix_dendrite_enable_registration_captcha: false From d7ed672f7f3e7e43569af83ccb0b17e0788cce2d Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 24 Aug 2022 06:59:08 +0300 Subject: [PATCH 3/3] Fix matrix-dendrite-create-account usage help --- .../dendrite/usr-local-bin/matrix-dendrite-create-account.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/matrix-dendrite/templates/dendrite/usr-local-bin/matrix-dendrite-create-account.j2 b/roles/matrix-dendrite/templates/dendrite/usr-local-bin/matrix-dendrite-create-account.j2 index 7505566a..507c7012 100644 --- a/roles/matrix-dendrite/templates/dendrite/usr-local-bin/matrix-dendrite-create-account.j2 +++ b/roles/matrix-dendrite/templates/dendrite/usr-local-bin/matrix-dendrite-create-account.j2 @@ -2,7 +2,7 @@ #!/bin/bash if [ $# -ne 2 ]; then - echo "Usage: "$0" " + echo "Usage: "$0" " exit 1 fi