Design Store: moderation queue and stricter CSS check (S4, S13)

New submissions are "pending" until approved by the STORE_ADMIN_TOKEN
holder via the new /api/store/admin review page (CSS shown as text only).
Theme CSS is normalized (comments, escapes, case) before checking and may
no longer load anything: no @import/@font-face, no image-set()/src()/etc.,
url() only for inline data: images. Already-approved themes failing the
new check are hidden. Store file is written atomically.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
MoepchiandClaude Opus 5.5 committed 2026-09-27 19:01:53 +00:00
1 parent b87eb0f4b7
commit 57447fdd11
8 files changed
+179 -34

No files matched your search

+4 -2
View File
@@ -5487,7 +5487,7 @@ function DesignStorePanel({
() => localStorage.getItem(STORE_ADMIN_TOKEN_KEY) ?? ""
);
const [publishing, setPublishing] = useState(false);
const [publishResult, setPublishResult] = useState<"ok" | "error" | null>(null);
const [publishResult, setPublishResult] = useState<"ok" | "pending" | "error" | null>(null);
const [ratedIds, setRatedIds] = useState<Set<string>>(new Set());
const refreshThemes = () =>
@@ -5567,7 +5567,8 @@ function DesignStorePanel({
}),
});
if (!res.ok) throw new Error(String(res.status));
setPublishResult("ok");
const body = (await res.json().catch(() => ({}))) as { status?: string };
setPublishResult(body.status === "pending" ? "pending" : "ok");
setPublishAuthor("");
setPublishDescription("");
setPublishScreenshot(null);
@@ -5715,6 +5716,7 @@ function DesignStorePanel({
{t("design.store.publish.submit")}
</button>
{publishResult === "ok" && <p className="ts-options-subtitle">{t("design.store.publish.success")}</p>}
{publishResult === "pending" && <p className="ts-options-subtitle">{t("design.store.publish.pending")}</p>}
{publishResult === "error" && <p className="ts-options-subtitle">{t("design.store.publish.error")}</p>}
</>
)}
+1
View File
@@ -315,6 +315,7 @@
"design.store.publish.adminTokenPlaceholder": "Leer lassen, außer du weißt, was das ist",
"design.store.publish.submit": "Im Store veröffentlichen",
"design.store.publish.success": "Design wurde veröffentlicht!",
"design.store.publish.pending": "Danke! Dein Design wurde eingereicht und erscheint im Store, sobald es geprüft wurde.",
"design.store.publish.error": "Veröffentlichen fehlgeschlagen.",
"options.section.erweiterungen": "Erweiterungen",
"options.section.hotkeys": "Hotkeys",
+1
View File
@@ -315,6 +315,7 @@
"design.store.publish.adminTokenPlaceholder": "Leave empty unless you know what this is",
"design.store.publish.submit": "Publish to the store",
"design.store.publish.success": "Design published!",
"design.store.publish.pending": "Thanks! Your design was submitted and will appear in the store once it has been reviewed.",
"design.store.publish.error": "Publishing failed.",
"options.section.erweiterungen": "Addons",
"options.section.hotkeys": "Hotkeys",
+1
View File
@@ -315,6 +315,7 @@
"design.store.publish.adminTokenPlaceholder": "اگر نمی‌دانی این چیست، خالی بگذار",
"design.store.publish.submit": "انتشار در فروشگاه",
"design.store.publish.success": "طراحی منتشر شد!",
"design.store.publish.pending": "ممنون! طراحی تو ارسال شد و پس از بررسی در فروشگاه نمایش داده می‌شود.",
"design.store.publish.error": "انتشار ناموفق بود.",
"options.section.erweiterungen": "افزونه‌ها",
"options.section.hotkeys": "کلیدهای میانبر",
+1
View File
@@ -598,6 +598,7 @@
"design.store.publish.adminTokenPlaceholder": "不确定的话请留空",
"design.store.publish.submit": "发布到商店",
"design.store.publish.success": "设计已发布!",
"design.store.publish.pending": "谢谢!你的设计已提交,审核通过后将显示在商店中。",
"design.store.publish.error": "发布失败。",
"recording.autoGainControl": "自动增益控制",
"tree.streaming": "正在直播",