mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[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
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1757
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.mdhas 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 -4for 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 theIP_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.@SpicyMarinara commented on GitHub (Jul 5, 2026):
Addressed in #3289.