apps/agent (docs/AGENT-1.0-PLAN.md §3-4, §10): listens on nothing; checks every job (pinned Hub key, server, time window, replays for 90 days, type per mode, strict arguments) before running crosscode with an argument array; opens the sealed config into a root-only file only for the job; redacts log lines; keeps unsent reports in an outbox; encrypts exports before upload; check-ports on the central server (read-only); self-update with automatic revert. One bundled dist/cli.js, a systemd unit and the install script that joins a server with a one-time token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
1.3 KiB
TypeScript
23 lines
1.3 KiB
TypeScript
/**
|
|
* Where the agent keeps things on a server (docs/AGENT-1.0-PLAN.md §3). Each can be moved with an
|
|
* environment variable, which the tests use.
|
|
*/
|
|
const env = (name: string, fallback: string): string => process.env[name] || fallback;
|
|
|
|
export const paths = {
|
|
/** agent.json and the two private keys, root only (mode 600). */
|
|
get configDir() { return env("CROSSCODE_AGENT_CONFIG_DIR", "/etc/crosscode"); },
|
|
/** Seen job ids (replay protection) and exports waiting to upload. */
|
|
get stateDir() { return env("CROSSCODE_AGENT_STATE_DIR", "/var/lib/crosscode-agent"); },
|
|
/** A job's opened config, only while the job runs (tmpfs). */
|
|
get runDir() { return env("CROSSCODE_AGENT_RUN_DIR", "/run/crosscode-agent"); },
|
|
/** The crosscode script (a checkout of the monorepo in /opt/crosscode/tools). */
|
|
get crosscode() { return env("CROSSCODE_BIN", "/usr/local/bin/crosscode"); },
|
|
/** Agent releases: releases/<version>/ (checkouts), current → the running one, previous. */
|
|
get agentRoot() { return env("CROSSCODE_AGENT_ROOT", "/opt/crosscode/agent"); },
|
|
/** frps.ini on the central server. */
|
|
get frpsIni() { return env("CROSSCODE_FRPS_INI", "/etc/frp/frps.ini"); },
|
|
/** The churches on a church server. */
|
|
get sites() { return env("CROSSCODE_SITES", "/var/www/sites"); },
|
|
};
|