[PR #1742] [MERGED] fix: enable BYPASS_AUTH_DOCKER in docker-compose for host browser access #5253

Closed
opened 2026-10-22 04:14:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1742
Author: @felorhik
Created: 5/31/2026
Status: ✅ Merged
Merged: 5/31/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/docker-bypass-auth


📝 Commits (2)

  • bab4c89 fix: enable BYPASS_AUTH_DOCKER in docker-compose for host browser access
  • 3d194a7 fix: bind docker runtime compose port to localhost

📊 Changes

3 files changed (+16 additions, -2 deletions)

View changed files

📝 README.md (+7 -0)
📝 docker-compose.yml (+2 -1)
📝 docs/developer/run-build.html (+7 -1)

📄 Description

Linked issue

Fixes #1750

Why this change

When running marinara-server via docker compose up, requests from the host browser arrive at the container from the Docker gateway IP (172.17.0.1), not loopback. The security middleware treated this as a non-loopback remote access attempt and returned a 403 before the CORS layer could add browser-readable headers, so the browser surfaced the failure as a CORS error instead of an auth/configuration error.

The fix should preserve same-machine Docker browser access without making unauthenticated remote runtime access broadly available on every host interface.

What changed

  • Added BYPASS_AUTH_DOCKER: "true" to the Compose service so host-browser requests that arrive through the Docker bridge can pass the runtime auth gate.
  • Changed the Compose port mapping to 127.0.0.1:8787:8787 so the default Compose setup is same-machine only instead of host-wide.
  • Documented the localhost-only Compose default and the need to intentionally configure bind/auth settings for LAN or reverse-proxy access.

Refactor impact

Primary owner: remote runtime / Docker deployment

Impact areas reviewed:

  • docker-compose.yml
  • README.md
  • docs/developer/run-build.html

Boundary notes:

  • No engine, shared API, feature, or Tauri command source boundaries changed.
  • The auth behavior remains owned by the Rust remote runtime; this PR only changes the Docker deployment wrapper and docs around that runtime.

Pressure points touched:

  • Remote runtime Docker deployment and auth exposure defaults.
  • No ModeSurface, GameSurface, shared mode UI, command registration, or import modules touched.

Validation

  • Matching validation command passes locally (focused validation: pnpm check:docs, pnpm check:architecture, cargo check --manifest-path src-tauri/Cargo.toml --workspace, and Docker remote-runtime smoke)
  • pnpm check passes locally before PR push/handoff, including the unused-code check
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Browser screenshot/recording evidence added when UI/browser state is the claim
  • Remote runtime smoke checked when relevant

Manual verification notes

  • Ran docker compose config and confirmed the published port resolves to host_ip: 127.0.0.1, published: "8787", target: 8787.
  • Ran docker compose build --progress plain; image marinara-engine-server:local built successfully.
  • Ran docker compose up -d; container marinara-engine-server started successfully.
  • Confirmed GET http://127.0.0.1:8787/health returned {"ok":true,"runtime":"marinara-server","writable":true} with HTTP 200.
  • Confirmed browser-origin POST http://127.0.0.1:8787/api/invoke with Origin: http://localhost:1420, X-Marinara-CSRF: 1, and a storage_list payload returned [] with HTTP 200.
  • Confirmed docker ps showed 127.0.0.1:8787->8787/tcp, not 0.0.0.0:8787->8787/tcp.
  • Ran docker compose down after the smoke test to stop and remove the test container/network.
  • Ran node D:\dev\Marinara-Engine\.agents\automation\scripts\proof-health.mjs C:\tmp\marinara-pr-1742\scratch\pr-1742-docker-auth-ledger.json; proof health reported ready for risky auth/network work.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence (if applicable)

N/A — no visible UI changes. This is Docker remote-runtime network/auth behavior; runtime proof is captured in the manual verification notes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1742 **Author:** [@felorhik](https://github.com/felorhik) **Created:** 5/31/2026 **Status:** ✅ Merged **Merged:** 5/31/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/docker-bypass-auth` --- ### 📝 Commits (2) - [`bab4c89`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bab4c89514ecd0648029522d34b81702c11e5c79) fix: enable BYPASS_AUTH_DOCKER in docker-compose for host browser access - [`3d194a7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3d194a7c8207c025f66c9031323b76d22e918d7e) fix: bind docker runtime compose port to localhost ### 📊 Changes **3 files changed** (+16 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+7 -0) 📝 `docker-compose.yml` (+2 -1) 📝 `docs/developer/run-build.html` (+7 -1) </details> ### 📄 Description ## Linked issue Fixes #1750 ## Why this change When running `marinara-server` via `docker compose up`, requests from the host browser arrive at the container from the Docker gateway IP (`172.17.0.1`), not loopback. The security middleware treated this as a non-loopback remote access attempt and returned a 403 before the CORS layer could add browser-readable headers, so the browser surfaced the failure as a CORS error instead of an auth/configuration error. The fix should preserve same-machine Docker browser access without making unauthenticated remote runtime access broadly available on every host interface. ## What changed - Added `BYPASS_AUTH_DOCKER: "true"` to the Compose service so host-browser requests that arrive through the Docker bridge can pass the runtime auth gate. - Changed the Compose port mapping to `127.0.0.1:8787:8787` so the default Compose setup is same-machine only instead of host-wide. - Documented the localhost-only Compose default and the need to intentionally configure bind/auth settings for LAN or reverse-proxy access. ## Refactor impact Primary owner: remote runtime / Docker deployment Impact areas reviewed: - `docker-compose.yml` - `README.md` - `docs/developer/run-build.html` Boundary notes: - No engine, shared API, feature, or Tauri command source boundaries changed. - The auth behavior remains owned by the Rust remote runtime; this PR only changes the Docker deployment wrapper and docs around that runtime. Pressure points touched: - Remote runtime Docker deployment and auth exposure defaults. - No ModeSurface, GameSurface, shared mode UI, command registration, or import modules touched. ## Validation - [x] Matching validation command passes locally (focused validation: `pnpm check:docs`, `pnpm check:architecture`, `cargo check --manifest-path src-tauri/Cargo.toml --workspace`, and Docker remote-runtime smoke) - [ ] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [x] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Browser screenshot/recording evidence added when UI/browser state is the claim - [x] Remote runtime smoke checked when relevant ### Manual verification notes - Ran `docker compose config` and confirmed the published port resolves to `host_ip: 127.0.0.1`, `published: "8787"`, `target: 8787`. - Ran `docker compose build --progress plain`; image `marinara-engine-server:local` built successfully. - Ran `docker compose up -d`; container `marinara-engine-server` started successfully. - Confirmed `GET http://127.0.0.1:8787/health` returned `{"ok":true,"runtime":"marinara-server","writable":true}` with HTTP 200. - Confirmed browser-origin `POST http://127.0.0.1:8787/api/invoke` with `Origin: http://localhost:1420`, `X-Marinara-CSRF: 1`, and a `storage_list` payload returned `[]` with HTTP 200. - Confirmed `docker ps` showed `127.0.0.1:8787->8787/tcp`, not `0.0.0.0:8787->8787/tcp`. - Ran `docker compose down` after the smoke test to stop and remove the test container/network. - Ran `node D:\dev\Marinara-Engine\.agents\automation\scripts\proof-health.mjs C:\tmp\marinara-pr-1742\scratch\pr-1742-docker-auth-ledger.json`; proof health reported ready for risky auth/network work. ## Docs and release impact - [ ] No docs changes needed - [x] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [x] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence (if applicable) N/A — no visible UI changes. This is Docker remote-runtime network/auth behavior; runtime proof is captured in the manual verification notes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:37 +07:00
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
Pasta-Devs/Marinara-Engine#5253
No description provided.