Skip to content

Commit

Permalink
refactor: [#596] merge E2E and prod common env var constants
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed May 22, 2024
1 parent fc1528d commit b8d0f98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ use crate::config::{Configuration, Info};

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

/// Token needed to communicate with the Torrust Tracker
const ENV_VAR_API_ADMIN_TOKEN: &str = "TORRUST_INDEX_TRACKER_API_TOKEN";
pub const ENV_VAR_API_ADMIN_TOKEN: &str = "TORRUST_INDEX_TRACKER_API_TOKEN";

/// Secret key used to encrypt and decrypt
const ENV_VAR_AUTH_SECRET_KEY: &str = "TORRUST_INDEX_AUTH_SECRET_KEY";
pub const ENV_VAR_AUTH_SECRET_KEY: &str = "TORRUST_INDEX_AUTH_SECRET_KEY";

/// The `index.toml` file location.
pub const ENV_VAR_PATH_CONFIG: &str = "TORRUST_INDEX_PATH_CONFIG";
Expand Down
14 changes: 1 addition & 13 deletions tests/e2e/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,9 @@

// Environment variables

use torrust_index::bootstrap::config::{ENV_VAR_API_ADMIN_TOKEN, ENV_VAR_AUTH_SECRET_KEY, ENV_VAR_CONFIG, ENV_VAR_PATH_CONFIG};
use torrust_index::config::{Configuration, Info};

/// The whole `index.toml` file content. It has priority over the config file.
/// Even if the file is not on the default path.
const ENV_VAR_CONFIG: &str = "TORRUST_INDEX_CONFIG";

/// Token needed to communicate with the Torrust Tracker
const ENV_VAR_API_ADMIN_TOKEN: &str = "TORRUST_INDEX_TRACKER_API_TOKEN";

/// Secret key used to encrypt and decrypt
const ENV_VAR_AUTH_SECRET_KEY: &str = "TORRUST_INDEX_AUTH_SECRET_KEY";

/// The `index.toml` file location.
pub const ENV_VAR_PATH_CONFIG: &str = "TORRUST_INDEX_PATH_CONFIG";

// Default values
pub const DEFAULT_PATH_CONFIG: &str = "./share/default/config/index.development.sqlite3.toml";

Expand Down

0 comments on commit b8d0f98

Please sign in to comment.