Skip to content

Creating user accounts

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

The create-account tool is built in the bin folder when building Zendrite.

It uses the zendrite.yaml configuration file to connect to a running Zendrite 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/zendrite.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/zendrite.yaml -username USERNAME -admin

By default create-account uses http://localhost:8008 to connect to Zendrite, this can be overwritten using the -url flag:

./bin/create-account -config /path/to/zendrite.yaml -username USERNAME -url https://localhost:8448

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/zendrite.yaml -username USERNAME
docker exec -it CONTAINERNAME /usr/bin/create-account -config /path/to/zendrite.yaml -username USERNAME -admin

Zendrite supports the Synapse-compatible shared secret registration endpoint.

To enable shared secret registration, you must first enable it in the zendrite.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.