[PR #7955] [MERGED] feat: owner access status and open-access warning (#7911) #8025

Closed
opened 2026-10-24 04:09:45 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7955
Author: @Gunterlie
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @Gunterlie

Base: staging ← Head: feat/access-status-7911


📝 Commits (10+)

  • fec0f8f feat: owner-only access status and open-access warning (#7911)
  • 75e706b Merge remote-tracking branch 'origin/staging' into feat/access-status-7911
  • c53af78 fix: model remote devices in the access status (#7911)
  • cce978e fix: access status review follow-ups (#7911)
  • 3021371 fix: bind-aware tailscale check and 403-only owner note (#7911)
  • 1cea979 fix(server): rate-limit the access status route (#7911)
  • 4a0294e fix: access status review fixes (#7911)
  • 3e548fb fix(client): refresh access status every 5 minutes (#7911)
  • f8a31e9 Merge remote-tracking branch 'origin/staging' into feat/access-status-7911
  • 6c480c1 Merge remote-tracking branch 'origin/staging' into feat/access-status-7911

📊 Changes

11 files changed (+511 additions, -19 deletions)

View changed files

➕ packages/client/src/components/diagnostics/use-access-warning-banner.tsx (+68 -0)
📝 packages/client/src/components/layout/AppBannerHost.tsx (+2 -1)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+3 -0)
➕ packages/client/src/components/panels/settings/AccessStatusSettings.tsx (+104 -0)
📝 packages/client/src/localization/locales/en.json (+37 -0)
📝 packages/server/src/index.ts (+10 -0)
📝 packages/server/src/middleware/ip-allowlist.ts (+86 -18)
➕ packages/server/src/routes/access-status.routes.ts (+32 -0)
📝 packages/server/src/routes/index.ts (+2 -0)
📝 packages/shared/src/constants/settings-registry.ts (+8 -0)
➕ scripts/regressions/access-status.regression.ts (+159 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.

Linked issue

Closes #7911 (parent #7909).

Why this change

Owners cannot see whether other devices reach their Marinara without a password. Installs that were open to the internet ran for weeks without anyone noticing, because nothing in the app said so. This adds one plain place in Settings that tells the owner who can get in without a password, and a banner when that list is not empty. Local use stays passwordless; the goal is that the safe setup is also the easy one to check.

What changed

  • Server GET /api/access/status (routes/access-status.routes.ts), owner-only through requirePrivilegedAccess. Returns the listen address, whether it is loopback-only, login / admin secret / allowlist state, whether this request came through a proxy, and passwordlessPeers.
  • passwordlessPeers (middleware/ip-allowlist.ts getPasswordlessPeers) runs the same evaluateAccessPolicy the request hooks use on one sample device per kind (internet, privateNetwork, tailscale, docker, proxy), so the summary cannot drift from enforcement. It uses the address the server really listens on (request.server.server.address()), not HOST from .env. tailscale is listed only when the server listens on all interfaces or on a Tailscale address.
  • Startup log warning when the list is not empty (index.ts).
  • Client:
    • Settings → "Access status" section (AccessStatusSettings.tsx, registry entry in settings-registry.ts). Non-owners see "only the owner" on 403; other errors show a short load-failed line.
    • Warning banner through the shared AppBannerHost (use-access-warning-banner.tsx): critical when internet is listed, else warning. The banner id follows the visible list, so a dismissed banner returns only when the message changes.
    • New en.json keys under settings.accessStatus.* and the banner.
  • Regression scripts/regressions/access-status.regression.ts: each peer kind on and off, real bind address vs a changed HOST, Tailscale with an injected interface, owner-only gate.

Not in this PR: a warning for very broad allowlists such as 0.0.0.0/0 (the section only says allowlisted devices get in without a password). Follow-up if wanted.

Validation

  • pnpm check and pnpm localization:check pass locally; access-status, access-policy, loopback-proxy-auth-security, docker-gateway-auth-security regressions pass.

  • Opus adversarial review: findings fixed — real bind address instead of HOST, Docker sample no longer marked as relayed (a default Docker install without a login now lists docker), allowlist line, banner severity, real Tailscale test, typed default facts.

  • Local CodeRabbit: round 1, 4 findings — 3 fixed (typed facts instead of a cast, banner id, plainer copy); amber classes kept. Round 2, 3 findings — 2 fixed (Tailscale on a fixed LAN bind, 403-only owner note). Rejected twice: replacing the amber classes with theme tokens — the merged AppBanner uses the same amber classes on purpose because no --warning token exists.

  • GitHub review round (CodeRabbit 4, Dottore 5): 7 fixed in 4a0294e01 (status refresh every 5 minutes and on Settings open, startup log uses the real bind address, allowlist peer kind, proxy only for loopback/any-address binds, login advice only without a login, clearer 403 text); 2 rejected with reasons in the threads (non-dismissible banner; accent colour instead of amber).

  • This PR and #7952 both add one candidate to AppBannerHost; whichever merges second resolves a one-line conflict.

  • pnpm check passes locally

  • Container (Docker / Podman) built and ran without issue

  • Ran the app, clicked through the changes manually

  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)

  • Above manual verification completed (describe below)

  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify a default local install (127.0.0.1) shows "only this computer" in Settings → Access status and no banner.
  • Manually verify HOST=0.0.0.0 with no login shows the LAN line and a warning banner, and that setting a login clears both.
  • Manually verify a default Docker install without a login lists Docker devices, and the list clears after a login is set.
  • Manually verify a visitor who is not the owner sees only the owner-only note.
  • Manually verify light and dark theme at phone and desktop width.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

No files under docs/ change.

UI evidence (if applicable)

Screenshots at 390 / 768 / 1440 px, light and dark (closed, open, critical, owner-only states) were taken locally. The CLI cannot attach images.


🔄 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/7955 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `feat/access-status-7911` --- ### 📝 Commits (10+) - [`fec0f8f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fec0f8f996fd8228b80f1e979c923ed7c35ae17a) feat: owner-only access status and open-access warning (#7911) - [`75e706b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/75e706bcae0e2104e2cdf458833323e8a9f7a6ef) Merge remote-tracking branch 'origin/staging' into feat/access-status-7911 - [`c53af78`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c53af7814721cd46f0511cde9d66942c73ca6012) fix: model remote devices in the access status (#7911) - [`cce978e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cce978e851ea048551b1e00f2c9c86ffd6f131b4) fix: access status review follow-ups (#7911) - [`3021371`](https://github.com/Pasta-Devs/Marinara-Engine/commit/302137149e544f682a01414ad414ee260a6ea4ad) fix: bind-aware tailscale check and 403-only owner note (#7911) - [`1cea979`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1cea979e4cd23737eca5d6f569d791afa6bc36b5) fix(server): rate-limit the access status route (#7911) - [`4a0294e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4a0294e01b2c2cd19c133d695352e9a231701d45) fix: access status review fixes (#7911) - [`3e548fb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3e548fba94be15686385917d9e21b5df01bd47b4) fix(client): refresh access status every 5 minutes (#7911) - [`f8a31e9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f8a31e96c594742fdf6ee351d69b36d0d0225458) Merge remote-tracking branch 'origin/staging' into feat/access-status-7911 - [`6c480c1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6c480c19f08cac7472046d1610221dfce1fcb27f) Merge remote-tracking branch 'origin/staging' into feat/access-status-7911 ### 📊 Changes **11 files changed** (+511 additions, -19 deletions) <details> <summary>View changed files</summary> ➕ `packages/client/src/components/diagnostics/use-access-warning-banner.tsx` (+68 -0) 📝 `packages/client/src/components/layout/AppBannerHost.tsx` (+2 -1) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+3 -0) ➕ `packages/client/src/components/panels/settings/AccessStatusSettings.tsx` (+104 -0) 📝 `packages/client/src/localization/locales/en.json` (+37 -0) 📝 `packages/server/src/index.ts` (+10 -0) 📝 `packages/server/src/middleware/ip-allowlist.ts` (+86 -18) ➕ `packages/server/src/routes/access-status.routes.ts` (+32 -0) 📝 `packages/server/src/routes/index.ts` (+2 -0) 📝 `packages/shared/src/constants/settings-registry.ts` (+8 -0) ➕ `scripts/regressions/access-status.regression.ts` (+159 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. ## Linked issue Closes #7911 (parent #7909). ## Why this change Owners cannot see whether other devices reach their Marinara without a password. Installs that were open to the internet ran for weeks without anyone noticing, because nothing in the app said so. This adds one plain place in Settings that tells the owner who can get in without a password, and a banner when that list is not empty. Local use stays passwordless; the goal is that the safe setup is also the easy one to check. ## What changed - Server `GET /api/access/status` (`routes/access-status.routes.ts`), owner-only through `requirePrivilegedAccess`. Returns the listen address, whether it is loopback-only, login / admin secret / allowlist state, whether this request came through a proxy, and `passwordlessPeers`. - `passwordlessPeers` (`middleware/ip-allowlist.ts` `getPasswordlessPeers`) runs the same `evaluateAccessPolicy` the request hooks use on one sample device per kind (`internet`, `privateNetwork`, `tailscale`, `docker`, `proxy`), so the summary cannot drift from enforcement. It uses the address the server really listens on (`request.server.server.address()`), not `HOST` from `.env`. `tailscale` is listed only when the server listens on all interfaces or on a Tailscale address. - Startup log warning when the list is not empty (`index.ts`). - Client: - Settings → "Access status" section (`AccessStatusSettings.tsx`, registry entry in `settings-registry.ts`). Non-owners see "only the owner" on 403; other errors show a short load-failed line. - Warning banner through the shared `AppBannerHost` (`use-access-warning-banner.tsx`): `critical` when `internet` is listed, else `warning`. The banner id follows the visible list, so a dismissed banner returns only when the message changes. - New `en.json` keys under `settings.accessStatus.*` and the banner. - Regression `scripts/regressions/access-status.regression.ts`: each peer kind on and off, real bind address vs a changed `HOST`, Tailscale with an injected interface, owner-only gate. Not in this PR: a warning for very broad allowlists such as `0.0.0.0/0` (the section only says allowlisted devices get in without a password). Follow-up if wanted. ## Validation - `pnpm check` and `pnpm localization:check` pass locally; `access-status`, `access-policy`, `loopback-proxy-auth-security`, `docker-gateway-auth-security` regressions pass. - Opus adversarial review: findings fixed — real bind address instead of `HOST`, Docker sample no longer marked as relayed (a default Docker install without a login now lists `docker`), allowlist line, banner severity, real Tailscale test, typed default facts. - Local CodeRabbit: round 1, 4 findings — 3 fixed (typed facts instead of a cast, banner id, plainer copy); amber classes kept. Round 2, 3 findings — 2 fixed (Tailscale on a fixed LAN bind, 403-only owner note). Rejected twice: replacing the amber classes with theme tokens — the merged `AppBanner` uses the same amber classes on purpose because no `--warning` token exists. - GitHub review round (CodeRabbit 4, Dottore 5): 7 fixed in 4a0294e01 (status refresh every 5 minutes and on Settings open, startup log uses the real bind address, `allowlist` peer kind, `proxy` only for loopback/any-address binds, login advice only without a login, clearer 403 text); 2 rejected with reasons in the threads (non-dismissible banner; accent colour instead of amber). - This PR and #7952 both add one candidate to `AppBannerHost`; whichever merges second resolves a one-line conflict. - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify a default local install (`127.0.0.1`) shows "only this computer" in Settings → Access status and no banner. - Manually verify `HOST=0.0.0.0` with no login shows the LAN line and a warning banner, and that setting a login clears both. - Manually verify a default Docker install without a login lists Docker devices, and the list clears after a login is set. - Manually verify a visitor who is not the owner sees only the owner-only note. - Manually verify light and dark theme at phone and desktop width. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No files under `docs/` change. ## UI evidence (if applicable) Screenshots at 390 / 768 / 1440 px, light and dark (closed, open, critical, owner-only states) were taken locally. The CLI cannot attach images. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:45 +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#8025
No description provided.