Skip to content

Commit 97e3634

Browse files
committed
refactor: [#596] rename env vars
``` TORRUST_INDEX_CONFIG -> TORRUST_INDEX_CONFIG_TOML TORRUST_INDEX_PATH_CONFIG -> TORRUST_INDEX_CONFIG_TOML_PATH TORRUST_INDEX_TRACKER_API_TOKEN -> TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN TORRUST_INDEX_AUTH_SECRET_KEY -> TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY ```
1 parent 5910fda commit 97e3634

20 files changed

+57
-55
lines changed

.env.local

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
DATABASE_URL=sqlite://storage/database/data.db?mode=rwc
2-
TORRUST_INDEX_CONFIG=
3-
TORRUST_INDEX_AUTH_SECRET_KEY=MaxVerstappenWC2021
2+
TORRUST_INDEX_CONFIG_TOML=
3+
TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY=MaxVerstappenWC2021
44
USER_ID=1000
55
TORRUST_TRACKER_CONFIG_TOML=
66
TORRUST_TRACKER_CONFIG_OVERRIDE_DB_DRIVER=Sqlite3

Containerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ FROM gcr.io/distroless/cc-debian12:debug as runtime
9797
RUN ["/busybox/cp", "-sp", "/busybox/sh","/busybox/cat","/busybox/ls","/busybox/env", "/bin/"]
9898
COPY --from=gcc --chmod=0555 /usr/local/bin/su-exec /bin/su-exec
9999

100-
ARG TORRUST_INDEX_PATH_CONFIG="/etc/torrust/index/index.toml"
100+
ARG TORRUST_INDEX_CONFIG_TOML_PATH="/etc/torrust/index/index.toml"
101101
ARG TORRUST_INDEX_DATABASE_DRIVER="Sqlite3"
102102
ARG USER_ID=1000
103103
ARG API_PORT=3001
104104
ARG IMPORTER_API_PORT=3002
105105

106-
ENV TORRUST_INDEX_PATH_CONFIG=${TORRUST_INDEX_PATH_CONFIG}
106+
ENV TORRUST_INDEX_CONFIG_TOML_PATH=${TORRUST_INDEX_CONFIG_TOML_PATH}
107107
ENV TORRUST_INDEX_DATABASE_DRIVER=${TORRUST_INDEX_DATABASE_DRIVER}
108108
ENV USER_ID=${USER_ID}
109109
ENV API_PORT=${API_PORT}

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ cp ./share/default/config/index.development.sqlite3.toml ./storage/index/etc/ind
8383
vim ./storage/index/etc/index.toml
8484

8585
# Run the index with the updated configuration:
86-
TORRUST_INDEX_PATH_CONFIG="./storage/index/etc/index.toml" cargo run
86+
TORRUST_INDEX_CONFIG_TOML_PATH="./storage/index/etc/index.toml" cargo run
8787
```
8888

8989
_Optionally, you may choose to supply the entire configuration as an environmental variable:_
9090

9191
```sh
9292
# Use a configuration supplied on an environmental variable:
93-
TORRUST_INDEX_CONFIG=$(cat "./storage/index/etc/index.toml") cargo run
93+
TORRUST_INDEX_CONFIG_TOML=$(cat "./storage/index/etc/index.toml") cargo run
9494
```
9595

9696
_For deployment, you __should__ override:
@@ -100,9 +100,9 @@ _For deployment, you __should__ override:
100100
```sh
101101
# Please use the secret that you generated for the torrust-tracker configuration.
102102
# Override secret in configuration using an environmental variable
103-
TORRUST_INDEX_CONFIG=$(cat "./storage/index/etc/index.toml") \
104-
TORRUST_INDEX_TRACKER_API_TOKEN=$(cat "./storage/tracker/lib/tracker_api_admin_token.secret") \
105-
TORRUST_INDEX_AUTH_SECRET_KEY="MaxVerstappenWC2021" \
103+
TORRUST_INDEX_CONFIG_TOML=$(cat "./storage/index/etc/index.toml") \
104+
TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN=$(cat "./storage/tracker/lib/tracker_api_admin_token.secret") \
105+
TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY="MaxVerstappenWC2021" \
106106
cargo run
107107
```
108108

compose.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ services:
99
tty: true
1010
environment:
1111
- USER_ID=${USER_ID}
12-
- TORRUST_INDEX_CONFIG=${TORRUST_INDEX_CONFIG}
12+
- TORRUST_INDEX_CONFIG_TOML=${TORRUST_INDEX_CONFIG_TOML}
1313
- TORRUST_INDEX_DATABASE=${TORRUST_INDEX_DATABASE:-e2e_testing_sqlite3}
1414
- TORRUST_INDEX_DATABASE_DRIVER=${TORRUST_INDEX_DATABASE_DRIVER:-sqlite3}
15-
- TORRUST_INDEX_TRACKER_API_TOKEN=${TORRUST_INDEX_TRACKER_API_TOKEN:-MyAccessToken}
16-
- TORRUST_INDEX_AUTH_SECRET_KEY=${TORRUST_INDEX_AUTH_SECRET_KEY:-MaxVerstappenWC2021}
15+
- TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN=${TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN:-MyAccessToken}
16+
- TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY=${TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY:-MaxVerstappenWC2021}
1717
networks:
1818
- server_side
1919
ports:
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

3-
TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.e2e.container.mysql.toml) \
3+
TORRUST_INDEX_CONFIG_TOML=$(cat ./share/default/config/index.e2e.container.mysql.toml) \
44
TORRUST_TRACKER_CONFIG_TOML=$(cat ./share/default/config/tracker.e2e.container.sqlite3.toml) \
55
docker compose down

contrib/dev-tools/container/e2e/mysql/e2e-env-up.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.e2e.container.mysql.toml
44
docker compose build
55

66
USER_ID=${USER_ID:-1000} \
7-
TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.e2e.container.mysql.toml) \
7+
TORRUST_INDEX_CONFIG_TOML=$(cat ./share/default/config/index.e2e.container.mysql.toml) \
88
TORRUST_INDEX_DATABASE="torrust_index_e2e_testing" \
99
TORRUST_INDEX_DATABASE_DRIVER="mysql" \
10-
TORRUST_INDEX_TRACKER_API_TOKEN="MyAccessToken" \
10+
TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN="MyAccessToken" \
1111
TORRUST_INDEX_MYSQL_DATABASE="torrust_index_e2e_testing" \
1212
TORRUST_TRACKER_CONFIG_TOML=$(cat ./share/default/config/tracker.e2e.container.sqlite3.toml) \
1313
TORRUST_TRACKER_DATABASE="e2e_testing_sqlite3" \

contrib/dev-tools/container/e2e/mysql/run-e2e-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ docker ps
4040

4141
# Run E2E tests with shared app instance
4242
TORRUST_INDEX_E2E_SHARED=true \
43-
TORRUST_INDEX_PATH_CONFIG="./share/default/config/index.e2e.container.mysql.toml" \
43+
TORRUST_INDEX_CONFIG_TOML_PATH="./share/default/config/index.e2e.container.mysql.toml" \
4444
TORRUST_INDEX_E2E_DB_CONNECT_URL="mysql://root:root_secret_password@localhost:3306/torrust_index_e2e_testing" \
4545
cargo test ||
4646
{
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

3-
TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.e2e.container.sqlite3.toml) \
3+
TORRUST_INDEX_CONFIG_TOML=$(cat ./share/default/config/index.e2e.container.sqlite3.toml) \
44
TORRUST_TRACKER_CONFIG_TOML=$(cat ./share/default/config/tracker.e2e.container.sqlite3.toml) \
55
docker compose down

contrib/dev-tools/container/e2e/sqlite/e2e-env-up.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/bin/bash
22

3-
TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.e2e.container.sqlite3.toml) \
3+
TORRUST_INDEX_CONFIG_TOML=$(cat ./share/default/config/index.e2e.container.sqlite3.toml) \
44
docker compose build
55

66
USER_ID=${USER_ID:-1000} \
7-
TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.e2e.container.sqlite3.toml) \
7+
TORRUST_INDEX_CONFIG_TOML=$(cat ./share/default/config/index.e2e.container.sqlite3.toml) \
88
TORRUST_INDEX_DATABASE="e2e_testing_sqlite3" \
99
TORRUST_INDEX_DATABASE_DRIVER="sqlite3" \
10-
TORRUST_INDEX_TRACKER_API_TOKEN="MyAccessToken" \
11-
TORRUST_INDEX_AUTH_SECRET_KEY="MaxVerstappenWC2021" \
10+
TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN="MyAccessToken" \
11+
TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY="MaxVerstappenWC2021" \
1212
TORRUST_TRACKER_CONFIG_TOML=$(cat ./share/default/config/tracker.e2e.container.sqlite3.toml) \
1313
TORRUST_TRACKER_DATABASE="e2e_testing_sqlite3" \
1414
TORRUST_TRACKER_CONFIG_OVERRIDE_DB_DRIVER="Sqlite3" \

contrib/dev-tools/container/e2e/sqlite/run-e2e-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ docker ps
3838

3939
# Run E2E tests with shared app instance
4040
TORRUST_INDEX_E2E_SHARED=true \
41-
TORRUST_INDEX_PATH_CONFIG="./share/default/config/index.e2e.container.sqlite3.toml" \
41+
TORRUST_INDEX_CONFIG_TOML_PATH="./share/default/config/index.e2e.container.sqlite3.toml" \
4242
TORRUST_INDEX_E2E_DB_CONNECT_URL="sqlite://./storage/index/lib/database/e2e_testing_sqlite3.db?mode=rwc" \
4343
cargo test ||
4444
{

contrib/dev-tools/container/run.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

33
USER_ID=${USER_ID:-1000}
4-
TORRUST_INDEX_CONFIG=$(cat config.toml)
4+
TORRUST_INDEX_CONFIG_TOML=$(cat config.toml)
55

66
docker run -it \
77
--user="$USER_ID" \
88
--publish 3001:3001/tcp \
9-
--env TORRUST_INDEX_CONFIG="$TORRUST_INDEX_CONFIG" \
9+
--env TORRUST_INDEX_CONFIG_TOML="$TORRUST_INDEX_CONFIG_TOML" \
1010
--volume "$(pwd)/storage":"/app/storage" \
1111
torrust-index

docs/containers.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ Environmental variables are loaded through the `--env`, in the format `--env VAR
147147

148148
The following environmental variables can be set:
149149

150-
- `TORRUST_INDEX_PATH_CONFIG` - The in-container path to the index configuration file, (default: `"/etc/torrust/index/index.toml"`).
151-
- `TORRUST_INDEX_TRACKER_API_TOKEN` - Override of the admin token. If set, this value overrides any value set in the config.
152-
- `TORRUST_INDEX_AUTH_SECRET_KEY` - Override of the auth secret key. If set, this value overrides any value set in the config.
150+
- `TORRUST_INDEX_CONFIG_TOML_PATH` - The in-container path to the index configuration file, (default: `"/etc/torrust/index/index.toml"`).
151+
- `TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN` - Override of the admin token. If set, this value overrides any value set in the config.
152+
- `TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY` - Override of the auth secret key. If set, this value overrides any value set in the config.
153153
- `TORRUST_INDEX_DATABASE_DRIVER` - The database type used for the container, (options: `sqlite3`, `mysql`, default `sqlite3`). Please Note: This dose not override the database configuration within the `.toml` config file.
154-
- `TORRUST_INDEX_CONFIG` - Load config from this environmental variable instead from a file, (i.e: `TORRUST_INDEX_CONFIG=$(cat index-index.toml)`).
154+
- `TORRUST_INDEX_CONFIG_TOML` - Load config from this environmental variable instead from a file, (i.e: `TORRUST_INDEX_CONFIG_TOML=$(cat index-index.toml)`).
155155
- `USER_ID` - The user id for the runtime crated `torrust` user. Please Note: This user id should match the ownership of the host-mapped volumes, (default `1000`).
156156
- `API_PORT` - The port for the index API. This should match the port used in the configuration, (default `3001`).
157157

@@ -201,8 +201,8 @@ mkdir -p ./storage/index/lib/ ./storage/index/log/ ./storage/index/etc/
201201

202202
## Run Torrust Index Container Image
203203
docker run -it \
204-
--env TORRUST_INDEX_TRACKER_API_TOKEN="MySecretToken" \
205-
--env TORRUST_INDEX_AUTH_SECRET_KEY="MaxVerstappenWC2021" \
204+
--env TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN="MySecretToken" \
205+
--env TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY="MaxVerstappenWC2021" \
206206
--env USER_ID="$(id -u)" \
207207
--publish 0.0.0.0:3001:3001/tcp \
208208
--volume ./storage/index/lib:/var/lib/torrust/index:Z \
@@ -222,7 +222,7 @@ mkdir -p ./storage/index/lib/ ./storage/index/log/ ./storage/index/etc/
222222

223223
## Run Torrust Index Container Image
224224
podman run -it \
225-
--env TORRUST_INDEX_TRACKER_API_TOKEN="MySecretToken" \
225+
--env TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN="MySecretToken" \
226226
--env USER_ID="$(id -u)" \
227227
--publish 0.0.0.0:3001:3001/tcp \
228228
--volume ./storage/index/lib:/var/lib/torrust/index:Z \

share/default/config/index.container.mysql.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Please override the following settings with environmental variable!
2-
# tracker::token -> `TORRUST_INDEX_TRACKER_API_TOKEN`
3-
# auth::secret_key -> `TORRUST_INDEX_AUTH_SECRET_KEY`
2+
# tracker::token -> `TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN`
3+
# auth::secret_key -> `TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY`
44

55
log_level = "info"
66

share/default/config/index.container.sqlite3.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ log_level = "info"
44
name = "Torrust"
55

66
# Please override the tracker token setting the
7-
# `TORRUST_INDEX_TRACKER_API_TOKEN`
7+
# `TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN`
88
# environmental variable!
99

1010
[tracker]

share/default/config/index.e2e.container.mysql.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Please override the following settings with environmental variable!
2-
# tracker::token -> `TORRUST_INDEX_TRACKER_API_TOKEN`
3-
# auth::secret_key -> `TORRUST_INDEX_AUTH_SECRET_KEY`
2+
# tracker::token -> `TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN`
3+
# auth::secret_key -> `TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY`
44

55
log_level = "info"
66

share/default/config/index.e2e.container.sqlite3.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Please override the following settings with environmental variable!
2-
# tracker::token -> `TORRUST_INDEX_TRACKER_API_TOKEN`
3-
# auth::secret_key -> `TORRUST_INDEX_AUTH_SECRET_KEY`
2+
# tracker::token -> `TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN`
3+
# auth::secret_key -> `TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY`
44

55
log_level = "info"
66

src/bootstrap/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub const ENV_VAR_CORS_PERMISSIVE: &str = "TORRUST_INDEX_API_CORS_PERMISSIVE";
1717
/// There are two methods to inject the configuration:
1818
///
1919
/// 1. By using a config file: `index.toml`.
20-
/// 2. Environment variable: `TORRUST_INDEX_CONFIG`. The variable contains the same contents as the `index.toml` file.
20+
/// 2. Environment variable: `TORRUST_INDEX_CONFIG_TOML`. The variable contains the same contents as the `index.toml` file.
2121
///
2222
/// Environment variable has priority over the config file.
2323
///
@@ -26,7 +26,7 @@ pub const ENV_VAR_CORS_PERMISSIVE: &str = "TORRUST_INDEX_API_CORS_PERMISSIVE";
2626
/// # Panics
2727
///
2828
/// Will panic if it can't load the configuration from either
29-
/// `./index.toml` file or the env var `TORRUST_INDEX_CONFIG`.
29+
/// `./index.toml` file or the env var `TORRUST_INDEX_CONFIG_TOML`.
3030
#[must_use]
3131
pub fn initialize_configuration() -> Configuration {
3232
let info = Info::new(DEFAULT_PATH_CONFIG.to_string()).unwrap();

src/config/mod.rs

+12-10
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,19 @@ const CONFIG_OVERRIDE_SEPARATOR: &str = "__";
3737

3838
/// The whole `index.toml` file content. It has priority over the config file.
3939
/// Even if the file is not on the default path.
40-
pub const ENV_VAR_CONFIG: &str = "TORRUST_INDEX_CONFIG";
40+
pub const ENV_VAR_CONFIG_TOML: &str = "TORRUST_INDEX_CONFIG_TOML";
4141

42-
/// Token needed to communicate with the Torrust Tracker
43-
pub const ENV_VAR_API_ADMIN_TOKEN: &str = "TORRUST_INDEX_TRACKER_API_TOKEN";
42+
/// The `index.toml` file location.
43+
pub const ENV_VAR_CONFIG_TOML_PATH: &str = "TORRUST_INDEX_CONFIG_TOML_PATH";
44+
45+
/// Token needed to communicate with the Torrust Tracker.
46+
/// Deprecated. Use `TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN`.
47+
pub const ENV_VAR_TRACKER_API_ADMIN_TOKEN: &str = "TORRUST_INDEX_TRACKER_API_TOKEN";
4448

4549
/// Secret key used to encrypt and decrypt
50+
/// Deprecated. Use `TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY`.
4651
pub const ENV_VAR_AUTH_SECRET_KEY: &str = "TORRUST_INDEX_AUTH_SECRET_KEY";
4752

48-
/// The `index.toml` file location.
49-
pub const ENV_VAR_PATH_CONFIG: &str = "TORRUST_INDEX_PATH_CONFIG";
50-
5153
/// Information required for loading config
5254
#[derive(Debug, Default, Clone)]
5355
pub struct Info {
@@ -66,9 +68,9 @@ impl Info {
6668
///
6769
#[allow(clippy::needless_pass_by_value)]
6870
pub fn new(default_config_toml_path: String) -> Result<Self, Error> {
69-
let env_var_config_toml = ENV_VAR_CONFIG.to_string();
70-
let env_var_config_toml_path = ENV_VAR_PATH_CONFIG.to_string();
71-
let env_var_tracker_api_token = ENV_VAR_API_ADMIN_TOKEN.to_string();
71+
let env_var_config_toml = ENV_VAR_CONFIG_TOML.to_string();
72+
let env_var_config_toml_path = ENV_VAR_CONFIG_TOML_PATH.to_string();
73+
let env_var_tracker_api_admin_token = ENV_VAR_TRACKER_API_ADMIN_TOKEN.to_string();
7274
let env_var_auth_secret_key = ENV_VAR_AUTH_SECRET_KEY.to_string();
7375

7476
let config_toml = if let Ok(config_toml) = env::var(env_var_config_toml) {
@@ -86,7 +88,7 @@ impl Info {
8688
default_config_toml_path
8789
};
8890

89-
let tracker_api_token = env::var(env_var_tracker_api_token).ok();
91+
let tracker_api_token = env::var(env_var_tracker_api_admin_token).ok();
9092
let auth_secret_key = env::var(env_var_auth_secret_key).ok();
9193

9294
Ok(Self {

src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -215,18 +215,18 @@
215215
//!
216216
//! For more information about configuration you can visit the documentation for the [`config`]) module.
217217
//!
218-
//! Alternatively to the `config.toml` file you can use one environment variable `TORRUST_INDEX_CONFIG` to pass the configuration to the tracker:
218+
//! Alternatively to the `config.toml` file you can use one environment variable `TORRUST_INDEX_CONFIG_TOML` to pass the configuration to the tracker:
219219
//!
220220
//! ```text
221-
//! TORRUST_INDEX_CONFIG=$(cat config.toml)
221+
//! TORRUST_INDEX_CONFIG_TOML=$(cat config.toml)
222222
//! cargo run
223223
//! ```
224224
//!
225225
//! In the previous example you are just setting the env var with the contents of the `config.toml` file.
226226
//!
227227
//! The env var contains the same data as the `config.toml`. It's particularly useful in you are [running the index with docker](https://github.com/torrust/torrust-index/tree/develop/docker).
228228
//!
229-
//! > **NOTICE**: The `TORRUST_INDEX_CONFIG` env var has priority over the `config.toml` file.
229+
//! > **NOTICE**: The `TORRUST_INDEX_CONFIG_TOML` env var has priority over the `config.toml` file.
230230
//!
231231
//! > **NOTICE**: You can also change the location for the configuration file with the `TORRUST_INDEX_CONFIG_PATH` env var.
232232
//!

tests/e2e/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub const ENV_VAR_DB_CONNECT_URL: &str = "TORRUST_INDEX_E2E_DB_CONNECT_URL";
2121
/// There are two methods to inject the configuration:
2222
///
2323
/// 1. By using a config file: `index.toml`.
24-
/// 2. Environment variable: `TORRUST_INDEX_CONFIG`. The variable contains the same contents as the `index.toml` file.
24+
/// 2. Environment variable: `TORRUST_INDEX_CONFIG_TOML`. The variable contains the same contents as the `index.toml` file.
2525
///
2626
/// Environment variable has priority over the config file.
2727
///
@@ -30,7 +30,7 @@ pub const ENV_VAR_DB_CONNECT_URL: &str = "TORRUST_INDEX_E2E_DB_CONNECT_URL";
3030
/// # Panics
3131
///
3232
/// Will panic if it can't load the configuration from either
33-
/// `./index.toml` file or the env var `TORRUST_INDEX_CONFIG`.
33+
/// `./index.toml` file or the env var `TORRUST_INDEX_CONFIG_TOML`.
3434
#[must_use]
3535
pub fn initialize_configuration() -> Configuration {
3636
let info = Info::new(DEFAULT_PATH_CONFIG.to_string()).unwrap();

0 commit comments

Comments
 (0)