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.
| Field | Variable | Default |
|---|---|---|
server | RECALL_WORKER_SERVER | required; RECALL_URL is never read |
data_dir | RECALL_WORKER_DIR | required; the image sets /data |
name | RECALL_WORKER_NAME | worker |
claude_bin | RECALL_CLAUDE_BIN | claude |
merge_timeout | RECALL_MERGE_TIMEOUT_MS | 45s, at most MAX_MERGE_TIMEOUT |
claude_status_interval | RECALL_CLAUDE_STATUS_INTERVAL_MS | 30m |
lease_seconds | RECALL_WORKER_LEASE_SECONDS | 120 |
eval_stale_days | RECALL_EVAL_STALE_DAYS | 90 |
Fields§
§server: StringThe 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: PathBufWhere 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: StringThe name it enrols as, which the owner sees in the device list.
claude_bin: StringThe claude binary. Never the Anthropic API.
merge_timeout: DurationHow long one merge may take before it is abandoned and reported as an error, which the server retries later.
claude_status_interval: DurationHow often to re-check that the CLI is present and logged in.
lease_seconds: u64How 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: u64How long one claim waits for a job.
eval_stale_days: u64How 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
impl Config
Sourcepub fn from_env() -> Result<Self, ConfigError>
pub fn from_env() -> Result<Self, ConfigError>
Reads the real process environment.
Sourcepub fn from_lookup<F>(lookup: F) -> Result<Self, ConfigError>
pub fn from_lookup<F>(lookup: F) -> Result<Self, ConfigError>
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.
Sourcepub fn plaintext_warning(&self) -> Option<String>
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.