pub struct ServerConfig {Show 17 fields
pub domain: Option<String>,
pub origin: Option<String>,
pub db_path: Option<String>,
pub tls_chain: Option<String>,
pub tls_key: Option<String>,
pub tls_client_ca: Option<String>,
pub bindaddress: Option<String>,
pub ldapbindaddress: Option<String>,
pub role: ServerRole,
pub log_level: Option<LogLevel>,
pub online_backup: Option<OnlineBackup>,
pub trust_x_forward_for: Option<bool>,
pub db_fs_type: Option<FsType>,
pub adminbindpath: Option<String>,
pub thread_count: Option<usize>,
pub repl_config: Option<ReplicationConfiguration>,
pub otel_grpc_url: Option<String>,
/* private fields */
}
Expand description
This is the Server Configuration as read from server.toml
or environment variables.
Fields noted as “REQUIRED” are required for the server to start, even if they show as optional due to how file parsing works.
If you want to set these as environment variables, prefix them with KANIDM_
and they will be picked up. This does not include replication peer config.
NOTE: not all flags or values from the internal Configuration object are exposed via this structure to prevent certain settings being set (e.g. integration test modes)
Fields§
§domain: Option<String>
REQUIRED - Kanidm Domain, eg kanidm.example.com
.
origin: Option<String>
REQUIRED - The user-facing HTTPS URL for this server, eg https://idm.example.com
db_path: Option<String>
File path of the database file
tls_chain: Option<String>
REQUIRED - The file path to the TLS Certificate Chain
tls_key: Option<String>
REQUIRED - The file path to the TLS Private Key
tls_client_ca: Option<String>
The directory path of the client ca and crl dir.
bindaddress: Option<String>
The listener address for the HTTPS server.
eg. [::]:8443
or 127.0.0.1:8443
. Defaults to kanidm_proto::constants::DEFAULT_SERVER_ADDRESS
ldapbindaddress: Option<String>
The listener address for the LDAP server.
eg. [::]:3636
or 127.0.0.1:3636
.
If unset, the LDAP server will be disabled.
role: ServerRole
The role of this server, one of write_replica, write_replica_no_ui, read_only_replica, defaults to ServerRole::WriteReplica
log_level: Option<LogLevel>
The log level, one of info, debug, trace. Defaults to “info” if not set.
online_backup: Option<OnlineBackup>
Backup Configuration, see OnlineBackup for details on sub-keys.
trust_x_forward_for: Option<bool>
Trust the X-Forwarded-For header for client IP address. Defaults to false if unset.
db_fs_type: Option<FsType>
The filesystem type, either “zfs” or “generic”. Defaults to “generic” if unset. I you change this, run a database vacuum.
adminbindpath: Option<String>
The path to the “admin” socket, used for local communication when performing certain server control tasks. Default is set on build, based on the system target.
thread_count: Option<usize>
The maximum amount of threads the server will use for the async worker pool. Defaults to std::threads::available_parallelism.
repl_config: Option<ReplicationConfiguration>
Replication configuration, this is a development feature and not yet ready for production use.
otel_grpc_url: Option<String>
An optional OpenTelemetry collector (GRPC) url to send trace and log data to, eg http://localhost:4317
. If not set, disables the feature.
Implementations§
source§impl ServerConfig
impl ServerConfig
sourcepub fn new<P: AsRef<Path>>(config_path: Option<P>) -> Result<Self, Error>
pub fn new<P: AsRef<Path>>(config_path: Option<P>) -> Result<Self, Error>
loads the configuration file from the path specified, then overlays fields from environment variables starting with `KANIDM_``
sourcepub fn get_db_arc_size(&self) -> Option<usize>
pub fn get_db_arc_size(&self) -> Option<usize>
Return the ARC size for the database, it’s something you really shouldn’t touch unless you are doing extreme tuning.
Trait Implementations§
source§impl Debug for ServerConfig
impl Debug for ServerConfig
source§impl Default for ServerConfig
impl Default for ServerConfig
source§fn default() -> ServerConfig
fn default() -> 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 UnwindSafe for ServerConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request