@@ -8,10 +8,8 @@ Please see the main Mavis repository for [how to install
88mise] ( https://github.com/nhsuk/manage-vaccinations-in-schools?tab=readme-ov-file#mise ) .
99
1010``` sh
11- mise install # Install dev tools
12- cp mise.local.toml.example mise.local.toml # Fill in shared secrets
13- mise dev # Run dev server
14- mise ci # Run CI tests
11+ mise dev --env development # Run dev server
12+ mise ci --env development # Run CI tests
1513```
1614
1715The application will be available at < http://localhost:4001 > .
@@ -23,8 +21,8 @@ below for details.
2321## Other tasks
2422
2523``` sh
26- mise tasks # See all available tasks
27- mise env # See all available environment variables
24+ mise tasks # See all available tasks
25+ mise env --env development # See env vars and dev secrets
2826```
2927
3028### Docker
@@ -36,44 +34,33 @@ environment:
3634mise docker
3735```
3836
39- Different environment variables can be overwritten in ` mise.local.toml ` .
37+ ## Runtime dependencies
4038
41- ### Gunicorn arguments
39+ This application authenticates with the main Mavis application using the [ OAuth
40+ 2.0 Authorization Code
41+ flow] ( https://datatracker.ietf.org/doc/html/rfc6749#section-4.1 ) .
4242
43- Additional parameters to the ` gunicorn ` executable (for instance, the number of
44- workers) can be passed through with the ` GUNICORN_CMD_ARGS ` environment
45- variable.
43+ Mavis should already have the development secrets set up in the development
44+ environment. Make sure to turn on the ` reporting_api ` feature flag.
4645
47- Example:
46+ ## Secrets
4847
49- ``` bash
50- % HOST_PORT=5555 GUNICORN_CMD_ARGS=" --workers=5" mise docker:run
51- docker run --rm -p 5555:5000 -e GUNICORN_CMD_ARGS=--workers=5 mavis-reporting:latest
52- [2025-07-17 10:32:01 +0000] [1] [INFO] Starting gunicorn 23.0.0
53- [2025-07-17 10:32:01 +0000] [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
54- [2025-07-17 10:32:01 +0000] [1] [INFO] Using worker: sync
55- [2025-07-17 10:32:01 +0000] [10] [INFO] Booting worker with pid: 10
56- [2025-07-17 10:32:01 +0000] [11] [INFO] Booting worker with pid: 11
57- [2025-07-17 10:32:01 +0000] [12] [INFO] Booting worker with pid: 12
58- [2025-07-17 10:32:01 +0000] [13] [INFO] Booting worker with pid: 13
59- [2025-07-17 10:32:01 +0000] [14] [INFO] Booting worker with pid: 14
60- ```
48+ This project uses encrypted secrets stored in ` config/credentials ` , using the
49+ [ mise secrets] ( https://mise.jdx.dev/environments/secrets.html ) integration with
50+ ` age ` and ` sops ` .
6151
62- ## Runtime dependencies
52+ ``` sh
53+ age-keygen -o config/credentials/staging.key # Generate a new keypair
54+ age-keygen -y config/credentials/staging.key # View the public key
6355
64- This application authenticates with the main Mavis application using the [ OAuth
65- 2.0 Authorization Code
66- flow] ( https://datatracker.ietf.org/doc/html/rfc6749#section-4.1 ) .
56+ echo " FOO: bar" > config/credentials/staging.enc.yaml # Create a secret file
57+ sops encrypt -i --age $( age-keygen -y config/credentials/staging.key) \
58+ config/credentials/staging.enc.yaml # Encrypt the file
59+ git add config/credentials/staging.enc.yaml # It's now safe to commit
60+
61+ mise credentials:show --env staging # Show secrets
62+ mise credentials:edit --env staging # Edit secrets
63+ ```
6764
68- To do this, it requires:
69-
70- 1 . A copy of the main Mavis app must be running and available at the URL given
71- in the ` MAVIS_ROOT_URL ` env var
72- 2 . That copy of Mavis must:
73- - have the ` reporting_api ` feature flag enabled
74- - have a value for ` Settings.reporting_api.client_app.client_id ` (..which can
75- also be set via the ` MAVIS__REPORTING_API__CLIENT_APP__CLIENT_ID `
76- environment variable) which matches this application's ` CLIENT_ID ` value
77- - have a value for ` Settings.reporting_api.client_app.secret ` (..which can
78- also be set via the ` MAVIS__REPORTING_API__CLIENT_APP__SECRET ` environment
79- variable) which matches this application's ` CLIENT_SECRET ` value
65+ To view and edit staging/production secrets, you need to obtain the
66+ ` config/credentials/staging.key ` (or ` production.key ` ) from a colleague.
0 commit comments