Name change
This commit is contained in:
@@ -9,8 +9,8 @@ POSTGRES_MAIN_PASSWORD=password
|
|||||||
POSTGRES_MAIN_DB=my_db
|
POSTGRES_MAIN_DB=my_db
|
||||||
POSTGRES_MAIN_HOST=localhost
|
POSTGRES_MAIN_HOST=localhost
|
||||||
DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB}
|
DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB}
|
||||||
ICARUS_BASE_API_URL=https://icarus.com
|
SOARICARUS_BASE_API_URL=https://soaricarus.com
|
||||||
ICARUS_AUTH_BASE_API_URL=https://auth.icarus.com
|
SOARICARUS_AUTH_BASE_API_URL=https://auth.soaricarus.com
|
||||||
APP_ENV=development
|
APP_ENV=development
|
||||||
BACKEND_PORT=8001
|
BACKEND_PORT=8001
|
||||||
FRONTEND_URL=http://localhost:4200
|
FRONTEND_URL=http://localhost:4200
|
||||||
|
|||||||
+2
-2
@@ -9,8 +9,8 @@ POSTGRES_MAIN_PASSWORD=password
|
|||||||
POSTGRES_MAIN_DB=my_db
|
POSTGRES_MAIN_DB=my_db
|
||||||
POSTGRES_MAIN_HOST=localhost
|
POSTGRES_MAIN_HOST=localhost
|
||||||
DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB}
|
DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB}
|
||||||
ICARUS_BASE_API_URL=https://icarus.com
|
SOARICARUS_BASE_API_URL=https://soaricarus.com
|
||||||
ICARUS_AUTH_BASE_API_URL=https://auth.icarus.com
|
SOARICARUS_AUTH_BASE_API_URL=https://auth.soaricarus.com
|
||||||
APP_ENV=development
|
APP_ENV=development
|
||||||
BACKEND_PORT=8001
|
BACKEND_PORT=8001
|
||||||
FRONTEND_URL=http://localhost:4200
|
FRONTEND_URL=http://localhost:4200
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: Rust Build
|
name: sienvy Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|||||||
Generated
+8
-8
@@ -29,14 +29,6 @@ version = "0.15.7"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
|
checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "icarus_envy"
|
|
||||||
version = "0.8.0"
|
|
||||||
dependencies = [
|
|
||||||
"const_format",
|
|
||||||
"dotenvy",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "konst"
|
name = "konst"
|
||||||
version = "0.2.20"
|
version = "0.2.20"
|
||||||
@@ -70,6 +62,14 @@ dependencies = [
|
|||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sienvy"
|
||||||
|
version = "0.8.0"
|
||||||
|
dependencies = [
|
||||||
|
"const_format",
|
||||||
|
"dotenvy",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.24"
|
version = "1.0.24"
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "icarus_envy"
|
name = "sienvy"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.95"
|
rust-version = "1.95"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# sienvy
|
||||||
This is a library used to retrieve environment variables associated with various
|
This is a library used to retrieve environment variables associated with various
|
||||||
icarus projects. Rather than having the various icarus projects such as icarus,
|
icarus projects. Rather than having the various icarus projects such as icarus,
|
||||||
icarus_auth, songparser, and others, have environment code, it would be more
|
icarus_auth, songparser, and others, have environment code, it would be more
|
||||||
|
|||||||
+2
-2
@@ -40,7 +40,7 @@ pub fn get_root_directory() -> crate::EnvVar {
|
|||||||
|
|
||||||
pub fn get_icarus_base_api_url() -> crate::EnvVar {
|
pub fn get_icarus_base_api_url() -> crate::EnvVar {
|
||||||
dotenvy::dotenv().ok();
|
dotenvy::dotenv().ok();
|
||||||
let key = crate::keys::ICARUS_BASE_API_URL;
|
let key = crate::keys::SOARICARUS_BASE_API_URL;
|
||||||
let value = std::env::var(key).expect(key);
|
let value = std::env::var(key).expect(key);
|
||||||
|
|
||||||
crate::init_envvar(key, &value)
|
crate::init_envvar(key, &value)
|
||||||
@@ -48,7 +48,7 @@ pub fn get_icarus_base_api_url() -> crate::EnvVar {
|
|||||||
|
|
||||||
pub fn get_icarus_auth_base_api_url() -> crate::EnvVar {
|
pub fn get_icarus_auth_base_api_url() -> crate::EnvVar {
|
||||||
dotenvy::dotenv().ok();
|
dotenvy::dotenv().ok();
|
||||||
let key = crate::keys::ICARUS_AUTH_BASE_API_URL;
|
let key = crate::keys::SOARICARUS_AUTH_BASE_API_URL;
|
||||||
let value = std::env::var(key).expect(key);
|
let value = std::env::var(key).expect(key);
|
||||||
|
|
||||||
crate::init_envvar(key, &value)
|
crate::init_envvar(key, &value)
|
||||||
|
|||||||
+9
-9
@@ -2,7 +2,7 @@
|
|||||||
pub const DB_URL: &str = "DATABASE_URL";
|
pub const DB_URL: &str = "DATABASE_URL";
|
||||||
|
|
||||||
/// Environment key for secret main key
|
/// Environment key for secret main key
|
||||||
/// Used for the icarus app
|
/// Used for the soaricarus app
|
||||||
pub const SECRET_MAIN_KEY: &str = "SECRET_MAIN_KEY";
|
pub const SECRET_MAIN_KEY: &str = "SECRET_MAIN_KEY";
|
||||||
|
|
||||||
/// Environment key for service logins
|
/// Environment key for service logins
|
||||||
@@ -12,14 +12,14 @@ pub const SERVICE_PASSPHRASE: &str = "SERVICE_PASSPHRASE";
|
|||||||
/// Generic use of secret key that could be found in various apps
|
/// Generic use of secret key that could be found in various apps
|
||||||
pub const SECRET_KEY: &str = "SECRET_KEY";
|
pub const SECRET_KEY: &str = "SECRET_KEY";
|
||||||
|
|
||||||
/// Environment key for root directory for the icarus app
|
/// Environment key for root directory for the soaricarus app
|
||||||
pub const ROOT_DIRECTORY: &str = "ROOT_DIRECTORY";
|
pub const ROOT_DIRECTORY: &str = "ROOT_DIRECTORY";
|
||||||
|
|
||||||
/// Environment key for icarus api url
|
/// Environment key for soaricarus api url
|
||||||
pub const ICARUS_BASE_API_URL: &str = "ICARUS_BASE_API_URL";
|
pub const SOARICARUS_BASE_API_URL: &str = "SOARICARUS_BASE_API_URL";
|
||||||
|
|
||||||
/// Environment key for icarus auth api url
|
/// Environment key for soaricarus auth api url
|
||||||
pub const ICARUS_AUTH_BASE_API_URL: &str = "ICARUS_AUTH_BASE_API_URL";
|
pub const SOARICARUS_AUTH_BASE_API_URL: &str = "SOARICARUS_AUTH_BASE_API_URL";
|
||||||
|
|
||||||
/// Environment key for App status
|
/// Environment key for App status
|
||||||
pub const APP_ENV: &str = "APP_ENV";
|
pub const APP_ENV: &str = "APP_ENV";
|
||||||
@@ -41,9 +41,9 @@ pub mod error {
|
|||||||
pub const SERVICE_LOGIN: &str = concatcp!(super::SERVICE_PASSPHRASE, " ", GENERAL_ERROR);
|
pub const SERVICE_LOGIN: &str = concatcp!(super::SERVICE_PASSPHRASE, " ", GENERAL_ERROR);
|
||||||
pub const SECRET_KEY: &str = concatcp!(super::SECRET_KEY, " ", GENERAL_ERROR);
|
pub const SECRET_KEY: &str = concatcp!(super::SECRET_KEY, " ", GENERAL_ERROR);
|
||||||
pub const ROOT_DIRECTORY: &str = concatcp!(super::ROOT_DIRECTORY, " ", GENERAL_ERROR);
|
pub const ROOT_DIRECTORY: &str = concatcp!(super::ROOT_DIRECTORY, " ", GENERAL_ERROR);
|
||||||
pub const ICARUS_BASE_API_URL: &str = concatcp!(super::ICARUS_BASE_API_URL, " ", GENERAL_ERROR);
|
pub const SOARICARUS_BASE_API_URL: &str = concatcp!(super::SOARICARUS_BASE_API_URL, " ", GENERAL_ERROR);
|
||||||
pub const ICARUS_AUTH_BASE_API_URL: &str =
|
pub const SOARICARUS_AUTH_BASE_API_URL: &str =
|
||||||
concatcp!(super::ICARUS_AUTH_BASE_API_URL, " ", GENERAL_ERROR);
|
concatcp!(super::SOARICARUS_AUTH_BASE_API_URL, " ", GENERAL_ERROR);
|
||||||
pub const APP_ENV: &str = concatcp!(super::APP_ENV, " ", GENERAL_ERROR);
|
pub const APP_ENV: &str = concatcp!(super::APP_ENV, " ", GENERAL_ERROR);
|
||||||
pub const BACKEND_PORT: &str = concatcp!(super::BACKEND_PORT, " ", GENERAL_ERROR);
|
pub const BACKEND_PORT: &str = concatcp!(super::BACKEND_PORT, " ", GENERAL_ERROR);
|
||||||
pub const FRONTEND_URL: &str = concatcp!(super::FRONTEND_URL, " ", GENERAL_ERROR);
|
pub const FRONTEND_URL: &str = concatcp!(super::FRONTEND_URL, " ", GENERAL_ERROR);
|
||||||
|
|||||||
+18
-18
@@ -2,7 +2,7 @@
|
|||||||
mod tests {
|
mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_dburl() {
|
fn test_dburl() {
|
||||||
let result = icarus_envy::environment::get_db_url();
|
let result = sienvy::environment::get_db_url();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value, "postgres://myuser:password@localhost:5432/my_db",
|
result.value, "postgres://myuser:password@localhost:5432/my_db",
|
||||||
"DATABASE_URL does not match {:?}",
|
"DATABASE_URL does not match {:?}",
|
||||||
@@ -12,7 +12,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_get_secret_main_key() {
|
fn test_get_secret_main_key() {
|
||||||
let result = icarus_envy::environment::get_secret_main_key();
|
let result = sienvy::environment::get_secret_main_key();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value, "Somesupersecretpassword!!!45345435",
|
result.value, "Somesupersecretpassword!!!45345435",
|
||||||
"SECRET_MAIN_KEY does not match {:?}",
|
"SECRET_MAIN_KEY does not match {:?}",
|
||||||
@@ -22,7 +22,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_get_service_passphrase() {
|
fn test_get_service_passphrase() {
|
||||||
let result = icarus_envy::environment::get_service_passphrase();
|
let result = sienvy::environment::get_service_passphrase();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value, "T5OCHDHadAtuOWIqRAS7u8XHDDkzKT1Uvvw7mGMkNzKjVdlHA8xGdILf2adDHspO",
|
result.value, "T5OCHDHadAtuOWIqRAS7u8XHDDkzKT1Uvvw7mGMkNzKjVdlHA8xGdILf2adDHspO",
|
||||||
"SERVICE_PASSPHRASE does not match {:?}",
|
"SERVICE_PASSPHRASE does not match {:?}",
|
||||||
@@ -32,7 +32,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_get_secret_key() {
|
fn test_get_secret_key() {
|
||||||
let result = icarus_envy::environment::get_secret_key();
|
let result = sienvy::environment::get_secret_key();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value, "AmIGoodEnoughForYou?",
|
result.value, "AmIGoodEnoughForYou?",
|
||||||
"SECRET_KEY does not match {:?}",
|
"SECRET_KEY does not match {:?}",
|
||||||
@@ -42,7 +42,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_get_root_directory() {
|
fn test_get_root_directory() {
|
||||||
let result = icarus_envy::environment::get_root_directory();
|
let result = sienvy::environment::get_root_directory();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value, "/path/to/root",
|
result.value, "/path/to/root",
|
||||||
"ROOT_DIRECTORY does not match {:?}",
|
"ROOT_DIRECTORY does not match {:?}",
|
||||||
@@ -52,7 +52,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_get_icarus_base_api_url() {
|
fn test_get_icarus_base_api_url() {
|
||||||
let result = icarus_envy::environment::get_icarus_base_api_url();
|
let result = sienvy::environment::get_icarus_base_api_url();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value, "https://icarus.com",
|
result.value, "https://icarus.com",
|
||||||
"ICARUS_BASE_API_URL does not match {:?}",
|
"ICARUS_BASE_API_URL does not match {:?}",
|
||||||
@@ -62,57 +62,57 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_get_app_env() {
|
fn test_get_app_env() {
|
||||||
let result = icarus_envy::environment::get_app_env();
|
let result = sienvy::environment::get_app_env();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value,
|
result.value,
|
||||||
"development",
|
"development",
|
||||||
"{} does not match {:?}",
|
"{} does not match {:?}",
|
||||||
icarus_envy::keys::APP_ENV,
|
sienvy::keys::APP_ENV,
|
||||||
result
|
result
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_get_backend_port() {
|
fn test_get_backend_port() {
|
||||||
let result = icarus_envy::environment::get_backend_port();
|
let result = sienvy::environment::get_backend_port();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value,
|
result.value,
|
||||||
"8001",
|
"8001",
|
||||||
"{} does not match {:?}",
|
"{} does not match {:?}",
|
||||||
icarus_envy::keys::BACKEND_PORT,
|
sienvy::keys::BACKEND_PORT,
|
||||||
result
|
result
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
#[test]
|
#[test]
|
||||||
fn test_get_frontend_url() {
|
fn test_get_frontend_url() {
|
||||||
let result = icarus_envy::environment::get_frontend_url();
|
let result = sienvy::environment::get_frontend_url();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value,
|
result.value,
|
||||||
"http://localhost:4200",
|
"http://localhost:4200",
|
||||||
"{} does not match {:?}",
|
"{} does not match {:?}",
|
||||||
icarus_envy::keys::FRONTEND_URL,
|
sienvy::keys::FRONTEND_URL,
|
||||||
result
|
result
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
#[test]
|
#[test]
|
||||||
fn test_get_rust_log() {
|
fn test_get_rust_log() {
|
||||||
let result = icarus_envy::environment::get_rust_log();
|
let result = sienvy::environment::get_rust_log();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value,
|
result.value,
|
||||||
"debug",
|
"debug",
|
||||||
"{} does not match {:?}",
|
"{} does not match {:?}",
|
||||||
icarus_envy::keys::RUST_LOG,
|
sienvy::keys::RUST_LOG,
|
||||||
result
|
result
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
#[test]
|
#[test]
|
||||||
fn test_get_allowed_origins() {
|
fn test_get_allowed_origins() {
|
||||||
let result = icarus_envy::environment::get_allowed_origins();
|
let result = sienvy::environment::get_allowed_origins();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value,
|
result.value,
|
||||||
"https://soaricarus.com,https://www.soaricarus.com",
|
"https://soaricarus.com,https://www.soaricarus.com",
|
||||||
"{} does not match {:?}",
|
"{} does not match {:?}",
|
||||||
icarus_envy::keys::ALLOWED_ORIGINS,
|
sienvy::keys::ALLOWED_ORIGINS,
|
||||||
result
|
result
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ mod tests {
|
|||||||
result.key
|
result.key
|
||||||
);
|
);
|
||||||
|
|
||||||
match icarus_envy::utility::delimitize(&result) {
|
match sienvy::utility::delimitize(&result) {
|
||||||
Ok(allowed_origins) => {
|
Ok(allowed_origins) => {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
allowed_origins.len(),
|
allowed_origins.len(),
|
||||||
@@ -152,7 +152,7 @@ mod tests {
|
|||||||
];
|
];
|
||||||
|
|
||||||
for (key, value) in keys.iter() {
|
for (key, value) in keys.iter() {
|
||||||
let result = icarus_envy::environment::get_env(key);
|
let result = sienvy::environment::get_env(key);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.value, *value,
|
result.value, *value,
|
||||||
"{:?} does not match {:?}",
|
"{:?} does not match {:?}",
|
||||||
|
|||||||
Reference in New Issue
Block a user