Skip to main content

ServerCli

Struct ServerCli 

Source
pub struct ServerCli {
Show 57 fields pub api_token: Option<String>, pub kbs: Option<String>, pub listen_addr: Option<String>, pub metrics_enabled: Option<String>, pub metrics_listen_addr: Option<String>, pub log_format: Option<String>, pub max_patchable_size: Option<String>, pub ready_probe_interval_ms: Option<String>, pub upload_tmp_dir: Option<OsString>, pub webdav_username: Option<String>, pub webdav_password: Option<String>, pub mcp_http_allowed_origins: Option<String>, pub mcp_http_allowed_hosts: Option<String>, pub mcp_anonymous: Option<String>, pub mcp_max_read_bytes: Option<String>, pub mcp_max_sessions: Option<String>, pub oidc_issuer: Option<String>, pub oidc_audience: Option<String>, pub oidc_username_claim: Option<String>, pub oidc_groups_claim: Option<String>, pub oidc_http_timeout_ms: Option<String>, pub oidc_resource: Option<String>, pub oidc_ca_cert: Option<OsString>, pub storage_backend: Option<OsString>, pub s3_region: Option<String>, pub s3_access_key_id: Option<String>, pub s3_secret_access_key: Option<String>, pub s3_endpoint_url: Option<String>, pub s3_force_path_style: Option<String>, pub s3_reconcile: Option<String>, pub fs_root: Option<OsString>, pub fs_metadata: Option<OsString>, pub fs_file_mode: Option<OsString>, pub fs_dir_mode: Option<OsString>, pub fs_allow_lossy_names: Option<OsString>, pub fs_watch: Option<OsString>, pub fs_watch_debounce_ms: Option<OsString>, pub events_backend: Option<OsString>, pub events_memory_capacity: Option<OsString>, pub nats_url: Option<String>, pub nats_stream: Option<String>, pub nats_max_age_secs: Option<OsString>, pub qdrant_url: Option<String>, pub qdrant_api_key: Option<String>, pub qdrant_timeout_ms: Option<String>, pub qdrant_connect_timeout_ms: Option<String>, pub embedding_endpoint_url: Option<String>, pub embedding_model: Option<String>, pub embedding_api_key: Option<String>, pub embedding_dimensions: Option<String>, pub embedding_batch_size: Option<String>, pub embedding_timeout_ms: Option<String>, pub embedding_max_retries: Option<String>, pub embedding_max_input_tokens: Option<String>, pub webdav_listen_addr: Option<OsString>, pub mcp_http_bind: Option<OsString>, pub mcp_http_enabled: Option<OsString>,
}
Expand description

Command-line arguments, each mirroring one environment variable.

Construct it with clap::Parser::parse in a binary, or with ServerCli::from_env to read the environment alone.

Fields§

§api_token: Option<String>

Static Bearer token for authenticated API access and every HTTP write.

§kbs: Option<String>

Comma-separated knowledge base slugs to declare, e.g. notes,scratch.

§listen_addr: Option<String>

Address and port the server binds to [default: 0.0.0.0:8080].

§metrics_enabled: Option<String>

Serve the Prometheus exposition on its own listener [default: false].

§metrics_listen_addr: Option<String>

Address and port the metrics listener binds to; loopback by default, because the exposition is unauthenticated [default: 127.0.0.1:9090].

§log_format: Option<String>

Log output format: pretty or json [default: pretty].

§max_patchable_size: Option<String>

Largest object eligible for PATCH, in bytes [default: 104857600].

§ready_probe_interval_ms: Option<String>

How often /readyz probes the storage backend and Qdrant, in milliseconds; also each probe’s deadline [default: 5000].

§upload_tmp_dir: Option<OsString>

Private staging directory for uploads and index snapshots [default: the platform temporary directory].

§webdav_username: Option<String>

HTTP Basic auth username for WebDAV.

§webdav_password: Option<String>

HTTP Basic auth password for WebDAV.

§mcp_http_allowed_origins: Option<String>

Allowed Origin values for MCP over HTTP [default: null, i.e. loopback only].

§mcp_http_allowed_hosts: Option<String>

Allowed Host values for MCP over HTTP [default: 127.0.0.1,localhost,::1].

§mcp_anonymous: Option<String>

Whether /mcp admits a request with no credential: auto (yes, when a knowledge base grants anyone something) or never [default: auto].

§mcp_max_read_bytes: Option<String>

Most bytes one MCP object read may fetch; larger objects are read in slices [default: 16777216].

§mcp_max_sessions: Option<String>

Most MCP sessions this process holds at once; a POST that would open another is refused until one ends [default: 256].

§oidc_issuer: Option<String>

OIDC issuer URL, spelled exactly as the provider’s iss claim. Enables identity-provider bearer tokens.

§oidc_audience: Option<String>

Comma-separated audiences an identity token may carry (usually the client id).

§oidc_username_claim: Option<String>

The claim user: rules match against [default: preferred_username].

§oidc_groups_claim: Option<String>

The claim group: rules match against [default: groups].

§oidc_http_timeout_ms: Option<String>

Timeout for discovery and key-set requests to the issuer [default: 5000].

§oidc_resource: Option<String>

This deployment’s public URL; publishes RFC 9728 metadata for MCP clients.

§oidc_ca_cert: Option<OsString>

PEM bundle of extra CA certificates to trust when reaching the issuer — for an internal or self-signed CA.

§storage_backend: Option<OsString>

Object store to run on: s3 or fs [default: s3].

§s3_region: Option<String>

S3 region. Required with the s3 backend, even behind a custom endpoint.

§s3_access_key_id: Option<String>

S3 access key ID. No ambient credential chain is consulted.

§s3_secret_access_key: Option<String>

S3 secret access key.

§s3_endpoint_url: Option<String>

Custom S3-compatible endpoint, for SeaweedFS, MinIO, Ceph, Garage or R2.

§s3_force_path_style: Option<String>

Use path-style addressing, endpoint/bucket/key [default: false].

§s3_reconcile: Option<String>

Compare every knowledge base’s bucket against the search index once at startup, re-indexing what changed outside NotedThat [default: true].

§fs_root: Option<OsString>

Absolute path of the storage root. Required with the fs backend.

§fs_metadata: Option<OsString>

Where per-object metadata is kept [default: sidecar].

§fs_file_mode: Option<OsString>

Octal mode for created object files [default: 0644].

§fs_dir_mode: Option<OsString>

Octal mode for created directories [default: 0755].

§fs_allow_lossy_names: Option<OsString>

Start even on a filesystem that folds case or normalizes Unicode [default: false].

§fs_watch: Option<OsString>

Re-index objects changed in the tree by anything other than NotedThat [default: true].

§fs_watch_debounce_ms: Option<OsString>

How long a file must go quiet before a change to it is acted on, in milliseconds [default: 500].

§events_backend: Option<OsString>

Object change event log: none, memory or nats [default: none].

§events_memory_capacity: Option<OsString>

Events the memory log retains for replay [default: 10000].

§nats_url: Option<String>

NATS server URL, nats://[user:pass@]host:4222. Required with the nats events backend; credentials travel in the URL.

§nats_stream: Option<String>

JetStream stream holding the event log [default: notedthat-events].

§nats_max_age_secs: Option<OsString>

How long the stream retains an event, in seconds [default: 604800].

§qdrant_url: Option<String>

Qdrant gRPC endpoint, e.g. http://127.0.0.1:6334.

§qdrant_api_key: Option<String>

API key for an authenticated Qdrant instance.

§qdrant_timeout_ms: Option<String>

Per-RPC Qdrant timeout in milliseconds [default: 30000].

§qdrant_connect_timeout_ms: Option<String>

Qdrant connection-establishment timeout in milliseconds [default: 10000].

§embedding_endpoint_url: Option<String>

Base URL of the OpenAI-compatible embedding endpoint.

§embedding_model: Option<String>

Embedding model name, e.g. text-embedding-3-small.

§embedding_api_key: Option<String>

Bearer token for the embedding endpoint.

§embedding_dimensions: Option<String>

Output vector dimensions. Must match the model and is baked into the Qdrant collection at first provisioning.

§embedding_batch_size: Option<String>

Text chunks per embedding request [default: 32].

§embedding_timeout_ms: Option<String>

Per-request embedding HTTP timeout in milliseconds [default: 30000].

§embedding_max_retries: Option<String>

Retry attempts on HTTP 429 or 5xx from the embedder [default: 3].

§embedding_max_input_tokens: Option<String>

Chunks longer than this are dropped rather than truncated [default: 8192].

§webdav_listen_addr: Option<OsString>

Removed: WebDAV is served at /webdav on the main listener.

§mcp_http_bind: Option<OsString>

Removed: MCP HTTP is served at /mcp on the main listener.

§mcp_http_enabled: Option<OsString>

Removed: MCP HTTP is always served at /mcp on the main listener.

Implementations§

Source§

impl ServerCli

Source

pub fn from_env() -> Result<Self, Error>

Read every setting from the environment alone, ignoring argv.

§Errors

Returns a clap error if a variable holds a value this parser cannot accept — in practice, non-UTF-8 in a setting typed as String.

Trait Implementations§

Source§

impl Args for ServerCli

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for ServerCli

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
Source§

impl CommandFactory for ServerCli

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for ServerCli

Source§

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

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

impl Default for ServerCli

Source§

fn default() -> Self

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

impl FromArgMatches for ServerCli

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for ServerCli

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

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
Source§

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

Source§

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

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

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

Source§

fn from_ref(input: &T) -> T

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

impl<T> Instrument for T

Source§

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

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

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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

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

Source§

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
Source§

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
Source§

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
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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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