mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-30 18:52:31 +01:00
* **New Features** * Added an opt-in runtime liveness watchdog with diagnostics, health status, and optional automatic restart. * Added configurable stream cleanup capacity and eviction re-entry protection. * Expanded configuration and UI access for users with playlist or user permissions, with safer data sanitization. * Added testkit scenarios and reporting for playback, admission, provider limits, sharing, and VOD behavior. * Added support for experimental-branch Docker builds. * **Bug Fixes** * Improved provider prioritization, shared playback capacity, cleanup, reconnect handling, and concurrent client behavior. * Fixed playlist parsing for declared media types. * Release links now use the configured destination.
21 lines
655 B
Rust
21 lines
655 B
Rust
use crate::TestkitError;
|
|
|
|
pub fn environment(name: &str) -> Result<String, TestkitError> {
|
|
if name.trim().is_empty() {
|
|
return Err(TestkitError::Configuration("secret environment variable name is empty".to_owned()));
|
|
}
|
|
std::env::var(name)
|
|
.map_err(|_| TestkitError::Configuration(format!("required secret environment variable {name} is not set")))
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use super::*;
|
|
|
|
#[test]
|
|
fn missing_variable_does_not_expose_a_value() {
|
|
let error = environment("TULIPROX_TESTKIT_MISSING_SECRET").unwrap_err().to_string();
|
|
assert!(error.contains("TULIPROX_TESTKIT_MISSING_SECRET"));
|
|
}
|
|
}
|