pub struct ServerConfig {Show 14 fields
pub enabled: bool,
pub port: u16,
pub bind: String,
pub auth_token: Option<String>,
pub rate_limit: RateLimitConfig,
pub cors_origins: Vec<String>,
pub max_request_body: usize,
pub webhook_secret: Option<String>,
pub outbox_enabled: bool,
pub outbox_max_attempts: i64,
pub outbox_retain_days: u32,
pub tls_enabled: bool,
pub tls_cert_dir: String,
pub tls_renew_threshold_days: u32,
}Fields§
§enabled: bool§port: u16§bind: String§auth_token: Option<String>Bearer token for API authentication.
If set, all /api/* routes require Authorization: Bearer
rate_limit: RateLimitConfig§cors_origins: Vec<String>Allowed CORS origins. If empty, defaults to localhost only (any port, http/https, 127.0.0.1, localhost, and [::1]).
max_request_body: usizeMaximum request body size in bytes. Requests larger than this return 413 Payload Too Large. Default: 10MB
webhook_secret: Option<String>HMAC-SHA256 secret for webhook signature verification. When set, incoming webhook requests must include X-Signature-256 header. Supports ${ENV_VAR} expansion.
outbox_enabled: boolEnable durable outbound message queue with retry on send failure. Default: false.
outbox_max_attempts: i64Maximum retry attempts for outbox messages. Default: 5.
outbox_retain_days: u32Days to retain delivered messages before cleanup. Default: 7.
tls_enabled: boolEnable auto-generated TLS certificates for HTTPS. Default: false.
Requires the tls feature on localgpt-server.
tls_cert_dir: StringDirectory for TLS certificate storage. Default: ~/.config/localgpt/certs
tls_renew_threshold_days: u32Regenerate certificates when they expire within this many days. Default: 30.
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
Source§impl Default for ServerConfig
impl Default for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().