Skip to main content

HttpConfig

Struct HttpConfig 

Source
pub struct HttpConfig {
Show 31 fields pub bind: IpAddr, pub tls_terminated: bool, pub max_connections: usize, pub max_connections_per_ip: usize, pub header_read_timeout: Duration, pub port: u16, pub api_key: ApiKey, pub base_jid: String, pub group_folder: String, pub project_root: PathBuf, pub groups_dir: PathBuf, pub data_dir: PathBuf, pub evals_legacy_group_dir: bool, pub timezone: Tz, pub cors_origins: Vec<String>, pub max_body_bytes: usize, pub lane_idle: Duration, pub lane_sweep_interval: Duration, pub sse_keepalive: Duration, pub dedup_window: Duration, pub auth_max_failures: u32, pub auth_window: Duration, pub palace_script: PathBuf, pub palace_host_exec: bool, pub palace_timeout: Duration, pub palace_max_output_bytes: usize, pub palace_max_concurrency: usize, pub max_user_lanes: usize, pub max_pending_per_lane: usize, pub max_streams: usize, pub seed_digest_task: bool,
}
Expand description

Resolved configuration for the HTTP channel.

Fields§

§bind: IpAddr

Listen address (default 127.0.0.1).

§tls_terminated: bool

A TLS-terminating proxy fronts the API (operator assertion; only silences the wildcard-bind warning).

§max_connections: usize

Max simultaneously open connections.

§max_connections_per_ip: usize

Max simultaneously open connections from one peer IP.

§header_read_timeout: Duration

Time a client has to send complete request headers. Established requests (SSE streams) have no idle timeout.

§port: u16

Listen port (0 picks a free port; see HttpChannel::local_addr).

§api_key: ApiKey

Shared secret callers present via X-Api-Key or Authorization: Bearer.

§base_jid: String

Base lane JID (http:copilot).

§group_folder: String

Group folder every lane runs in.

§project_root: PathBuf

Project root (mempalace/, siem/, … live below it).

§groups_dir: PathBuf

<project_root>/groups.

§data_dir: PathBuf

Host runtime data (<project_root>/data): lane state directories live in <data_dir>/sessions/<session_key>.

§evals_legacy_group_dir: bool

COPILOT_EVALS_LEGACY_GROUP_DIR: GET /evals additionally reads the pre-N-2 location groups/<folder>/evals/ (writable by every CoPilot lane, so records found there are forgeable). Off by default.

§timezone: Tz

Timezone used for once task timestamps and cron evaluation.

§cors_origins: Vec<String>

Allowed CORS origins (exact match, or *). Empty => no CORS headers.

§max_body_bytes: usize

Request body limit in bytes.

§lane_idle: Duration

Idle time after which a per-user lane is swept.

§lane_sweep_interval: Duration

How often the idle-lane sweep runs.

§sse_keepalive: Duration

Interval between SSE keepalive comments.

§dedup_window: Duration

Repeat triggers for the same alert inside this window return the existing job. Zero disables de-duplication.

§auth_max_failures: u32

Failed authentications per IP (inside auth_window) before 429s.

§auth_window: Duration

Auth-failure throttle window.

§palace_script: PathBuf

Path of mempalace/palace-call.sh (only used with Self::palace_host_exec).

§palace_host_exec: bool

TALAHON_PALACE_HOST_EXEC=unsafe: without an explicitly supplied palace runner, run palace_script directly on the host. Dangerous (MYTH-01); off by default.

§palace_timeout: Duration

Timeout for one palace call.

§palace_max_output_bytes: usize

Max bytes of stdout accepted from a palace call.

§palace_max_concurrency: usize

Max concurrently running palace calls.

§max_user_lanes: usize

Cap on in-memory per-user lanes.

§max_pending_per_lane: usize

Cap on SSE requests queued on a single lane.

§max_streams: usize

Cap on concurrently open SSE streams across all lanes.

§seed_digest_task: bool

Seed the (paused) 15-minute alert digest task on connect.

Implementations§

Source§

impl HttpConfig

Source

pub fn new(project_root: impl Into<PathBuf>) -> Self

Defaults rooted at project_root (API key unset). Intended for tests and programmatic construction; production uses Self::from_talon_config.

Source

pub fn from_talon_config(cfg: &TalonConfig) -> Result<Self>

Resolve from the host configuration.

Source

pub fn from_env( project_root: &Path, groups_dir: &Path, timezone: Tz, env: &EnvFile, ) -> Result<Self>

Resolve from an EnvFile (see the module docs for the keys).

Source

pub fn exposure_warning(&self) -> Option<String>

Startup warning for a listen address that exposes the API (and its cleartext API key) on every interface without TLS in front.

Source

pub fn group_dir(&self) -> PathBuf

<groups_dir>/<group_folder>.

Source

pub fn prompts_dir(&self) -> PathBuf

<groups_dir>/<group_folder>/prompts.

Source

pub fn sessions_dir(&self) -> PathBuf

<data_dir>/sessions: the (operator-controlled) root of every lane’s private state directory.

Source

pub fn investigation_session_key(&self) -> &'static str

Session key of the investigation lane, whose state directory holds the eval records (the key crate::HttpState::register_base_lanes registers that lane with).

Source

pub fn evals_dir(&self) -> PathBuf

<data_dir>/sessions/<investigation session key>/evals — where the investigation agent writes eval records (/home/agent/.talon/evals inside its container) and where GET /evals reads them. Reads never go through this path directly: the lane directory and evals/ are opened without following symlinks.

Source

pub fn legacy_evals_dir(&self) -> PathBuf

<groups_dir>/<group_folder>/evals — the pre-N-2 location, shared by every CoPilot lane; read only with Self::evals_legacy_group_dir.

Trait Implementations§

Source§

impl Clone for HttpConfig

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 Debug for HttpConfig

Source§

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

Formats the value using the given formatter. 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
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> 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<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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