pub struct Config {
pub public_host: String,
pub public_port: u16,
pub worker_threads: usize,
pub listen_backlog: u32,
pub files_dir: PathBuf,
pub backend_url: String,
pub api_key: String,
pub allowed_origins: Vec<String>,
pub min_free_space_bytes: u64,
}Expand description
Holds every setting juicehost needs to run.
All values come from environment variables with sensible fallbacks. Check Config::from_env to see what variables are available.
Fields§
§public_host: String§public_port: u16§worker_threads: usize§listen_backlog: u32§files_dir: PathBuf§backend_url: String§api_key: String§allowed_origins: Vec<String>§min_free_space_bytes: u64Implementations§
Source§impl Config
impl Config
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Load settings from the environment.
Environment variables it reads: PUBLIC_HOST (default 127.0.0.1) – TCP bind address PUBLIC_PORT (default 6402) – TCP bind port, QUIC on UDP 6403 WORKER_THREADS (default 8) – Tokio worker threads LISTEN_BACKLOG (default 4096) – TCP listen backlog FILES_DIR (default ./files) – where files are stored BACKEND_URL (default http://127.0.0.1:6401) – juiceback URL JUICEHOST_API_KEY – shared secret for internal API auth ALLOWED_ORIGINS (default BACKEND_URL) – comma separated origin whitelist MIN_FREE_SPACE_GB (default 5) – minimum free disk space
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more