Struct kanidmd_core::config::ServerConfig

source ·
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

source

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_``

source

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ServerConfig

source§

fn default() -> ServerConfig

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ServerConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T> AsTaggedExplicit<'a> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self>

§

impl<'a, T> AsTaggedImplicit<'a> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,