[PR #3666] [MERGED] fix: restore Docker Desktop localhost access #6045

Closed
opened 2026-10-23 04:06:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3666
Author: @SpicyMarinara
Created: 7/16/2026
Status: ✅ Merged
Merged: 7/16/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/docker-desktop-localhost-access


📝 Commits (2)

  • e2bb9fa fix: restore Docker Desktop localhost access
  • d3fb73e refactor: preload Docker gateway detection

📊 Changes

9 files changed (+107 additions, -31 deletions)

View changed files

📝 .env.example (+13 -13)
📝 CHANGELOG.md (+1 -0)
📝 README.md (+1 -1)
📝 docs/CONFIGURATION.md (+2 -2)
📝 docs/REMOTE_ACCESS.md (+5 -5)
📝 docs/TROUBLESHOOTING.md (+1 -1)
📝 packages/server/src/config/runtime-config.ts (+6 -6)
📝 packages/server/src/middleware/ip-allowlist.ts (+67 -3)
📝 scripts/regressions/open-issues.regression.ts (+11 -0)

📄 Description

Why

The final v2.3.1 staging smoke test found that Docker Desktop for macOS exposes published localhost traffic to the container from its default gateway (192.168.215.1 in the reproduced environment). Marinara trusted only the conventional 172.16.0.0/12 Docker bridge range, so the healthy staging image returned 403 Forbidden for / and prevented a documented default install/update path from opening.

Fixes #3665.

What changed

  • Detect the exact IPv4 default gateway from /proc/net/route once during Docker module initialization.
  • Treat that one address as same-host Docker traffic alongside the existing 172.16.0.0/12 range.
  • Preserve BYPASS_AUTH_DOCKER=false and REQUIRE_AUTH_FOR_DOCKER_PROXY=true as explicit security controls.
  • Add route-table regression coverage, release notes, and matching access-control documentation.
  • Apply CodeRabbit's strict-assertion and request-path I/O suggestions.

Validation performed

  • pnpm check
  • pnpm regression — 60 passed, 38 intentional project/viewport skips
  • pnpm regression:issues after review refinements
  • pnpm version:check
  • pnpm credits:check
  • pnpm guard:installer-artifacts
  • pnpm release:notes -- 2.3.1
  • git diff --check
  • Built a production container from final commit d3fb73e51.
  • Docker Desktop default: /api/health 200 with 2.3.1+d3fb73e51, / 200, /manifest.json 200.
  • BYPASS_AUTH_DOCKER=false: /api/health 200, / 403.
  • REQUIRE_AUTH_FOR_DOCKER_PROXY=true: direct / 200, forwarded request 403.

Manual verification still requested

  • Manually open the published localhost URL on Docker Desktop for macOS.
  • Manually open the published localhost URL on Docker Desktop for Windows.
  • Manually confirm a configured Docker reverse proxy continues to behave as expected.

🔄 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/3666 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/16/2026 **Status:** ✅ Merged **Merged:** 7/16/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/docker-desktop-localhost-access` --- ### 📝 Commits (2) - [`e2bb9fa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e2bb9fa080e89928c9d4374d4735faa66a3b3bf9) fix: restore Docker Desktop localhost access - [`d3fb73e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d3fb73e5161b059470524bc9f7dcd99508a0be30) refactor: preload Docker gateway detection ### 📊 Changes **9 files changed** (+107 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+13 -13) 📝 `CHANGELOG.md` (+1 -0) 📝 `README.md` (+1 -1) 📝 `docs/CONFIGURATION.md` (+2 -2) 📝 `docs/REMOTE_ACCESS.md` (+5 -5) 📝 `docs/TROUBLESHOOTING.md` (+1 -1) 📝 `packages/server/src/config/runtime-config.ts` (+6 -6) 📝 `packages/server/src/middleware/ip-allowlist.ts` (+67 -3) 📝 `scripts/regressions/open-issues.regression.ts` (+11 -0) </details> ### 📄 Description ## Why The final v2.3.1 staging smoke test found that Docker Desktop for macOS exposes published localhost traffic to the container from its default gateway (`192.168.215.1` in the reproduced environment). Marinara trusted only the conventional `172.16.0.0/12` Docker bridge range, so the healthy staging image returned `403 Forbidden` for `/` and prevented a documented default install/update path from opening. Fixes #3665. ## What changed - Detect the exact IPv4 default gateway from `/proc/net/route` once during Docker module initialization. - Treat that one address as same-host Docker traffic alongside the existing `172.16.0.0/12` range. - Preserve `BYPASS_AUTH_DOCKER=false` and `REQUIRE_AUTH_FOR_DOCKER_PROXY=true` as explicit security controls. - Add route-table regression coverage, release notes, and matching access-control documentation. - Apply CodeRabbit's strict-assertion and request-path I/O suggestions. ## Validation performed - `pnpm check` - `pnpm regression` — 60 passed, 38 intentional project/viewport skips - `pnpm regression:issues` after review refinements - `pnpm version:check` - `pnpm credits:check` - `pnpm guard:installer-artifacts` - `pnpm release:notes -- 2.3.1` - `git diff --check` - Built a production container from final commit `d3fb73e51`. - Docker Desktop default: `/api/health` 200 with `2.3.1+d3fb73e51`, `/` 200, `/manifest.json` 200. - `BYPASS_AUTH_DOCKER=false`: `/api/health` 200, `/` 403. - `REQUIRE_AUTH_FOR_DOCKER_PROXY=true`: direct `/` 200, forwarded request 403. ## Manual verification still requested - [ ] Manually open the published localhost URL on Docker Desktop for macOS. - [ ] Manually open the published localhost URL on Docker Desktop for Windows. - [ ] Manually confirm a configured Docker reverse proxy continues to behave as expected. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:06:32 +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#6045
No description provided.