mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
Centralize design store URL to the maintainer's VPS
The store was previously derived per-instance from VITE_GATEWAY_URL, so every self-hosted Docker image silently got its own empty, isolated catalog instead of sharing the curated one. The store is a single curated catalog (gateway/src/store.ts), unrelated to which TS3/TeaSpeak gateway a build otherwise talks to, so all builds now default to the same central endpoint. VITE_STORE_URL still lets a self-hoster point at their own store instead. DEMO_MODE keeps the old same-origin derivation, which 404s on the static demo host, so the public demo can never write to the real production store. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
da4f416e32
commit
395aa3e6b6
1 file changed
+12
-8
+12
-8
@@ -97,16 +97,20 @@ const FEEDBACK_URL = import.meta.env.DEV
|
||||
? `${import.meta.env.VITE_GATEWAY_URL.replace(/\/$/, "").replace(/^ws(s?):\/\//, "http$1://")}/api/feedback`
|
||||
: `${window.location.protocol}//${window.location.host}/api/feedback`;
|
||||
|
||||
// Same derivation again, for the design store (see gateway/src/index.ts's
|
||||
// /api/store/themes handler). Unlike FEEDBACK_URL/IS_OWN_HOSTED_INSTANCE this
|
||||
// isn't limited to the maintainer's own instance - any self-hosted gateway
|
||||
// can turn STORE_ENABLED on, so the button always shows and the store panel
|
||||
// itself reports "unavailable" if the gateway 404s.
|
||||
// Unlike GATEWAY_URL/FEEDBACK_URL above, the design store is NOT per-instance:
|
||||
// it's a single, centrally curated catalog run on the maintainer's own VPS
|
||||
// (see gateway/src/store.ts), so every build - official and self-hosted
|
||||
// Docker image alike - points at the same one by default, regardless of
|
||||
// which TS3/TeaSpeak gateway that build otherwise talks to. A self-hoster who
|
||||
// wants to run their own separate community store instead (their own
|
||||
// gateway's STORE_ENABLED=1) can override with VITE_STORE_URL at build time.
|
||||
// DEMO_MODE keeps the old same-origin derivation instead, which 404s on the
|
||||
// static demo host - the public demo has no write access to the real store.
|
||||
const STORE_URL = import.meta.env.DEV
|
||||
? "http://localhost:8080/api/store/themes"
|
||||
: import.meta.env.VITE_GATEWAY_URL
|
||||
? `${import.meta.env.VITE_GATEWAY_URL.replace(/\/$/, "").replace(/^ws(s?):\/\//, "http$1://")}/api/store/themes`
|
||||
: `${window.location.protocol}//${window.location.host}/api/store/themes`;
|
||||
: DEMO_MODE
|
||||
? `${window.location.protocol}//${window.location.host}/api/store/themes`
|
||||
: import.meta.env.VITE_STORE_URL || "https://gateway.webspeak3.de/api/store/themes";
|
||||
|
||||
// Ko-fi page of the project (.github/FUNDING.yml). Unlike the feedback button
|
||||
// below this is not limited to the maintainer's own instance: it ships in
|
||||
|
||||
Reference in new issue
Block a user