Skip to main content

Config

Struct Config 

Source
pub struct Config {
    pub server: String,
    pub data_dir: PathBuf,
    pub name: String,
    pub claude_bin: String,
    pub merge_timeout: Duration,
    pub claude_status_interval: Duration,
    pub lease_seconds: u64,
    pub wait_seconds: u64,
    pub eval_stale_days: u64,
}
Expand description

What recall-worker needs.

FieldVariableDefault
serverRECALL_WORKER_SERVERrequired; RECALL_URL is never read
data_dirRECALL_WORKER_DIRrequired; the image sets /data
nameRECALL_WORKER_NAMEworker
claude_binRECALL_CLAUDE_BINclaude
merge_timeoutRECALL_MERGE_TIMEOUT_MS45s, at most MAX_MERGE_TIMEOUT
claude_status_intervalRECALL_CLAUDE_STATUS_INTERVAL_MS30m
lease_secondsRECALL_WORKER_LEASE_SECONDS120
eval_stale_daysRECALL_EVAL_STALE_DAYS90

Fields§

§server: String

The server, such as http://recall-server:8787 from inside the compose network, or the public address from another host. Recorded in the worker’s identity on first start; the worker refuses to run against any other.

§data_dir: PathBuf

Where the worker keeps its device key and id. Never the server’s volume: whoever reads this file can act as the worker. No default, so a worker started by hand never writes a key somewhere nobody chose.

§name: String

The name it enrols as, which the owner sees in the device list.

§claude_bin: String

The claude binary. Never the Anthropic API.

§merge_timeout: Duration

How long one merge may take before it is abandoned and reported as an error, which the server retries later.

§claude_status_interval: Duration

How often to re-check that the CLI is present and logged in.

§lease_seconds: u64

How long a claimed job is the worker’s before the server hands it to someone else. Longer than the merge timeout, so a merge that runs its full course still reports in time.

§wait_seconds: u64

How long one claim waits for a job.

§eval_stale_days: u64

How many days a file must go unchanged, naming a path or a command, before an evaluation reports it as stale for the owner to confirm.

Implementations§

Source§

impl Config

Source

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

Reads the real process environment.

Source

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

Reads configuration through lookup, so tests need not set process-wide variables. An unparseable number falls back to its default, as the server’s do.

Source

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

A warning when server is reached over plain http across a network, and None when that is fine.

Requests are signed either way, so nobody on the path can act as the worker. But a claim’s answer carries both versions of a conflicting file, and over http anyone on the path reads them. That is fine on loopback, and on the compose file’s own backend network, where the server is a single-label service name such as recall-server; anywhere else it wants https.

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

impl Debug for Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. 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<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> 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> 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> 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<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