mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#8088
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8070
Author: @Gunterlie
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @Gunterlie
Base:
feat/7912-remote-login← Head:feat/lockdown-setup-7912📝 Commits (8)
a8d781afeat(server): set the first login from the lockdown page with the setup code (#7912)9d7cb64docs: describe the first login from any device with the setup code (#7912)1f0038etest: expect the setup form, not an allowlist snippet, on the LAN lockdown page (#7912)52279defix: format the lockdown page, isolate its regression data, split the troubleshooting bullet (#7912)6403127fix(server): print a new setup code when saving the login fails, name the setup code in the lockdown log (#7912)4ea6ca1fix(server): let the lockdown setup form pass CSRF from real browsers, cap public form bodies (#7912)245571afix(server): offer the setup form to proxied visitors when a code exists, clarify the Docker reset (#7912)09c5a4cfix(server): keep setup-code guesses off the password lockout and away from proxied visitors (#7912)📊 Changes
11 files changed (+413 additions, -76 deletions)
View changed files
📝
README.md(+1 -1)📝
docs/CONFIGURATION.md(+2 -0)📝
docs/FAQ.md(+3 -3)📝
docs/REMOTE_ACCESS.md(+31 -21)📝
docs/TROUBLESHOOTING.md(+3 -2)📝
docs/UPGRADING.md(+1 -1)📝
packages/server/src/config/login-credential.ts(+7 -1)📝
packages/server/src/middleware/basic-auth.ts(+128 -44)📝
packages/server/src/middleware/csrf-protection.ts(+2 -2)➕
scripts/regressions/lockdown-setup-security.regression.ts(+233 -0)📝
scripts/regressions/loopback-proxy-auth-security.regression.ts(+2 -1)📄 Description
PR 4 of 4 into the #7912 integration branch (
feat/7912-remote-login). Builds on PR 1 (stored login, setup code,/login, sessions) and PR 2 (TRUSTED_AUTH_PROXY). Rebased onto the integration branch after PR 3 (#8061) merged.Why
PUT /api/access/login, which a refused remote device cannot reach from the lockdown page. So these owners must edit.envby hand. Now the lockdown page has a form: setup code (from the server log, e.g.docker logs) + username + password. The first login is set from any device, and that device stays signed in.IP_ALLOWLIST. The page and its JSON message now offer only a login (setup form, Settings on the host, orBASIC_AUTH_USER/BASIC_AUTH_PASS). The "equal bypass option" text indocs/REMOTE_ACCESS.mdgoes too.What changed
POST /login/setup(server-rendered form on the lockdown page): checks the setup code with the existing constant-time compare (isLoginSetupCode), consumes it before the firstawaitso it stays single-use, saves the login, starts a browser session, redirects to/.countGuess/lockoutSeconds) but in their own bucket, per direct address only: 10 wrong codes give that address 429 +Retry-Afteron the setup form, and never lock/login. Visitors behind a proxy on this computer share one address, so they are not counted (the code is 96 random bits and single-use); otherwise a stranger behind Tailscale Serve or a tunnel could keep the owner out. Wrong codes log as "Wrong setup code from …".<meta name="referrer" content="same-origin">(as the/loginpage does), so the form posts its real Origin, and/login/setupshares the same-origin shortcut of/login, includingsameServerOriginfor plain HTTP./loginand/login/setupaccept at most 8 KB bodies (413), because anyone can post them during lockdown..envfirst;IP_ALLOWLISTstays there for the owner.pnpm reset-login, "Add a device" pairing codes, and an upgrade note for same-host proxy users without a password.scripts/regressions/lockdown-setup-security.regression.ts: form and referrer meta shown, code not leaked, no bypass flag names in the HTML pages (direct, proxied, 400, 403, 429, 500, success) or JSON replies (direct and proxied), 12 wrong proxied codes then the right code → 303, wrong setup codes do not lock/login, browser-like headers (same-origin passes, plain-HTTP own Origin passes, cross-site andOrigin: nullrefused), 413 for large bodies, a failed save prints a new code, wrong codes lock out, right code sets the login and a session, code works once.Manual verification
HOST=0.0.0.0; open the app from a phone on the LAN. The lockdown page shows the setup form and says where the code is./loginpage.docker logs <container>and works on the lockdown page.Release note
docker logs) plus a username and password on the lockdown page.BASIC_AUTH_USERandBASIC_AUTH_PASSin.env.Local validation
heavy pnpm check→ exit 0 (see the latest run in the agent report).pnpm --filter @marinara-engine/server lint(server tsc) → exit 0.node scripts/run-regressions.mjs --filter lockdown1/1,--filter auth6/6,--filter remote-login1/1,--filter access-status1/1./login/setupCSRF shortcut (checked by reverting it once).HOST=0.0.0.0, request from the host's LAN IP with browser headers): lockdown page 403 with form and referrer meta; right code withOriginover plain HTTP → 303 + session cookie; cross-site Origin → 403; 10 KB sign-in body → 413.Local CodeRabbit review
DATA_DIRin the regression; split Troubleshooting bullet).DATA_DIR. Not changed: "remove the internal file name from CONFIGURATION.md" — that file is the server configuration reference, and the file name tells Docker owners which file holds the app login (.env.examplenames it too).Follow-ups
docs/changes from PR 2 (TRUSTED_AUTH_PROXY) and this PR need a[docs-i18n]follow-up for the translated language packs.Linked issue: #7912
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.