Skip to content

docs: complete configuration reference (all env vars, verified against code)#76

Open
dchaudhari7177 wants to merge 1 commit into
burakgon:mainfrom
dchaudhari7177:docs/configuration-reference
Open

docs: complete configuration reference (all env vars, verified against code)#76
dchaudhari7177 wants to merge 1 commit into
burakgon:mainfrom
dchaudhari7177:docs/configuration-reference

Conversation

@dchaudhari7177

Copy link
Copy Markdown

Closes #71

What

New docs/configuration.md — every environment variable RoamCode reads, one table per area as the issue asked (Core, ROAMCODE_*, Advanced/installer), each row = variable · default · effect · linked source file. Every default and behavior was read out of the code, not copied from the README:

  • server-config.tsPORT (0 = OS-picks, out-of-range = boot error), BIND_ADDRESS, TRUST_PROXY (three forms: IP/CIDR preferred, 1/true trusts every hop, else off), FS_ROOT, MAX_UPLOAD_BYTES, SESSION_IDLE_TTL_MS (opt-in reaper, sweep cadence from transport.ts), the ROAMCODE_* limits and their REMOTE_CODER_* legacy fallback, plus the shared int-parsing rule (absent/unparseable → default, out-of-range → refuse to start)
  • data-dir.ts — full data-dir resolution order incl. the pre-rename remote-coder preference; ACCESS_TOKEN precedence and the 0600 persisted token
  • start.tsNO_TOKEN (exactly 1, loopback-only), ROAMCODE_VAPID_SUBJECT (invalid → push disabled, not a crash), WEB_DIR
  • updater.tsROAMCODE_SERVICE_MANAGER/_LABEL resolution order (service.json → env → platform default)
  • terminal-process.tsRC_TMUX_SOCKET and why its default keeps the pre-rename name
  • config.ts / auth.ts — the 'not configurable by design' notes (token never in argv, ANTHROPIC_API_KEY stripped, fixed 60s rotation grace)
  • scripts/install.shROAMCODE_DIR, RC_NO_START, installer PORT

Drift found while verifying (fixed, per the acceptance criteria)

  • README and --help advertised VAPID_SUBJECT — the code only reads ROAMCODE_VAPID_SUBJECT (or legacy REMOTE_CODER_VAPID_SUBJECT). Anyone following the docs set a variable that does nothing. Both corrected.
  • README's TRUST_PROXY row documented only 1/true; per the code comment the preferred form is a specific proxy IP/CIDR (trusting every hop lets a client spoof request.ip via a prepended XFF entry). Row updated.

README's config table now links to the full reference, and --help points at it too.

Verification

pnpm typecheck, pnpm format:check (on the changed files), and the CLI arg/help tests all green (the one run.test.ts install failure on my machine is the pre-existing Windows chmod-assert issue, same as on main).

New docs/configuration.md: every env var RoamCode reads — one table per
area (core, ROAMCODE_*, advanced/installer), each row with the default,
effect, and source file, all verified against server-config.ts,
data-dir.ts, start.ts, updater.ts, terminal-process.ts, config.ts,
origin-check.ts, auth.ts, and scripts/install.sh.

Drift found and fixed while verifying:
- README and --help advertised VAPID_SUBJECT, but the code only reads
  ROAMCODE_VAPID_SUBJECT (or the legacy REMOTE_CODER_VAPID_SUBJECT)
- README's TRUST_PROXY row only mentioned 1/true; the code's preferred
  form is a specific proxy IP/CIDR (trusting every hop is spoofable)

README's config table links to the full reference; --help points at it
too.

Closes burakgon#71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: complete configuration reference (all env vars, verified against code)

1 participant