diff --git a/README.md b/README.md index 3c1af69..0c9a3a5 100644 --- a/README.md +++ b/README.md @@ -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 and is licensed