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#8082
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/8061
Author: @Gunterlie
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @Gunterlie
Base:
feat/7912-remote-login← Head:feat/remote-login-ui-7912📝 Commits (8)
576398cchore: start remote login settings, sessions and pairing codes (#7912)d4c9837feat(server): pairing codes, refused-device list and sign-out-others (#7912)cba4607feat(client): remote login, signed-in devices and Add a device in Settings (#7912)97bd2cdfix(server): let the sign-in form post on plain HTTP; hide stale no-login refusals (#7912)3cf88c7test: expect loginUser in the access status (#7912)60a17bcstyle: prettier (#7912)2c150dcfix(client): steady accent for errors, one-sentence copy (#7912)f87b2b7fix(server): end pairing codes with their sessions and merge allowlist refusals (#7912)📊 Changes
15 files changed (+731 additions, -16 deletions)
View changed files
📝
packages/client/src/components/diagnostics/use-access-warning-banner.tsx(+1 -0)➕
packages/client/src/components/diagnostics/use-refused-device-banners.tsx(+40 -0)📝
packages/client/src/components/layout/AppBannerHost.tsx(+7 -1)📝
packages/client/src/components/panels/settings/AccessStatusSettings.tsx(+7 -1)➕
packages/client/src/components/panels/settings/RemoteLoginSettings.tsx(+262 -0)➕
packages/client/src/hooks/use-remote-login.ts(+48 -0)📝
packages/client/src/localization/locales/en.json(+38 -0)📝
packages/server/src/config/login-credential.ts(+9 -1)📝
packages/server/src/middleware/basic-auth.ts(+109 -7)📝
packages/server/src/middleware/csrf-protection.ts(+12 -2)📝
packages/server/src/middleware/ip-allowlist.ts(+2 -0)➕
packages/server/src/middleware/refused-devices.ts(+44 -0)📝
packages/server/src/routes/access-status.routes.ts(+30 -4)📝
scripts/regressions/access-status.regression.ts(+1 -0)📝
scripts/regressions/remote-login.regression.ts(+121 -0)📄 Description
PR 3 of 4 into the #7912 integration branch (
feat/7912-remote-login). Assigned to @SpicyMarinara.Why
PR 1 and PR 2 gave Marinara a stored app login, a
/loginpage and server-side sessions, but the owner could manage them only through the API. You could not set the password in Settings, see which devices are signed in, or sign in a new device without typing the password on it. An iPhone home-screen app keeps its own cookie jar, so it asks for a fresh sign-in even when Safari is already signed in. And when a device was refused, the owner saw nothing in the app.While testing on a real browser I also found that the
/loginform from PR 2 did not work over plain HTTP on a LAN address: the browser sends noSec-Fetch-Sitethere, and the page'sno-referrerpolicy turns the form'sOriginintonull, so the CSRF hook refused every sign-in (403). This PR fixes that too, because pairing codes use the same form.What changed
Settings → Advanced → Access (the existing section, so no new settings-registry entry)
.envsets the login, the section says so and shows no write controls, so there is no 409 surprise.HAEC-J2UZ), valid once for 5 minutes. A signed-in device that is not the owner's computer also sees this block (the rest of the section stays owner-only).Server
POST /api/access/pairing-codes: allowed for a signed-in browser session or a privileged caller (the host, or the admin secret); a plain Basic Authorization script gets 403. 409 when no login exists.23456789ABCDEFGHJKMNPQRSTUVWXYZ(no 0/O/1/I/L). Only an HMAC with a per-process key stays in memory, so a restart ends every code. Each code is bound to the current login, so a password change ends open codes. Codes are compared in constant time and work once. At most 10 open codes. Signing out a device ends the codes it made; "sign out all other devices" ends every open code.POST /loginacceptscodeinstead ofuser/password(case, spaces and the dash do not matter) and starts a normal session. Wrong codes count toward the existing wrong-password lockout, and the lockout is checked before the code. A working code clears this browser's own wrong-guess count, like a working password.DELETE /api/access/sessionsnow keeps the caller's own session ("sign out all other devices"). From the host, which has no session, it still signs out everyone./api/access/statusaddsloginUserso the form can keep the username.GET /api/access/refusalsis loopback-only and returns device label, reason and time, without addresses. Once a login exists, "no login yet" entries are left out./login: the login page sets<meta name="referrer" content="same-origin">, and/loginalso accepts anOriginequal to the server's own origin. Cross-site posts are still refused.isHttpsRequesttrustsX-Forwarded-Protoonly from a local proxy, so I left it unchanged.Banner (host only)
useRefusedDeviceBannersadds oneAppBannercandidate per refused device to the sharedAppBannerHost: "A device tried to connect. Marinara turned away Safari on iPhone because remote access has no login yet." with Open access settings. It is a dismissable warning, and its id is stable while the same device keeps trying, so a dismissal holds. Other devices get 403 once and stop polling. The banner shows no IP addresses.Not in this PR (out of scope)
Passkeys, rolling sessions, multi-user accounts, QR-only pairing, env presets, host approval prompts. Docs for the app login, sessions and pairing codes in
docs/REMOTE_ACCESS.md: these are not in PR 1–3; they should come with PR 4 (with a[docs-i18n]follow-up).Validation (local)
remote-login.regression.ts(extended: sign-out-others, pairing create/redeem/single-use/expiry/lockout/password-change, codes ended by logout and by sign-out-others, a good code clears the wrong-guess count, refused-device list incl. merged allowlist entries, plain-HTTP/loginorigin): passloginUser), access-policy, basic-auth-throttle-security, loopback-proxy-auth-security, docker-proxy-auth, docker-gateway-auth-security, android-local-auth, issue-sweep-sep5, encoded-api-path-security, multiplayer-control-security: passtsc --noEmit, clienttsc -b,pnpm localization:check,pnpm check: pass (one existing lint warning inHomeProfessorMariChat.tsx, not touched here).envlogin / signed-in phone) at 390, 768 and 1440 px;/loginwith a code at 390, 768 and 1440 px; code sign-in → 303 + session,/api/chats200 for the paired phone, reused code 401.--destructive; new copy shortened to one sentence each). Rerun after the gate-review fixes: 0 findings.Manual verification
.envlogin shows the read-only note and no write controls./login./loginover plain HTTP on a LAN address and over HTTPS./loginat 390 px in light mode and in the SillyTavern theme.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.