Skip to content

Commit 14cb5d1

Browse files
docs: describe how to configure via environment variables
1 parent 0aeaf07 commit 14cb5d1

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

config/sample.config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# required configuration variables for docker compose setup
2-
# broker-url = "redis://redis:6379"
3-
# result-backend = "db+postgresql://smt:smt@postgres:5432"
2+
# broker_url = "redis://redis:6379"
3+
# result_backend = "db+postgresql://smt:smt@postgres:5432"

docs/configuration.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Configuration
22

3-
The Sketch Map Tool can be configured using a configuration file.
3+
The Sketch Map Tool can be configured using a configuration file or via
4+
environment variables. The latter takes precedence over the former.
5+
46

57
## Configuration File
68

@@ -15,6 +17,7 @@ To create a new configuration file simply copy the sample configuration file and
1517
cp config/sample.config.toml config/config.toml
1618
```
1719

20+
1821
## Default Configuration
1922

2023
For a list of all configuration variables and their default values please take a look at [config.py](sketch_map_tool/config.py).
@@ -24,13 +27,23 @@ All lot of configuration values come with defaults.
2427
For running the services using Docker Compose set broker URL and result backend to:
2528

2629
```toml
27-
broker-url = "redis://redis:6379"
28-
result-backend = "db+postgresql://smt:smt@postgres:5432"
30+
broker_url = "redis://redis:6379"
31+
result_backend = "db+postgresql://smt:smt@postgres:5432"
32+
```
33+
34+
35+
## Environment Variables
36+
37+
All environment variables are prefixed with `SMT_`. For example above
38+
configuration via environment variables is done like this:
39+
40+
```sh
41+
SMT_BROKER_URL="redis://redis:6379"
42+
SMT_RESULT_BACKEND="db+postgresql://smt:smt@postgres:5432"
2943
```
3044

31-
## Misc
3245

33-
### ArcGIS/ESRI API Key
46+
## ArcGIS/ESRI API Key
3447

3548
To retrieve up-to-date attribution an ArcGIS/ESRI API key is needed.
3649
For local development you do not need one.

docs/development-setup.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ uv run ruff check --fix
104104

105105
### Tests
106106

107-
Provide required [configuration variables](/docs/configuration.md#required-configuration) in `config/test.config.toml`. Be sure *not* to set `broker-url` and `result-backend`.
108-
109107
To execute all tests run:
110108
```bash
111109
uv run pytest

0 commit comments

Comments
 (0)