[PR #8102] [MERGED] feat: guided remote login with a real login page (#7912) #8101

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

📋 Pull Request Information

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

Base: staging ← Head: feat/7912-remote-login


📝 Commits (10+)

  • 15c1128 feat(server): stored login, setup code and /login page (#7912)
  • 366be8a style: format remote login changes
  • 3196b94 feat(server): server-side remote login sessions and review fixes (#7912)
  • 201f0b0 fix(server): show an error when /login cannot start a session
  • e06c415 fix(server): count wrong passwords per browser behind a local proxy
  • 6d12c1f test(server): wrong passwords on health checks count toward the lockout
  • 4901db8 fix(server): remote login gate-review fixes (#7912)
  • e3d4d0d fix(server): retry an unreadable login file at the normal interval
  • 4ade0dc Merge pull request #8016 from Pasta-Devs/feat/remote-login-7912
  • ed9d67c feat(server): trust a forward-auth proxy by socket address (#7912)

📊 Changes

49 files changed (+3534 additions, -417 deletions)

View changed files

📝 .env.example (+8 -1)
📝 Dockerfile (+2 -0)
📝 Dockerfile.lite (+2 -0)
📝 README.md (+1 -1)
📝 docs/CONFIGURATION.md (+6 -3)
📝 docs/FAQ.md (+3 -3)
📝 docs/REMOTE_ACCESS.md (+84 -74)
📝 docs/TROUBLESHOOTING.md (+4 -3)
📝 docs/UPGRADING.md (+2 -2)
📝 docs/appearance/custom-css-themes.md (+1 -1)
📝 docs/data/backup-and-restore.md (+1 -1)
📝 docs/game/game-assets.md (+1 -1)
📝 docs/home/professor-mari.md (+1 -1)
📝 docs/installation/containers.md (+5 -7)
📝 docs/installation/ios-pwa.md (+1 -1)
📝 docs/installation/macos-linux.md (+2 -2)
📝 docs/integrations/haptic-feedback.md (+1 -1)
📝 docs/media/music.md (+2 -2)
📝 package.json (+1 -0)
📝 packages/client/src/App.tsx (+21 -2)

...and 29 more files

📄 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 #7912 (part of #7909)

Why this change

Today the only way to protect a Marinara install that other devices can reach is to put BASIC_AUTH_USER / BASIC_AUTH_PASS into .env and restart. Many owners never do that, so their install stays open. The browser Basic Auth dialog also breaks iPhone home-screen apps, and Docker owners must edit files inside a container.

This PR makes the safe path the easy one: you set a login once, from the browser, and every other device signs in on a real login page. Local use on the same computer stays passwordless.

What changed

  • Login without .env: the login is stored hashed (scrypt) in DATA_DIR/.remote-login.json. BASIC_AUTH_* in .env still wins when set.
  • First login from any device: when no login exists and Marinara listens beyond this computer, the server prints a one-time setup code (XXXX-XXXX-XXXX-XXXX) to its log (docker logs for Docker). You type it on the lockdown page or in Settings to set the login.
  • Real login page at /login with server-side sessions: one sign-in per device, a working "Sign out", and the session ends when the password changes. Scripts can still send the Basic Auth header.
  • Settings → Advanced → Access: change or remove the login (needs the current password), see signed-in devices and sign them out, sign out this device, and add a device with a short pairing code (8 characters, valid 5 minutes).
  • Forward-auth proxies (Authelia, Authentik, tinyauth): new TRUSTED_AUTH_PROXY=<IP or CIDR> skips the Marinara login for requests from that proxy only. Broad and public ranges are refused.
  • pnpm reset-login (also in the Docker image) removes the stored login and prints a new setup code. It works without a restart.
  • App banners now show below the top bar, stacked with other top notices, so they never cover the chat composer. The host sees a banner when another device was refused.
  • Docs: docs/REMOTE_ACCESS.md, CONFIGURATION.md, FAQ.md, TROUBLESHOOTING.md, UPGRADING.md and the install guides describe the new flow.

Sub-PRs merged into the integration branch after local checks and an Opus review gate each: #8016, #8056, #8061, #8070, #8092, #8093.

Release note

Marinara now has a real login page. Set your login in the browser (Settings → Advanced → Access, or the setup code from the server log), sign in once per device, and manage signed-in devices in Settings. If you open Marinara through Tailscale Serve or another proxy and have no login yet, you now see the lockdown page: set a login with the setup code from the server log (docker logs for Docker).

Validation

  • 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

Automated: each sub-PR ran pnpm check, server/client tsc, pnpm localization:check and the regressions remote-login, lockdown-setup-security, access-status, access-policy, basic-auth-throttle-security, loopback-proxy-auth-security, route-rate-limits locally. A Docker friction walk on a dev box found 1 blocker and 21 smaller items; #8092 and #8093 fix all of them.

Manual verification notes

  • Fresh Docker install, open from another device: the lockdown page shows; the setup code from docker logs sets the login; that device is then signed in.
  • On the Docker host browser (signed in), Settings → Advanced → Access can change the login with the current password.
  • Sign in on a phone, add it to the iPhone home screen, reopen it: it stays signed in.
  • Settings → Access: sign out another device, then sign out this device; both land on /login.
  • "Add a device": a pairing code signs in a second device; the code stops working after 5 minutes.
  • docker exec <container> pnpm reset-login: the login is gone at once and a new setup code shows in the log.
  • Behind Authelia/Authentik with TRUSTED_AUTH_PROXY set: no second Marinara login; without it, the Marinara login shows.
  • Tailscale Serve install without a login: the lockdown page shows and the setup code works.
  • Local use on the same computer (localhost) needs no login.
  • Banner at 390 px and 1440 px: below the top bar, does not cover the composer, stacks with the update notice.

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)

A docs-i18n mirror PR follows after this merges.

UI evidence

Screenshots of the login page, lockdown page, Settings → Access and the banner stack are in the sub-PRs (#8061, #8070, #8093).


🔄 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/8102 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `feat/7912-remote-login` --- ### 📝 Commits (10+) - [`15c1128`](https://github.com/Pasta-Devs/Marinara-Engine/commit/15c1128879e75e43cebb03bf8b33e2a7382fe0f3) feat(server): stored login, setup code and /login page (#7912) - [`366be8a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/366be8a4113d45d3a69228ef68197e06a454251b) style: format remote login changes - [`3196b94`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3196b94887ccff5262506156015e5bd3c312e02d) feat(server): server-side remote login sessions and review fixes (#7912) - [`201f0b0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/201f0b0749e2fa6f5bb6232ac9d1b72eca552eb1) fix(server): show an error when /login cannot start a session - [`e06c415`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e06c415259e09a640fd0ebe3dbdb5c2306d69f91) fix(server): count wrong passwords per browser behind a local proxy - [`6d12c1f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6d12c1f5545f473e5deaf13f4b6acab4cdc3a5d4) test(server): wrong passwords on health checks count toward the lockout - [`4901db8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4901db863ac323299c82611a8b32308547fa5153) fix(server): remote login gate-review fixes (#7912) - [`e3d4d0d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e3d4d0d4551ad99748f1711acbddd6b4d345f082) fix(server): retry an unreadable login file at the normal interval - [`4ade0dc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4ade0dcffe9602fdd2ac1c2e08010a67f18f410e) Merge pull request #8016 from Pasta-Devs/feat/remote-login-7912 - [`ed9d67c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ed9d67ce5c3a228be5f681764cb087bd7c0a17b6) feat(server): trust a forward-auth proxy by socket address (#7912) ### 📊 Changes **49 files changed** (+3534 additions, -417 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+8 -1) 📝 `Dockerfile` (+2 -0) 📝 `Dockerfile.lite` (+2 -0) 📝 `README.md` (+1 -1) 📝 `docs/CONFIGURATION.md` (+6 -3) 📝 `docs/FAQ.md` (+3 -3) 📝 `docs/REMOTE_ACCESS.md` (+84 -74) 📝 `docs/TROUBLESHOOTING.md` (+4 -3) 📝 `docs/UPGRADING.md` (+2 -2) 📝 `docs/appearance/custom-css-themes.md` (+1 -1) 📝 `docs/data/backup-and-restore.md` (+1 -1) 📝 `docs/game/game-assets.md` (+1 -1) 📝 `docs/home/professor-mari.md` (+1 -1) 📝 `docs/installation/containers.md` (+5 -7) 📝 `docs/installation/ios-pwa.md` (+1 -1) 📝 `docs/installation/macos-linux.md` (+2 -2) 📝 `docs/integrations/haptic-feedback.md` (+1 -1) 📝 `docs/media/music.md` (+2 -2) 📝 `package.json` (+1 -0) 📝 `packages/client/src/App.tsx` (+21 -2) _...and 29 more files_ </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 #7912 (part of #7909) ## Why this change Today the only way to protect a Marinara install that other devices can reach is to put `BASIC_AUTH_USER` / `BASIC_AUTH_PASS` into `.env` and restart. Many owners never do that, so their install stays open. The browser Basic Auth dialog also breaks iPhone home-screen apps, and Docker owners must edit files inside a container. This PR makes the safe path the easy one: you set a login once, from the browser, and every other device signs in on a real login page. Local use on the same computer stays passwordless. ## What changed - **Login without `.env`:** the login is stored hashed (scrypt) in `DATA_DIR/.remote-login.json`. `BASIC_AUTH_*` in `.env` still wins when set. - **First login from any device:** when no login exists and Marinara listens beyond this computer, the server prints a one-time setup code (`XXXX-XXXX-XXXX-XXXX`) to its log (`docker logs` for Docker). You type it on the lockdown page or in Settings to set the login. - **Real login page** at `/login` with server-side sessions: one sign-in per device, a working "Sign out", and the session ends when the password changes. Scripts can still send the Basic Auth header. - **Settings → Advanced → Access:** change or remove the login (needs the current password), see signed-in devices and sign them out, sign out this device, and add a device with a short pairing code (8 characters, valid 5 minutes). - **Forward-auth proxies** (Authelia, Authentik, tinyauth): new `TRUSTED_AUTH_PROXY=<IP or CIDR>` skips the Marinara login for requests from that proxy only. Broad and public ranges are refused. - **`pnpm reset-login`** (also in the Docker image) removes the stored login and prints a new setup code. It works without a restart. - **App banners** now show below the top bar, stacked with other top notices, so they never cover the chat composer. The host sees a banner when another device was refused. - **Docs:** `docs/REMOTE_ACCESS.md`, `CONFIGURATION.md`, `FAQ.md`, `TROUBLESHOOTING.md`, `UPGRADING.md` and the install guides describe the new flow. Sub-PRs merged into the integration branch after local checks and an Opus review gate each: #8016, #8056, #8061, #8070, #8092, #8093. ### Release note > Marinara now has a real login page. Set your login in the browser (Settings → Advanced → Access, or the setup code from the server log), sign in once per device, and manage signed-in devices in Settings. **If you open Marinara through Tailscale Serve or another proxy and have no login yet, you now see the lockdown page: set a login with the setup code from the server log (`docker logs` for Docker).** ## Validation - [ ] `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` Automated: each sub-PR ran `pnpm check`, server/client `tsc`, `pnpm localization:check` and the regressions `remote-login`, `lockdown-setup-security`, `access-status`, `access-policy`, `basic-auth-throttle-security`, `loopback-proxy-auth-security`, `route-rate-limits` locally. A Docker friction walk on a dev box found 1 blocker and 21 smaller items; #8092 and #8093 fix all of them. ### Manual verification notes - [ ] Fresh Docker install, open from another device: the lockdown page shows; the setup code from `docker logs` sets the login; that device is then signed in. - [ ] On the Docker host browser (signed in), Settings → Advanced → Access can change the login with the current password. - [ ] Sign in on a phone, add it to the iPhone home screen, reopen it: it stays signed in. - [ ] Settings → Access: sign out another device, then sign out this device; both land on `/login`. - [ ] "Add a device": a pairing code signs in a second device; the code stops working after 5 minutes. - [ ] `docker exec <container> pnpm reset-login`: the login is gone at once and a new setup code shows in the log. - [ ] Behind Authelia/Authentik with `TRUSTED_AUTH_PROXY` set: no second Marinara login; without it, the Marinara login shows. - [ ] Tailscale Serve install without a login: the lockdown page shows and the setup code works. - [ ] Local use on the same computer (`localhost`) needs no login. - [ ] Banner at 390 px and 1440 px: below the top bar, does not cover the composer, stacks with the update notice. ## 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) A docs-i18n mirror PR follows after this merges. ## UI evidence Screenshots of the login page, lockdown page, Settings → Access and the banner stack are in the sub-PRs (#8061, #8070, #8093). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:10:23 +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#8101
No description provided.