Add instructions for seeding default accounts and roles in installation guide

This commit is contained in:
2025-11-10 08:24:19 +01:00
parent 1337bde936
commit 5536f2325a

View File

@@ -46,7 +46,26 @@ Before you begin, ensure that you have the following prerequisites installed on
The first time you run the application, the database will be initialized automatically. Ensure that the database container is running and accessible. The first time you run the application, the database will be initialized automatically. Ensure that the database container is running and accessible.
5. **Stopping the Application** 5. **Seed Default Accounts and Roles**
After the schema is in place, run the initial data seeding utility so the default roles and administrator account exist:
```bash
# activate your virtualenv first
python -m scripts.00_initial_data
```
The script reads the standard database environment variables (see below) and supports the following overrides:
- `CALMINER_SEED_ADMIN_EMAIL` (default `admin@calminer.local`)
- `CALMINER_SEED_ADMIN_USERNAME` (default `admin`)
- `CALMINER_SEED_ADMIN_PASSWORD` (default `ChangeMe123!` — change in production)
- `CALMINER_SEED_ADMIN_ROLES` (comma list, always includes `admin`)
- `CALMINER_SEED_FORCE` (`true` to rotate the admin password on every run)
You can rerun the script safely; it updates existing roles and user details without creating duplicates.
6. **Stopping the Application**
To stop the application, run the following command in the terminal: To stop the application, run the following command in the terminal: