[GH-ISSUE #3260] docs: docs/REMOTE_ACCESS.md is out of date - the 'blocked IP is logged' tip is false; contradicts itself on restarts #1757

Closed
opened 2026-10-21 05:42:20 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Jul 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3260

Originally assigned to: @SpicyMarinara on GitHub.

docs/REMOTE_ACCESS.md has drifted from the shipped app. Found in a full docs-vs-code audit against v2.1.0. Each item below is independently checkable: open the doc at the noted spot and compare against the app or code. These can all land in one PR that refreshes the file.

2 items found.


1. "Verifying it works" → "Still getting a 403?" checklist, line 171: "Is the client IP what you expect? Marinara logs the blocked IP to the server console."

(incorrect)

The advice fails in exactly the scenarios this checklist serves. (1) IP-allowlist rejections (Option 2) are never logged: ipAllowlistHook sends its 403 with no logger call on either deny path - and never has, including at the commit that introduced this doc sentence, so the claim was false for Option 2 from day one. (2) The only blocked-IP log in the codebase is the no-auth lockdown warn in basic-auth, and it is gated by a one-shot process-wide flag (lockdownAnnounced), so only the FIRST refused connection since server start is logged; blocking a second device (test phone, then tablet) prints nothing with the new IP. (3) There is no fallback via per-request logs either: default LOG_LEVEL is "warn" and app.ts passes disableRequestLogging the function reference isRequestLoggingDisabled (always truthy), so Fastify request logging is permanently off. A user tuning IP_ALLOWLIST who follows this bullet will watch a console that never prints their client IP. (Note: when Basic Auth IS configured, a wrong/missing password produces a 401 challenge, not a 403 - so the checklist's 403 cases are precisely the two above.)

Suggested fix: Rewrite the bullet to match reality: "Is the client IP what you expect? Check on the device itself (Wi-Fi connection details, or tailscale ip -4 for Tailscale) - IP-allowlist rejections are not logged to the console. If no Basic Auth is configured, the first refused connection per server run is logged as [basic-auth] Refused non-loopback connection from <ip>, and the browser lockdown page displays the connecting IP (it even pre-fills the IP_ALLOWLIST= line for you)." Be careful NOT to point allowlist users at the lockdown page as the primary tool: ipAllowlistHook runs before basicAuthHook (app.ts:121 vs 127), so an allowlist rejection returns bare JSON {"error":"Forbidden"} and the IP-displaying lockdown page never renders - it only appears once the request passes the allowlist stage with no Basic Auth set (e.g. after temporarily setting IP_ALLOWLIST_ENABLED=false per line 97). Alternatively, add a per-rejection debug/warn log with the client IP to ipAllowlistHook and keep the doc text - but then also remove the one-shot gate or the doc is still wrong for repeat rejections.


2. Restart instructions at lines 13 (TL;DR: "set BASIC_AUTH_USER and BASIC_AUTH_PASS in .env, restart"), 64 (Option 1: "Restart Marinara, then open it in your browser"), and 189 (privileged actions step 1: "Set ADMIN_SECRET=<...> in .env and restart") - contradicting lines 37 and 155

(outdated)

The doc contradicts itself about restarts. Lines 37 and 155 correctly state that Basic Auth credentials and ADMIN_SECRET hot-apply within ~2 seconds (line 155 explicitly lists BASIC_AUTH_USER/PASS/REALM and ADMIN_SECRET as hot-reloadable), yet the three step-by-step instructions tell the user to restart. Code confirms hot-reload end to end: the env watcher is started at boot, polls .env every 2s, and writes changed keys into process.env; getBasicAuthConfig and getAdminSecret read process.env on every call; the basic-auth hook re-resolves credentials per request; the privileged gate reads the admin secret per request; and neither key is in RESTART_REQUIRED_KEYS. Following the restart instruction still works, but the contradiction wastes time and undermines the restart-required section the doc itself links for troubleshooting. The lines that say "restart" are the pre-hot-reload instructions that were never updated when the env watcher shipped.

Suggested fix: Align the three spots with lines 37/155: line 13 TL;DR → "...set BASIC_AUTH_USER and BASIC_AUTH_PASS in .env, save (applies within a couple of seconds - no restart needed), and use those credentials when the browser prompts."; line 64 → "Save .env - the change applies within a couple of seconds (no restart needed). Then open Marinara from the remote device..."; line 189 → "Set ADMIN_SECRET= in .env and save - it applies within a couple of seconds, no restart needed." Keep the existing line 37/40 caveat that Docker-Compose environment:-style config isn't a watched .env file and does need a container restart. Companion fix worth doing in the same pass: the server-rendered lockdown page hard-codes the same stale instruction three times ("restart Marinara, then refresh this page" / "Restart Marinara Engine") at packages/server/src/middleware/basic-auth.ts:258, 270, 283 - users who never open the doc still get told to restart.

Originally created by @kolacheee on GitHub (Jul 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3260 Originally assigned to: @SpicyMarinara on GitHub. `docs/REMOTE_ACCESS.md` has drifted from the shipped app. Found in a full docs-vs-code audit against **v2.1.0**. Each item below is independently checkable: open the doc at the noted spot and compare against the app or code. These can all land in one PR that refreshes the file. **2 items found.** --- ### 1. "Verifying it works" → "Still getting a 403?" checklist, line 171: "Is the client IP what you expect? Marinara logs the blocked IP to the server console." *(incorrect)* The advice fails in exactly the scenarios this checklist serves. (1) IP-allowlist rejections (Option 2) are never logged: ipAllowlistHook sends its 403 with no logger call on either deny path - and never has, including at the commit that introduced this doc sentence, so the claim was false for Option 2 from day one. (2) The only blocked-IP log in the codebase is the no-auth lockdown warn in basic-auth, and it is gated by a one-shot process-wide flag (lockdownAnnounced), so only the FIRST refused connection since server start is logged; blocking a second device (test phone, then tablet) prints nothing with the new IP. (3) There is no fallback via per-request logs either: default LOG_LEVEL is "warn" and app.ts passes disableRequestLogging the function reference isRequestLoggingDisabled (always truthy), so Fastify request logging is permanently off. A user tuning IP_ALLOWLIST who follows this bullet will watch a console that never prints their client IP. (Note: when Basic Auth IS configured, a wrong/missing password produces a 401 challenge, not a 403 - so the checklist's 403 cases are precisely the two above.) **Suggested fix:** Rewrite the bullet to match reality: "Is the client IP what you expect? Check on the device itself (Wi-Fi connection details, or `tailscale ip -4` for Tailscale) - IP-allowlist rejections are not logged to the console. If no Basic Auth is configured, the first refused connection per server run is logged as `[basic-auth] Refused non-loopback connection from <ip>`, and the browser lockdown page displays the connecting IP (it even pre-fills the `IP_ALLOWLIST=` line for you)." Be careful NOT to point allowlist users at the lockdown page as the primary tool: ipAllowlistHook runs before basicAuthHook (app.ts:121 vs 127), so an allowlist rejection returns bare JSON `{"error":"Forbidden"}` and the IP-displaying lockdown page never renders - it only appears once the request passes the allowlist stage with no Basic Auth set (e.g. after temporarily setting IP_ALLOWLIST_ENABLED=false per line 97). Alternatively, add a per-rejection debug/warn log with the client IP to ipAllowlistHook and keep the doc text - but then also remove the one-shot gate or the doc is still wrong for repeat rejections. --- ### 2. Restart instructions at lines 13 (TL;DR: "set BASIC_AUTH_USER and BASIC_AUTH_PASS in .env, restart"), 64 (Option 1: "Restart Marinara, then open it in your browser"), and 189 (privileged actions step 1: "Set ADMIN_SECRET=<...> in .env and restart") - contradicting lines 37 and 155 *(outdated)* The doc contradicts itself about restarts. Lines 37 and 155 correctly state that Basic Auth credentials and ADMIN_SECRET hot-apply within ~2 seconds (line 155 explicitly lists BASIC_AUTH_USER/PASS/REALM and ADMIN_SECRET as hot-reloadable), yet the three step-by-step instructions tell the user to restart. Code confirms hot-reload end to end: the env watcher is started at boot, polls .env every 2s, and writes changed keys into process.env; getBasicAuthConfig and getAdminSecret read process.env on every call; the basic-auth hook re-resolves credentials per request; the privileged gate reads the admin secret per request; and neither key is in RESTART_REQUIRED_KEYS. Following the restart instruction still works, but the contradiction wastes time and undermines the restart-required section the doc itself links for troubleshooting. The lines that say "restart" are the pre-hot-reload instructions that were never updated when the env watcher shipped. **Suggested fix:** Align the three spots with lines 37/155: line 13 TL;DR → "...set BASIC_AUTH_USER and BASIC_AUTH_PASS in .env, save (applies within a couple of seconds - no restart needed), and use those credentials when the browser prompts."; line 64 → "Save .env - the change applies within a couple of seconds (no restart needed). Then open Marinara from the remote device..."; line 189 → "Set ADMIN_SECRET=<some-strong-random-string> in .env and save - it applies within a couple of seconds, no restart needed." Keep the existing line 37/40 caveat that Docker-Compose `environment:`-style config isn't a watched .env file and does need a container restart. Companion fix worth doing in the same pass: the server-rendered lockdown page hard-codes the same stale instruction three times ("restart Marinara, then refresh this page" / "Restart Marinara Engine") at packages/server/src/middleware/basic-auth.ts:258, 270, 283 - users who never open the doc still get told to restart.
bsakaguchi 2026-10-21 05:42:20 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jul 5, 2026):

Addressed in #3289.

<!-- gh-comment-id:4887420553 --> @SpicyMarinara commented on GitHub (Jul 5, 2026): Addressed in #3289.
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#1757
No description provided.