fix(emulator): move mock OAuth off 8114 to avoid pnpm dev conflict#1385
fix(emulator): move mock OAuth off 8114 to avoid pnpm dev conflict#1385
Conversation
Bind mock-oauth-server to EMULATOR_MOCK_OAUTH_PORT (default 26704) inside the emulator VM and forward the same port on the host. Keeps pnpm dev's 8114 free so both can run side-by-side, and keeps the OIDC issuer URL identical from browser and in-VM backend (same port both sides).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe changes make the mock OAuth server's port configurable through a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR resolves a port conflict between the local emulator's mock OAuth server and Confidence Score: 5/5Safe to merge; the port migration is clean and well-tested end-to-end. All four files are changed consistently: the new port is defined once and propagated through CLI defaults, shell-script defaults, QEMU hostfwd, runtime ISO, cloud-init env generation, and the mock server itself. Backward-compat fallback to 8114 is correctly guarded. No logic errors, security issues, or missing wiring were found. No files require special attention; all changes are self-consistent. Important Files Changed
Sequence DiagramsequenceDiagram
participant CLI as stack-cli / run-emulator.sh
participant ISO as runtime-config.iso
participant VM as VM cloud-init
participant Mock as mock-oauth-server (port 26704)
participant Browser as Browser
participant Backend as Backend inside VM
CLI->>ISO: write mock OAuth port (26704)
ISO->>VM: mount and source runtime env
VM->>Mock: start with port 26704 via env-file
VM->>Backend: set OAuth mock URL to localhost:26704
Note over CLI,Mock: QEMU hostfwd host:26704 to VM:26704
Browser->>Mock: OAuth redirect to localhost:26704
Mock-->>Browser: OIDC auth code
Browser->>Backend: callback with auth code
Backend->>Mock: token exchange at localhost:26704
Mock-->>Backend: access and id tokens
Reviews (1): Last reviewed commit: "fix(emulator): move mock OAuth off port ..." | Re-trigger Greptile |
Summary
${PORT_PREFIX}14(8114) inside the VM and the host forwarded the same port, colliding withpnpm dev's mock-oauth-server on 8114.EMULATOR_MOCK_OAUTH_PORT(default26704, joining the existing267xxhost port block) and binds the VM-internal mock to the same port. Same port on both sides keeps the OIDC issuer URL (http://localhost:26704) resolvable identically from the browser and from the backend inside the VM.runtime-config.isoasSTACK_EMULATOR_MOCK_OAUTH_HOST_PORT, read by cloud-init intoSTACK_OAUTH_MOCK_URL+ newSTACK_OAUTH_MOCK_PORT;mock-oauth-servernow prefersSTACK_OAUTH_MOCK_PORTsopnpm dev(which doesn't set it) stays on 8114.Files
docker/local-emulator/qemu/run-emulator.sh— newEMULATOR_MOCK_OAUTH_PORT, hostfwd/ensure_ports_free/runtime.env updatesdocker/local-emulator/qemu/cloud-init/emulator/user-data— reads the host port, setsSTACK_OAUTH_MOCK_URL+STACK_OAUTH_MOCK_PORTapps/mock-oauth-server/src/index.ts— honorsSTACK_OAUTH_MOCK_PORTpackages/stack-cli/src/commands/emulator.ts— default + runtime.env entryTest plan
pnpm emulator:buildsucceeds and new snapshot bootsstack emulator startwithpnpm devrunning on 8114 — no port collisionpnpm devmock OAuth unchanged (still 8114)Summary by CodeRabbit
Release Notes
New Features
Improvements