Skip to main content

Config

Struct Config 

Source
pub struct Config {
    pub manifest: PathBuf,
    pub bind: String,
    pub workers: Option<usize>,
    pub cdn_base_url: Option<String>,
    pub fallback_dir: Option<PathBuf>,
    pub worker_entry: PathBuf,
    pub sources_config: Option<PathBuf>,
    pub session_secret_env: Option<String>,
    pub session_cookie: String,
    pub login_url: Option<String>,
    pub cache_capacity: usize,
    pub policy_delegated: Vec<RoutePolicy>,
}

Fields§

§manifest: PathBuf

Local path to manifest.json (required).

§bind: String

Bind address for the HTTP listener.

§workers: Option<usize>

Number of Bun workers to spawn (default = num_cpus / 2, min 1).

§cdn_base_url: Option<String>

CDN base URL for Mode 1 redirect dispatch (e.g. https://cdn.yah.dev). When set, Mode 1 routes 302-redirect to {cdn_base_url}{path}.

§fallback_dir: Option<PathBuf>

Local dist/ directory for Mode 1 fallback (when CDN is not configured).

§worker_entry: PathBuf

Path to the mesofact-worker entry script (bun entrypoint).

§sources_config: Option<PathBuf>

Path to mesofact.config.toml. Read for source generation tokens (cache-key input 6). Missing file → generations resolve to a placeholder.

§session_secret_env: Option<String>

Env var holding the HMAC key for CookieSessionResolver. When set, Mode 2 sessions resolve from the session cookie; when unset, sessions are disabled (requires: ["user"] routes always redirect/401).

§session_cookie: String

Session cookie name (default mesofact_session).

§login_url: Option<String>

Login URL for requires: ["user"] routes with no session. The proxy 302s here with ?next=<original-url>. Unset → 401 instead.

§cache_capacity: usize

Mode 2 LRU response-cache capacity (entries).

§policy_delegated: Vec<RoutePolicy>

Assert that something in front of this process enforces a route policy this tier does not (R749-T1). Comma-separated field names as written in mesofact.routes.ts.

The proxy tier’s standing case is resilience: W181 puts retry/timeout at the always-up edge (the CF Worker reads them from SSR_RESILIENCE), and this process implements none of it. Deployed behind that Worker the policy really is enforced — by the Worker — so the deployment says so here. Run without one and the refusal is correct.

Same spelling and semantics as mesofact serve’s flag on purpose: an operator moving a workload between tiers should not have to learn a second vocabulary for the same assertion.

Implementations§

Source§

impl Config

Source

pub fn policy_support(&self) -> PolicySupport

What mesofact proxy implements, advertised (R749-T1). One place, and each line has a code site behind it:

  • requires — proxy::router’s Requires::User check, the only session-aware serving path in the system.
  • cache_policy — proxy::cache::ResponseCache, built in cli::proxy::run.
  • concurrency — the worker pool’s per-route semaphore (packages/mesofact-worker/src/pool.ts, configured from the manifest at worker.ts’s buildRouteHandlers). W225 §2c records this row as unenforced everywhere; that is wrong, and the code above is why.
  • resilience — NOT enforced. Nothing in mesofact-core reads it; W181’s only consumer is the CF Worker (packages/mesofact-edge/src/router.ts, from SSR_RESILIENCE). Delegate it when that Worker is in front.
Source

pub fn worker_count(&self) -> usize

Trait Implementations§

Source§

impl Args for Config

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 CommandFactory for Config

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 Config

Source§

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

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

impl FromArgMatches for Config

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 Config

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

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