mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8829] [MERGED] feat(access): make the admin secret in the app; signed-in browsers use installed agents #8833
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#8833
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/8829
Author: @Gunterlie
Created: 11/4/2026
Status: ✅ Merged
Merged: 11/4/2026
Merged by: @Gunterlie
Base:
staging← Head:feat/admin-secret-in-app📝 Commits (5)
bba080ffeat(access): make the admin secret in the app; signed-in browsers use installed agents5eae2d8fix(access): review fixes for the in-app admin secret149275afix(access): name only .env in the no-secret refusal when loopback needs the secret536329cfix(access): let the owner remove an unused app admin secret while .env winsd112da1test(access): expect adminSecretSource and adminSecretStored in the status📊 Changes
18 files changed (+342 additions, -34 deletions)
View changed files
📝
.env.example(+1 -0)📝
README.md(+1 -1)📝
docs/CONFIGURATION.md(+2 -2)📝
docs/REMOTE_ACCESS.md(+25 -7)📝
docs/TROUBLESHOOTING.md(+2 -2)📝
docs/connections/local-model.md(+1 -1)📝
packages/client/src/components/diagnostics/use-access-warning-banner.tsx(+4 -0)📝
packages/client/src/components/panels/SettingsPanel.tsx(+8 -1)📝
packages/client/src/components/panels/settings/AccessStatusSettings.tsx(+108 -3)📝
packages/client/src/lib/api-client.ts(+1 -1)📝
packages/client/src/localization/locales/en.json(+15 -1)📝
packages/server/src/config/login-credential.ts(+59 -4)📝
packages/server/src/middleware/ip-allowlist.ts(+2 -3)📝
packages/server/src/middleware/privileged-gate.ts(+8 -7)📝
packages/server/src/routes/access-status.routes.ts(+26 -0)📝
packages/server/src/services/capability-packages/capability-route-registration.service.ts(+8 -1)📝
scripts/regressions/access-status.regression.ts(+2 -0)📝
scripts/regressions/remote-login.regression.ts(+69 -0)📄 Description
Linked issue
No linked issue. A maintainer asked for this change directly (planned work, no separate feature request).
Why this change
Remote devices need the admin secret for risky actions (backups, data clear, updates, installs). Until now the only way to get one was to edit
ADMIN_SECRETin the server.env. The app login can already be set in the app, so the admin secret should work the same way.Also, opening an installed agent (for example a Home screen agent) from a signed-in phone failed without the admin secret, because every package route sat behind the admin gate. Installing a package already needs the secret, so its routes are trusted code; normal use should only need the login.
What changed
POST/DELETE /api/access/admin-secret. Only a caller that already has admin rights may use them: this computer (loopback, unlessMARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK=true) or a device that sends the current secret. A browser that is only signed in cannot, so a stolen session cannot take over the risky actions.DATA_DIR/.admin-secret.json(0600, atomic write, re-read on change like the login file). Case, spaces and dashes do not matter when typing it.ADMIN_SECRETin.envwins;DELETEclears the app file even then, so an old app secret cannot come back when.envis cleared.privileged-gate.tsand the access policy use the newgetAdminSecretSource()/matchesAdminSecret();/api/access/statusreportsadminSecretSource..envinstead..env-managed secrets show a note.signedIn: trueincapability-route-registration.service.ts). Install, update and removal routes still need the admin secret.settings.accessStatus.secretNotSetmention the in-app path.REMOTE_ACCESS.md(Admin Access section rewritten with docs-writing rules),CONFIGURATION.md,TROUBLESHOOTING.md,connections/local-model.md,README.md,.env.example.Validation
Commands run locally:
pnpm check(passes; existing unrelated lint warnings only)pnpm localization:checkremote-login(new admin-secret block: signed-in browser refused, loopback makes a readable secret, only the hash is saved, loose typing works, rotation kills the old secret, new secret works remotely,.envwins with 409, DELETE under.envclears the file),access-policy,lockdown-setup-security,capability-internal-route,capability-package-lifecycle,docker-proxy-auth,loopback-proxy-auth-security,multiplayer-control-security.Review: local CodeRabbit could not run (CLI not authenticated on this machine). A Marinara reviewer agent found nothing blocking; its 4 low/medium findings (Docker path, stale
.env-only texts, old app secret reviving after.envremoval, README) are fixed in the second commit.pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Not done yet. Please verify:
ADMIN_SECRETin.env: Admin Access shows the.envnote, no buttons..envpointer, not the buttons.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue openedFollow-up for translations: #8830
UI evidence (if applicable)
No screenshots yet (see manual verification).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.