2022-05-11 09:39:36 -05:00
|
|
|
---
|
|
|
|
title: Creating user accounts
|
|
|
|
parent: Administration
|
|
|
|
permalink: /administration/createusers
|
|
|
|
nav_order: 1
|
|
|
|
---
|
|
|
|
|
2024-11-04 08:34:08 -06:00
|
|
|
{% include deprecation.html %}
|
|
|
|
|
2022-05-11 09:39:36 -05:00
|
|
|
# Creating user accounts
|
|
|
|
|
|
|
|
User accounts can be created on a Dendrite instance in a number of ways.
|
|
|
|
|
|
|
|
## From the command line
|
|
|
|
|
2023-05-30 03:02:53 -05:00
|
|
|
The `create-account` tool is built in the `bin` folder when [building](../installation/build) Dendrite.
|
2022-05-11 09:39:36 -05:00
|
|
|
|
2023-05-30 03:02:53 -05:00
|
|
|
It uses the `dendrite.yaml` configuration file to connect to a **running** Dendrite instance and requires
|
2022-08-12 06:00:07 -05:00
|
|
|
shared secret registration to be enabled as explained below.
|
2022-05-11 09:39:36 -05:00
|
|
|
|
|
|
|
An example of using `create-account` to create a **normal account**:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
./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:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
./bin/create-account -config /path/to/dendrite.yaml -username USERNAME -admin
|
|
|
|
```
|
|
|
|
|
2022-10-03 13:35:26 -05:00
|
|
|
By default `create-account` uses `http://localhost:8008` to connect to Dendrite, this can be overwritten using
|
2022-08-12 06:00:07 -05:00
|
|
|
the `-url` flag:
|
|
|
|
|
|
|
|
```bash
|
2022-10-02 04:31:40 -05:00
|
|
|
./bin/create-account -config /path/to/dendrite.yaml -username USERNAME -url https://localhost:8448
|
2022-08-12 06:00:07 -05:00
|
|
|
```
|
|
|
|
|
2022-07-15 10:33:05 -05:00
|
|
|
An example of using `create-account` when running in **Docker**, having found the `CONTAINERNAME` from `docker ps`:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker exec -it CONTAINERNAME /usr/bin/create-account -config /path/to/dendrite.yaml -username USERNAME
|
|
|
|
```
|
2022-10-03 13:35:26 -05:00
|
|
|
|
2022-07-15 10:33:05 -05:00
|
|
|
```bash
|
|
|
|
docker exec -it CONTAINERNAME /usr/bin/create-account -config /path/to/dendrite.yaml -username USERNAME -admin
|
|
|
|
```
|
|
|
|
|
2022-05-11 09:39:36 -05:00
|
|
|
## 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:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
client_api:
|
|
|
|
# ...
|
|
|
|
registration_shared_secret: ""
|
|
|
|
```
|
|
|
|
|
|
|
|
You can then use the `/_synapse/admin/v1/register` endpoint as per the
|
|
|
|
[Synapse documentation](https://matrix-org.github.io/synapse/latest/admin_api/register_api.html).
|
|
|
|
|
|
|
|
Shared secret registration is only enabled once a secret is configured. To disable shared
|
|
|
|
secret registration again, remove the secret from the configuration file.
|