feat(config): hoist PORT, DEFAULT_MODEL, Forgejo URL fallbacks #454

Closed
opened 2026-04-27 13:49:43 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As an operator deploying to a different host, I want the service port, default model, and Forgejo URL fallbacks driven by env/config, so that I don't have to fork the repo to change https://forge.jacquin.app or port 4500.

Why: these are baked across 5+ files. Trying to run a second instance on a different host today requires source edits in main.ts:167, event-log.ts:27, agent-runner.ts:70, sweeper.ts:38, workdir.ts:96, registry.ts:306, webhook-config.ts:1560, container-reconcile.ts:476.

Acceptance criteria

Server

  • main.ts:167 reads PORT from env (Number(process.env.PORT) ?? 4500)
  • event-log.ts:27 DEFAULT_MODEL resolves from agents.json::types.<TYPE>.model per agent (already partly there); remove the standalone const
  • All https://forge.jacquin.app fallbacks consolidated: single getForgejoUrl() helper in shared/config/webhook-config.ts — every other module imports it. No more inline literal fallbacks
  • Container image fallback forge.jacquin.app/charles/claude-hooks:latest moved to agents.json::container_image_default
  • Penpot URL fallback (main.ts:2131) honours agents.json::penpot.base_url only — no hardcoded design.jacquin.app

Tests

  • just qa passes
  • No literal forge.jacquin.app or design.jacquin.app outside config/, docs/, and tests

Out of scope

  • Multi-forge support (separate epic — docs/multi-forge.md)
  • Schema validation for URL format (basic non-empty check OK)

References

  • Audit category 3 (MED) and 5 (HIGH for PORT)
  • apps/server/src/main.ts:167
  • apps/server/src/infrastructure/event-log.ts:27
## User story As an operator deploying to a different host, I want the service port, default model, and Forgejo URL fallbacks driven by env/config, so that I don't have to fork the repo to change `https://forge.jacquin.app` or port 4500. **Why:** these are baked across 5+ files. Trying to run a second instance on a different host today requires source edits in `main.ts:167`, `event-log.ts:27`, `agent-runner.ts:70`, `sweeper.ts:38`, `workdir.ts:96`, `registry.ts:306`, `webhook-config.ts:1560`, `container-reconcile.ts:476`. ## Acceptance criteria ### Server - [ ] `main.ts:167` reads `PORT` from env (`Number(process.env.PORT) ?? 4500`) - [ ] `event-log.ts:27` `DEFAULT_MODEL` resolves from `agents.json::types.<TYPE>.model` per agent (already partly there); remove the standalone `const` - [ ] All `https://forge.jacquin.app` fallbacks consolidated: single `getForgejoUrl()` helper in `shared/config/webhook-config.ts` — every other module imports it. No more inline literal fallbacks - [ ] Container image fallback `forge.jacquin.app/charles/claude-hooks:latest` moved to `agents.json::container_image_default` - [ ] Penpot URL fallback (`main.ts:2131`) honours `agents.json::penpot.base_url` only — no hardcoded `design.jacquin.app` ### Tests - [ ] `just qa` passes - [ ] No literal `forge.jacquin.app` or `design.jacquin.app` outside `config/`, `docs/`, and tests ## Out of scope - Multi-forge support (separate epic — `docs/multi-forge.md`) - Schema validation for URL format (basic non-empty check OK) ## References - Audit category 3 (MED) and 5 (HIGH for PORT) - `apps/server/src/main.ts:167` - `apps/server/src/infrastructure/event-log.ts:27`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#454
No description provided.