pub struct ServerConfig {
pub bind_addr: SocketAddr,
pub storage_backend: StorageBackendType,
pub log_level: String,
pub audit_file_path: Option<String>,
pub enable_transit: bool,
pub lease_scan_interval_secs: u64,
pub disable_mlock: bool,
pub spring_oauth: Option<SpringOAuthConfig>,
}Expand description
Server configuration.
Fields§
§bind_addr: SocketAddrAddress to bind the HTTP listener to.
storage_backend: StorageBackendTypeStorage backend type.
log_level: StringLog level filter (e.g., info, debug, warn).
audit_file_path: Option<String>Path to the audit log file (if file audit is enabled).
enable_transit: boolWhether to enable the default transit engine mount.
lease_scan_interval_secs: u64Lease expiry scan interval in seconds.
disable_mlock: boolWhether to skip mlock (for development without root/CAP_IPC_LOCK).
spring_oauth: Option<SpringOAuthConfig>Spring OAuth configuration (optional — enables “Sign in with Spring”).
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Load configuration from environment variables.
Environment variables:
PORT— port to bind on (Railway convention, binds to0.0.0.0)ZVAULT_BIND_ADDR— full bind address (overridesPORT, default:127.0.0.1:8200)ZVAULT_STORAGE—memory,rocksdb,redb, orpostgres(default:memory)ZVAULT_STORAGE_PATH— path for persistent backends (default:./data)DATABASE_URL— PostgreSQL connection string (required whenZVAULT_STORAGE=postgres)ZVAULT_STORAGE_PATH— path for persistent backends (default:./data)ZVAULT_LOG_LEVEL— log filter (default:info)ZVAULT_AUDIT_FILE— path to audit log file (optional)ZVAULT_ENABLE_TRANSIT— enable transit engine (default:true)ZVAULT_LEASE_SCAN_INTERVAL— seconds between lease scans (default:60)ZVAULT_DISABLE_MLOCK— skipmlockallfor dev environments (default:false)
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
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