Document initial administrator setup
This commit is contained in:
@@ -108,12 +108,51 @@ docker compose logs -f backend
|
||||
|
||||
# Restart the backend after a configuration change.
|
||||
docker compose restart backend
|
||||
```
|
||||
|
||||
# Create a user.
|
||||
## Create the initial administrator
|
||||
|
||||
The upstream sample configuration grants the `administrator` permission to
|
||||
role `0`, named `root`. These are excerpts from the configuration. Do not
|
||||
replace the complete `perms` object or `roles` list with these excerpts:
|
||||
|
||||
```json
|
||||
"perms": {
|
||||
"administrator": [0]
|
||||
},
|
||||
"roles": [
|
||||
{"id": 0, "order_id": 0, "name": "root"}
|
||||
]
|
||||
```
|
||||
|
||||
Keep this relation, or select the administrator role from your modified
|
||||
configuration. Then, create the user:
|
||||
|
||||
```bash
|
||||
docker compose run --rm backend \
|
||||
drivershub --config /app/config/config.json setup create-user user@example.com
|
||||
```
|
||||
|
||||
Enter a secure password when the command prompts for it. The command returns a
|
||||
`UID`. Accept the user with that value:
|
||||
|
||||
```bash
|
||||
docker compose run --rm backend \
|
||||
drivershub --config /app/config/config.json setup accept-user UID
|
||||
```
|
||||
|
||||
The command returns a separate `user ID`. Assign administrator role `0` to that
|
||||
user ID. Replace `0` with your administrator role ID if you changed the
|
||||
configuration:
|
||||
|
||||
```bash
|
||||
docker compose run --rm backend \
|
||||
drivershub --config /app/config/config.json setup update-roles USER_ID 0
|
||||
```
|
||||
|
||||
Do not interchange `UID` and `USER_ID`. You can now sign in with the email
|
||||
address and password from the first command.
|
||||
|
||||
## Authors and license
|
||||
|
||||
This Docker deployment is developed by Kosmos <me@kosmos.ac> and is licensed
|
||||
|
||||
Reference in New Issue
Block a user