dendrite/docs/administration/1_createusers.md
Tak Wai Wong ea0a8804d2 Pull latest dendrite fork into harmony (#252)
Latest dendrite main has changes for knockable rooms, and the fix for login crash. Pulled into dendrite fork. Rebased dendrite fork from dendrite main.

Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Co-authored-by: kegsay <kegan@matrix.org>
Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
Co-authored-by: texuf <texuf.eth@gmail.com>
Co-authored-by: Brian Meek <brian@hntlabs.com>
Co-authored-by: Tak Wai Wong <takwaiw@gmail.com>
2022-08-13 16:09:49 -07:00

2.2 KiB

title parent permalink nav_order
Creating user accounts Administration /administration/createusers 1

Creating user accounts

User accounts can be created on a Dendrite instance in a number of ways.

From the command line

The create-account tool is built in the bin folder when building Dendrite with the build.sh script.

It uses the dendrite.yaml configuration file to connect to a running Dendrite instance and requires shared secret registration to be enabled as explained below.

An example of using create-account to create a normal account:

./bin/create-account -config /path/to/dendrite.yaml -username USERNAME

You will be prompted to enter a new password for the new account.

To create a new admin account, add the -admin flag:

./bin/create-account -config /path/to/dendrite.yaml -username USERNAME -admin

By default create-account uses https://localhost:8448 to connect to Dendrite, this can be overwritten using the -url flag:

./bin/create-account -config /path/to/dendrite.yaml -username USERNAME -url http://localhost:8008

An example of using create-account when running in Docker, having found the CONTAINERNAME from docker ps:

docker exec -it CONTAINERNAME /usr/bin/create-account -config /path/to/dendrite.yaml -username USERNAME
docker exec -it CONTAINERNAME /usr/bin/create-account -config /path/to/dendrite.yaml -username USERNAME -admin

Using shared secret registration

Dendrite supports the Synapse-compatible shared secret registration endpoint.

To enable shared secret registration, you must first enable it in the dendrite.yaml configuration file by specifying a shared secret. In the client_api section of the config, enter a new secret into the registration_shared_secret field:

client_api:
  # ...
  registration_shared_secret: ""

You can then use the /_synapse/admin/v1/register endpoint as per the Synapse documentation.

Shared secret registration is only enabled once a secret is configured. To disable shared secret registration again, remove the secret from the configuration file.