Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 33 fields pub bind_addr: SocketAddr, pub public_url: String, pub instance_name: String, pub database: PgConnectOptions, pub database_password: Option<String>, pub database_display: String, pub db_max_connections: u32, pub vault_dir: PathBuf, pub max_upload_bytes: u64, pub preview: PreviewLimits, pub preview_cache_max_bytes: u64, pub upload_chunk_bytes: u64, pub clamd: Option<ScannerConfig>, pub backup_passphrase: Option<String>, pub session_ttl: Duration, pub approval_reauth: ApprovalReauth, pub audit_retention_days: u32, pub retention_latest_grace_days: u32, pub signin_max_failures: u32, pub oidc_token_idle_days: u32, pub metrics_token: Option<String>, pub cookie_secure: bool, pub log_format: LogFormat, pub bootstrap_admin: Option<BootstrapAdmin>, pub oidc: Option<OidcConfig>, pub local_login: bool, pub mattermost_error_webhook: Option<String>, pub smtp: Option<SmtpConfig>, pub request_digest_hours: u64, pub mattermost: Option<MattermostConfig>, pub assistant: Option<AssistantConfig>, pub local_agents: LocalAgents, pub webhooks: WebhookConfig,
}

Fields§

§bind_addr: SocketAddr

Socket address the HTTP server binds to.

§public_url: String

Externally visible base URL without trailing slash, e.g. https://plm.example.org.

§instance_name: String

Name shown in the UI header and page titles.

§database: PgConnectOptions

PostgreSQL connection options (contains the password – never log it).

§database_password: Option<String>

Password of the database connection, for tools that receive it in their environment (PGPASSWORD of pg_dump/pg_restore). Secret – never log it.

§database_display: String

Human readable, password-free description of the database target.

§db_max_connections: u32§vault_dir: PathBuf

Root directory of the file vault (and of the cached 3D previews).

§max_upload_bytes: u64§preview: PreviewLimits

Size and memory limits of the 3D preview (TEAMCRAFT_PREVIEW_MAX_*).

§preview_cache_max_bytes: u64

Size the preview cache (<vault>/previews) is trimmed to by the hourly housekeeping, least recently used first (TEAMCRAFT_PREVIEW_CACHE_MAX_MB; 0 = no limit).

§upload_chunk_bytes: u64

Largest chunk of a chunked, resumable upload (PATCH /api/v1/uploads/{id}).

§clamd: Option<ScannerConfig>

Malware scan of uploads with a ClamAV daemon (TEAMCRAFT_CLAMD_ADDR, TEAMCRAFT_CLAMD_MAX_MB); None = no scan.

§backup_passphrase: Option<String>

Passphrase of encrypted backups (TEAMCRAFT_BACKUP_PASSPHRASE, used by teamcraft backup --encrypt and the restore). Secret – never log it.

§session_ttl: Duration§approval_reauth: ApprovalReauth

Whether review decisions in the browser need a fresh sign-in (TEAMCRAFT_APPROVAL_REAUTH: off, release, every_decision).

§audit_retention_days: u32

Days the audit log is kept (TEAMCRAFT_AUDIT_RETENTION_DAYS; 0 = for ever). Older entries are removed by the hourly housekeeping, which records the removal as one entry.

§retention_latest_grace_days: u32

Days after which the old versions of files with the retention latest are removed by the hourly housekeeping (TEAMCRAFT_RETENTION_LATEST_GRACE_DAYS; 0 = only the CLI removes them). Files keep every version unless someone sets latest.

§signin_max_failures: u32

Failed password sign-ins per username within 15 minutes before sign-in is refused (TEAMCRAFT_SIGNIN_MAX_FAILURES; five times as many per client address; 0 = off). See crate::auth::SignInThrottle.

§oidc_token_idle_days: u32

Idle lifetime in days of new API and desktop tokens of single sign-on users (TEAMCRAFT_OIDC_TOKEN_IDLE_DAYS; 0 = off, the default): a token without an expiry or with a longer one expires after that many days without use, so a leaver removed only at the identity provider does not keep a working token (issue #173).

§metrics_token: Option<String>

Bearer token of GET /metrics; None = the endpoint is off.

§cookie_secure: bool

Adds the Secure attribute to cookies (required when served via HTTPS).

§log_format: LogFormat§bootstrap_admin: Option<BootstrapAdmin>

Initial administrator that is created when the database has no users.

§oidc: Option<OidcConfig>

Single sign-on via OpenID Connect (Authentik). None = disabled.

§local_login: bool

Whether username/password login for local accounts is offered.

§mattermost_error_webhook: Option<String>

Mattermost incoming webhook that receives internal server errors.

§smtp: Option<SmtpConfig>

E-mail notifications via SMTP. None = no e-mails.

§request_digest_hours: u64

Hours between two e-mail digests of the change requests waiting for triage (per user and project group); 0 = no digests.

§mattermost: Option<MattermostConfig>

Notifications to Mattermost. None = disabled.

§assistant: Option<AssistantConfig>

The built-in assistant (Anthropic or an OpenAI-compatible API). None = disabled.

§local_agents: LocalAgents

Whether users may connect their own local agents (the desktop app’s Agent view, ACP) to TeamCraft’s tools (TEAMCRAFT_LOCAL_AGENTS). Off leaves only the server-side assistant. See LocalAgents.

§webhooks: WebhookConfig

Which targets outgoing event webhooks may reach.

Implementations§

Source§

impl Config

Source

pub fn from_env() -> Result<Self>

Reads the configuration from the process environment.

Source

pub fn from_lookup<F>(lookup: F) -> Result<Self>
where F: Fn(&str) -> Option<String>,

Reads the configuration through an arbitrary lookup function (used by tests).

Source

pub fn summary(&self) -> String

Password-free summary for the startup log.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. 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
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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

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
§

impl<T> Parallelizable for T
where T: Send + Sync,

§

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
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

§

fn to_owned_table(&self) -> U

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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