mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #465] [Feature]: server-side extension storage for cross-device sync (mirroring synced themes) #205
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#205
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 @Romuromylus on GitHub (May 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/465
What problem does this solve?
Extensions in Marinara are currently stored in browser
localStorageand are therefore per-device + per-browser. A user with Marinara on desktop + phone has to:This is inconsistent with how custom themes already work (synced via
/api/themes+useLegacyThemeMigration), and it gets worse the more devices a user uses Marinara on.Proposed solution
Move extensions from
localStorageto server-side storage, exactly like custom themes. Concrete shape:installed_extensionstable (file-backed + legacy SQLite both supported viaFILE_BACKED_TABLES)./api/extensionsCRUD route (GET /,POST /,PATCH /:id,DELETE /:id). Noscript.js-style endpoint — keep the v1.5.8 client-side blob-URL loader unchanged so extension execution semantics are identical to today.useExtensions()React Query hook with the same polling/refetch options asuseThemes()so devices observe each other's installs/toggles within ~15s.useLegacyExtensionMigration()mirrorsuseLegacyThemeMigration()— reads existinglocalStorageon first load, replays each entry against/api/extensions, dedupes onname + css + js, then flips a one-shot migration flag.LegacyInstalledExtensiontype retained inui.store.tssolely for migration replay; canonicalInstalledExtensiontype comes from@marinara-engine/shared.Hardening that the existing v1.5.7 → v1.5.8 path didn't need but server-side storage does:
.max()size caps oncss(256 KiB) andjs(1 MiB) in the zod create/update schemas so theinstalled_extensionstable can't be ballooned./api/extensionsrate-limited to 60 req/min/IP via the existing rate-limit middleware so an XSS-driven mass install can't exploit the persistent storage path.marinara.apiFetchrejects calls to/extensions/*and/admin/*so a malicious installed extension can't re-install itself after the user deletes it or pivot to admin endpoints.Alternatives considered
<script src>to side-step CSP. That conflicted with the v1.5.8 loader you'd already chosen and was correctly closed. This proposal keeps your loader intact and only changes the storage layer.Additional context
useLegacyThemeMigrationpattern that already shipped — no new architecture concepts.POST /api/extensionsinstead of a session-bounded one. The rate limit + size cap +apiFetchdenylist mitigate this; the underlying assumption is still "an XSS that bypasses our existing CSP is already game over."Template check