diff --git a/docker-compose.yml b/docker-compose.yml index 13077d49e..c74016764 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -594,6 +594,8 @@ services: SITES_DOMAIN: tngl.io KNOTMIRROR_URL: https://mirror.tngl.boltless.dev DELIBERI_URL: https://deliberi.tngl.boltless.dev + PRIMARY_KNOT: knot2.tngl.boltless.dev + PRIMARY_SPINDLE: spindle.tngl.boltless.dev CAMO_URL: https://camo.tngl.boltless.dev CAMO_SHARED_SECRET: localinfra-camo-secret AVATAR_URL: https://avatar.tngl.boltless.dev diff --git a/web/src/app.d.ts b/web/src/app.d.ts index fbdefa38d..9763b6245 100644 --- a/web/src/app.d.ts +++ b/web/src/app.d.ts @@ -17,6 +17,8 @@ declare global { deliberiUrl: string; sitesDomain: string; moderationServiceDid: string; + primaryKnotHostname: string; + primarySpindleHostname: string; turnstileSiteKey: string; camoEnabled: boolean; // when the server defers the diff fetch to the browser diff --git a/web/src/lib/components/repo/RepoCreationForm.svelte b/web/src/lib/components/repo/RepoCreationForm.svelte index d815bfa27..33fb43d74 100644 --- a/web/src/lib/components/repo/RepoCreationForm.svelte +++ b/web/src/lib/components/repo/RepoCreationForm.svelte @@ -25,6 +25,7 @@
{:then saved} - {#each saved.knots as knot (knot)} + {#each makeKnotList(saved.knots) as knot (knot)}
{knot} @@ -264,7 +275,7 @@ {#await preferences} {:then saved} - {#each saved.spindles as spindle (spindle)} + {#each makeSpindleList(saved.spindles) as spindle (spindle)}
{spindle} diff --git a/web/src/lib/server/config.ts b/web/src/lib/server/config.ts index 61a572c15..ded88b2e7 100644 --- a/web/src/lib/server/config.ts +++ b/web/src/lib/server/config.ts @@ -27,6 +27,8 @@ export type WebConfig = { camoSecret: string; avatarSecret: string; moderationServiceDid: string; + primaryKnotHostname: string; + primarySpindleHostname: string; turnstileSiteKey: string; /** see SSR_DIFF_MAX_BYTES */ ssrDiffMaxBytes: number; @@ -40,6 +42,8 @@ export type PublicWebConfig = Pick< | "deliberiUrl" | "sitesDomain" | "moderationServiceDid" + | "primaryKnotHostname" + | "primarySpindleHostname" | "turnstileSiteKey" | "ssrDiffMaxBytes" | "ogreUrl" @@ -62,6 +66,8 @@ type WebConfigEnv = { AVATAR_SHARED_SECRET?: string; OGRE_URL?: string; MODERATION_SERVICE_DID?: string; + PRIMARY_KNOT?: string; + PRIMARY_SPINDLE?: string; TURNSTILE_SITE_KEY?: string; /** diff payloads above this many bytes are not buffered through the ssr * worker; the page refetches them from the browser instead. "0" disables */ @@ -80,6 +86,8 @@ export const resolveConfig = (values: WebConfigEnv): WebConfig => ({ camoSecret: values.CAMO_SHARED_SECRET?.trim() ?? "", avatarSecret: values.AVATAR_SHARED_SECRET?.trim() ?? "", moderationServiceDid: values.MODERATION_SERVICE_DID?.trim() ?? "", + primaryKnotHostname: values.PRIMARY_KNOT?.trim() ?? "knot1.tangled.sh", + primarySpindleHostname: values.PRIMARY_SPINDLE?.trim() ?? "spindle.tangled.sh", turnstileSiteKey: values.TURNSTILE_SITE_KEY?.trim() ?? "", ssrDiffMaxBytes: bytes(values.SSR_DIFF_MAX_BYTES, 5 * 1024 * 1024) }); @@ -97,6 +105,8 @@ export const getPublicConfig = (): PublicWebConfig => { deliberiUrl: config.deliberiUrl, sitesDomain: config.sitesDomain, moderationServiceDid: config.moderationServiceDid, + primaryKnotHostname: config.primaryKnotHostname, + primarySpindleHostname: config.primarySpindleHostname, turnstileSiteKey: config.turnstileSiteKey, ssrDiffMaxBytes: config.ssrDiffMaxBytes, ogreUrl: config.ogreUrl,