pub struct ServerConfig {Show 14 fields
pub bind: SocketAddr,
pub storage_backend: StorageBackend,
pub sqlite_path: Option<PathBuf>,
pub postgres_url: Option<String>,
pub postgres_pool: PostgresPoolConfig,
pub artifacts_url: Option<String>,
pub api_keys: Vec<ApiKeyConfig>,
pub jwt: Option<JwtConfig>,
pub oidc_configs: Vec<OidcConfig>,
pub cors: bool,
pub timeout_seconds: u64,
pub local_mode: bool,
pub retention_days: u64,
pub cleanup_interval_hours: u64,
}Expand description
Server configuration.
Fields§
§bind: SocketAddrBind address (e.g., “0.0.0.0:8080”)
storage_backend: StorageBackendStorage backend type
sqlite_path: Option<PathBuf>SQLite database path (when storage_backend is Sqlite)
postgres_url: Option<String>PostgreSQL connection URL (when storage_backend is Postgres)
postgres_pool: PostgresPoolConfigPostgreSQL connection pool configuration
artifacts_url: Option<String>Artifact storage URL (e.g., s3://bucket/prefix)
api_keys: Vec<ApiKeyConfig>API keys for authentication
jwt: Option<JwtConfig>Optional JWT validation settings.
oidc_configs: Vec<OidcConfig>OIDC provider configurations (GitHub, GitLab, custom).
cors: boolEnable CORS for all origins
timeout_seconds: u64Request timeout in seconds
local_mode: boolLocal mode: disable authentication for single-user local use.
retention_days: u64Artifact retention period in days (0 = no cleanup).
cleanup_interval_hours: u64Interval between background cleanup passes (in hours).
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn storage_backend(self, backend: StorageBackend) -> Self
pub fn storage_backend(self, backend: StorageBackend) -> Self
Sets the storage backend.
Sourcepub fn sqlite_path(self, path: impl Into<PathBuf>) -> Self
pub fn sqlite_path(self, path: impl Into<PathBuf>) -> Self
Sets the SQLite database path.
Sourcepub fn postgres_url(self, url: impl Into<String>) -> Self
pub fn postgres_url(self, url: impl Into<String>) -> Self
Sets the PostgreSQL connection URL.
Sourcepub fn postgres_pool(self, pool_config: PostgresPoolConfig) -> Self
pub fn postgres_pool(self, pool_config: PostgresPoolConfig) -> Self
Sets the PostgreSQL connection pool configuration.
Sourcepub fn artifacts_url(self, url: impl Into<String>) -> Self
pub fn artifacts_url(self, url: impl Into<String>) -> Self
Sets the artifacts storage URL.
Sourcepub fn api_key(self, key: impl Into<String>, role: Role) -> Self
pub fn api_key(self, key: impl Into<String>, role: Role) -> Self
Adds an API key with a specific role.
Sourcepub fn scoped_api_key(
self,
key: impl Into<String>,
role: Role,
project: impl Into<String>,
benchmark_regex: Option<String>,
) -> Self
pub fn scoped_api_key( self, key: impl Into<String>, role: Role, project: impl Into<String>, benchmark_regex: Option<String>, ) -> Self
Adds a scoped API key restricted to a project and optional benchmark regex.
Sourcepub fn oidc(self, config: OidcConfig) -> Self
pub fn oidc(self, config: OidcConfig) -> Self
Adds an OIDC provider configuration.
Multiple providers can be registered (e.g. GitHub + GitLab).
Sourcepub fn local_mode(self, enabled: bool) -> Self
pub fn local_mode(self, enabled: bool) -> Self
Enables or disables local mode (no authentication).
Sourcepub fn retention_days(self, days: u64) -> Self
pub fn retention_days(self, days: u64) -> Self
Sets the artifact retention period in days. 0 means no cleanup.
Sourcepub fn cleanup_interval_hours(self, hours: u64) -> Self
pub fn cleanup_interval_hours(self, hours: u64) -> Self
Sets the interval (in hours) between background cleanup passes.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.