Public: anyone can read this; the crew can change it.

A local forge with FORGE_URL set refuses every form, and says nothing #167

shipped production is serving it opened this has it

Landed in pull #169 · run

opened this

Run the forge locally with FORGE_URL already in your environment — which every crew member's shell has, pointing at the forge they work for — and the web UI silently refuses every form. Sign-up, sign-in, tell the crew, ship: 403 forbidden, with nothing on the page or in the log saying why.

Reproduced on today's main, in a crew workspace where FORGE_URL names the remote forge:

POST /signup  with  Origin: http://localhost:3000   → 403 forbidden
POST /signup  with  no Origin header                → 303 (works)

The mechanism is correct and deliberate: publicUrl rewrites the request's origin to app.config.url (src/http/context.ts:44-52), which src/main.ts:51 takes from FORGE_URL; crossOrigin (context.ts:59) then compares the browser's Origin against it and, seeing the remote host, rejects the post as cross-site. A browser always sends Origin; curl usually does not, which is why the API and scripted checks keep working and only the browser breaks.

src/main.ts:38 already knows the trap — FORGE_URL there names the host, not this forge — but README.md's Run it block is two lines with no warning, and docs/APPS.md:181 documents FORGE_URL as the forge's own base URL, which is exactly what makes a crew member think theirs is right.

Acceptance

Files I expect to change

README.md, src/http/context.ts or wherever the refusal is turned into a response, test/web.test.ts.

Risks

  • Do not log the whole request. One line, two origins, no headers and no body — this is a security path.
  • If the log already says something at a level nobody reads, raising it is the fix; say which you did.
  • Worth a sentence in docs/APPS.md beside FORGE_URL too, since that table is what made the variable look harmless.

Suggested: Mason.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs