- The agent finds frps/frpc's config (Hub path, systemd -c, usual places) and reads INI and TOML. - New jobs frp-read, frp-write (secrets kept on the server, verify, backup, restart, roll back) and probe-ports (which ports are free here), on central and church servers. - Stats report frpConfigPath; crosscode gets FRPC_INI on church servers. - Website plan versions move up to contracts 1.16.0 and Hub 2.12.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
1.2 KiB
TypeScript
21 lines
1.2 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"); },
|
|
/** The churches on a church server. */
|
|
get sites() { return env("CROSSCODE_SITES", "/var/www/sites"); },
|
|
};
|