All checks were successful
Run Check Script / check (pull_request) Successful in 59s
Co-authored-by: Jean-Gabriel Gill-Couture <jeangabriel.gc@gmail.com> Co-authored-by: Ian Letourneau <ian@noma.to> Reviewed-on: #130 Reviewed-by: Ian Letourneau <ian@noma.to> Co-authored-by: Jean-Gabriel Gill-Couture <jg@nationtech.io> Co-committed-by: Jean-Gabriel Gill-Couture <jg@nationtech.io>
26 lines
991 B
Rust
26 lines
991 B
Rust
pub mod secret;
|
|
|
|
use lazy_static::lazy_static;
|
|
use std::path::PathBuf;
|
|
|
|
lazy_static! {
|
|
pub static ref HARMONY_DATA_DIR: PathBuf = directories::BaseDirs::new()
|
|
.unwrap()
|
|
.data_dir()
|
|
.join("harmony");
|
|
pub static ref REGISTRY_URL: String =
|
|
std::env::var("HARMONY_REGISTRY_URL").unwrap_or_else(|_| "hub.nationtech.io".to_string());
|
|
pub static ref REGISTRY_PROJECT: String =
|
|
std::env::var("HARMONY_REGISTRY_PROJECT").unwrap_or_else(|_| "harmony".to_string());
|
|
pub static ref DRY_RUN: bool =
|
|
std::env::var("HARMONY_DRY_RUN").is_ok_and(|value| value.parse().unwrap_or(false));
|
|
pub static ref DEFAULT_DATABASE_URL: String = "sqlite://harmony.sqlite".to_string();
|
|
pub static ref DATABASE_URL: String = std::env::var("HARMONY_DATABASE_URL")
|
|
.map(|value| if value.is_empty() {
|
|
(*DEFAULT_DATABASE_URL).clone()
|
|
} else {
|
|
value
|
|
})
|
|
.unwrap_or((*DEFAULT_DATABASE_URL).clone());
|
|
}
|