1.9 KiB
1.9 KiB
Repository Guide
- Requires Node.js 22+. Use
npm run checkfor the requiredlint -> typecheck -> test -> buildverification order;npm test -- <file>runs one Vitest file. src/server.tsowns HTTP/authentication,src/service.tsowns the single-worker queue and cron polling, andsrc/executor.tsowns ordered step execution, SFTP collection, staging, and retention. The React UI is intentionally a single entrypoint atweb/src/main.tsx.- Runtime configuration is mandatory:
ADMIN_PASSWORDand a base64-encoded 32-byteMASTER_KEY. Tests import modules without either; do not load environment configuration at module scope outsidesrc/server.ts. - SQLite state lives under
DATA_DIR; artifacts live underBACKUP_DIR. Store artifact paths relative toBACKUP_DIRand download to.stagingbefore atomically moving completed runs. - SSH host-key pinning is independent of password/private-key user authentication. Never weaken
hostVerifier, log decrypted values, or store credentials outside AES-256-GCM envelopes fromsrc/crypto.ts. - Jobs contain ordered mixed steps but use one SSH host/connection.
continueOnErroryieldssucceeded_with_warnings; required failures publish no artifacts. Keep legacy single-operation normalization insrc/schemas.tswhile persisted old jobs may exist. - Remote commands must quote every configured value with
shellQuote. Docker outputs are container paths copied withdocker cp; remote command outputs are staged immediately; database and directory operations run tools on the SSH host. - Scheduling is single-instance and non-overlapping per job. On startup,
src/db.tsmarks queued/running work failed; do not imply distributed-worker safety without replacing this design. npm run devstarts Fastify on3000and Vite on5173; production servesdist/publicfrom the Fastify process.docker compose up --buildruns as UID/GID10001, so mounted data/backup paths must be writable by it.