Skip to content

Commit d744d64

Browse files
authored
docu: Document OPENDAL* env variables (#1646)
1 parent 33b3e17 commit d744d64

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

config/README.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ options. Therefore `commandline arguments` have the highest precedence.
4747

4848
**NOTE**: There are the following restrictions:
4949

50-
- Not all options are available as environment variables or commandline
51-
arguments. There are also commandline options which cannot be set in the
50+
- Not all options are available as environment variables or command line
51+
arguments. There are also command line options which cannot be set in the
5252
profile TOML files.
5353
- You can overwrite values, but for most values, you cannot "unset" them on a
5454
higher priority level.
@@ -94,9 +94,9 @@ If you want to contribute your own configuration, please
9494
| group-by | Group snapshots by any combination of host,label,paths,tags e.g. for "latest" | "host,label,paths" | | RUSTIC_GROUP_BY | --group-by, -g |
9595
| check-index | If true, check the index and read pack headers if index information is missing. | false | | RUSTIC_CHECK_INDEX | --check-index |
9696
| show-time-offset | If true, show stored time with offset instead of converting to local time | false | true | RUSTIC_SHOW_TIME_OFFSET | --show-time-offset |
97-
| prometheus | URL of a Prometheus Pushgateway to push metrics to. | Not set | "http://gateway/" | RUSTIC_PROMETHEUS | --prometheus |
98-
| prometheus-user | Username to authenticate to the Prometheus Pushgateway | Not set | "myuser" | RUSTIC_PROMETHEUS_USER | --prometheus-user |
99-
| prometheus-pass | Password to authenticate to the Prometheus Pushgateway | Not set | "secret" | RUSTIC_PROMETHEUS_PASS | --prometheus-pass |
97+
| prometheus | URL of a Prometheus Push Gateway to push metrics to. | Not set | "http://gateway/" | RUSTIC_PROMETHEUS | --prometheus |
98+
| prometheus-user | Username to authenticate to the Prometheus Push Gateway | Not set | "myuser" | RUSTIC_PROMETHEUS_USER | --prometheus-user |
99+
| prometheus-pass | Password to authenticate to the Prometheus Push Gateway | Not set | "secret" | RUSTIC_PROMETHEUS_PASS | --prometheus-pass |
100100
| opentelemetry | OpenTelemetry metrics endpoint (HTTP Protobuf) | Not set | "http://otel/v1/metrics" | RUSTIC_OTEL, OTEL_EXPORTER_OTLP_METRICS_ENDPOINT | --opentelemetry |
101101

102102
### Global Hooks `[global.hooks]`
@@ -146,9 +146,13 @@ All given labels are included with the metrics, if it is configured.
146146
### Repository Options (Additional) `[repository.options]`
147147

148148
Additional repository options - depending on backend. These can be only set in
149-
the config file or using env variables. For env variables use upper snake case
150-
and prefix with "RUSTIC_REPO_OPT_", e.g. `use-password = "true"` becomes
151-
`RUSTIC_REPO_OPT_USE_PASSWORD=true`
149+
the config file or using env variables. For variables in kebab case, use upper
150+
snake case and prefix with "RUSTIC_REPO_OPT_" to obtain the env variable name,
151+
e.g. `use-password = "true"` becomes `RUSTIC_REPO_OPT_USE_PASSWORD=true`.
152+
153+
Moreover, for opendal parameters (which need to be in lower snake case), you can
154+
use upper snake case and prefix with "OPENDAL_" as env variable, e.g.
155+
`application_key = "my-key"` becomes `OPENDAL_APPLICATION_KEY=my-key`.
152156

153157
| Attribute | Description | Default Value | Example Value |
154158
| ------------------- | ------------------------------------------------------------------ | ------------- | ------------------------------ |
@@ -158,16 +162,22 @@ and prefix with "RUSTIC_REPO_OPT_", e.g. `use-password = "true"` becomes
158162
### Repository Options for cold repo (Additional) `[repository.options-cold]`
159163

160164
Additional repository options for cold repository - depending on backend. These
161-
can be only set in the config file or using env variables. For env variables use
162-
upper snake case and prefix with "RUSTIC_REPO_OPTCOLD_".
165+
can be only set in the config file or using env variables. For variables in
166+
kebab case use upper snake case and prefix with `RUSTIC_REPO_OPTCOLD_` to obtain
167+
the env variable name, for variables in lower snake case use upper snake case
168+
and prefix with `OPENDALCOLD_`.
169+
170+
see [Repository Options](#repository-options-repository)
163171

164172
### Repository Options for hot repo (Additional) `[repository.options-hot]`
165173

166174
Additional repository options for hot repository - depending on backend. These
167-
can be only set in the config file or using env variables. For env variables use
168-
upper snake case and prefix with "RUSTIC_REPO_OPTHOT_".
175+
can be only set in the config file or using env variables. For variables in
176+
kebab case use upper snake case and prefix with `RUSTIC_REPO_OPTHOT_` to obtain
177+
the env variable name, for variables in lower snake case use upper snake case
178+
and prefix with `OPENDALHOT_`.
169179

170-
see Repository Options
180+
see [Repository Options](#repository-options-repository)
171181

172182
### Repository Hooks `[repository.hooks]`
173183

config/services/b2.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ password = "<rustic_passwd>"
88
# B2 specific options
99
[repository.options]
1010
# Here, we give the required b2 options, see https://opendal.apache.org/docs/rust/opendal/services/struct.B2.html
11-
application_key_id = "my_id" # B2 application key ID
11+
application_key_id = "my_id" # B2 application key ID. Can be also set using OPENDAL_APPLICATION_KEY_ID
1212
application_key = "my_key" # B2 application key secret. Can be also set using OPENDAL_APPLICATION_KEY
13-
bucket = "bucket_name" # B2 bucket name
14-
bucket_id = "bucket_id" # B2 bucket ID
13+
bucket = "bucket_name" # B2 bucket name or in OPENDAL_BUCKET
14+
bucket_id = "bucket_id" # B2 bucket ID or in OPENDAL_BUCKET_ID
1515
# root = "/" # Set a repository root directory if not using the root directory of the bucket

0 commit comments

Comments
 (0)