Name change #3

Merged
phoenix merged 4 commits from name_change into main 2026-07-14 16:33:01 -04:00
11 changed files with 78 additions and 54 deletions
+2 -2
View File
@@ -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
View File
@@ -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 -1
View File
@@ -20,7 +20,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: 1.96.1 toolchain: 1.97
components: cargo components: cargo
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
+6 -6
View File
@@ -1,4 +1,4 @@
name: Rust Build name: sienvy Build
on: on:
push: push:
@@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
toolchain: 1.96.1 toolchain: 1.97
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- run: cargo check - run: cargo check
@@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
toolchain: 1.96.1 toolchain: 1.97
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- run: cargo test - run: cargo test
@@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
toolchain: 1.96.1 toolchain: 1.97
- run: rustup component add rustfmt - run: rustup component add rustfmt
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check - run: cargo fmt --all -- --check
@@ -50,7 +50,7 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
toolchain: 1.96.1 toolchain: 1.97
- run: rustup component add clippy - run: rustup component add clippy
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- run: cargo clippy -- -D warnings - run: cargo clippy -- -D warnings
@@ -62,6 +62,6 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
toolchain: 1.96.1 toolchain: 1.97
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- run: cargo build - run: cargo build
Generated
+8 -8
View File
@@ -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
View File
@@ -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"
+22
View File
@@ -0,0 +1,22 @@
Copyright (c) 2026 Kun Deng.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
+1
View File
@@ -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
+4 -4
View File
@@ -38,17 +38,17 @@ pub fn get_root_directory() -> crate::EnvVar {
crate::init_envvar(key, &value) crate::init_envvar(key, &value)
} }
pub fn get_icarus_base_api_url() -> crate::EnvVar { pub fn get_soaricarus_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)
} }
pub fn get_icarus_auth_base_api_url() -> crate::EnvVar { pub fn get_soaricarus_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)
+10 -9
View File
@@ -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,10 @@ 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 =
pub const ICARUS_AUTH_BASE_API_URL: &str = concatcp!(super::SOARICARUS_BASE_API_URL, " ", GENERAL_ERROR);
concatcp!(super::ICARUS_AUTH_BASE_API_URL, " ", GENERAL_ERROR); pub const SOARICARUS_AUTH_BASE_API_URL: &str =
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);
+21 -21
View File
@@ -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 {:?}",
@@ -51,68 +51,68 @@ mod tests {
} }
#[test] #[test]
fn test_get_icarus_base_api_url() { fn test_get_soaricarus_base_api_url() {
let result = icarus_envy::environment::get_icarus_base_api_url(); let result = sienvy::environment::get_soaricarus_base_api_url();
assert_eq!( assert_eq!(
result.value, "https://icarus.com", result.value, "https://soaricarus.com",
"ICARUS_BASE_API_URL does not match {:?}", "SOARICARUS_BASE_API_URL does not match {:?}",
result result
) )
} }
#[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 {:?}",