Add custom domain support
Docker / build-and-push-image (push) Successful in 1m41s

This commit is contained in:
Jon Staab
2026-06-11 14:28:12 -07:00
parent bd3217f43d
commit 90f5a55269
20 changed files with 629 additions and 13 deletions
+4
View File
@@ -50,6 +50,8 @@ export type Relay = {
status: string
sync_error: string
synced: number
custom_domain: string
custom_domain_verified: number
info_name: string
info_icon: string
info_description: string
@@ -76,6 +78,7 @@ export type CreateRelayInput = {
blossom_enabled?: number
livekit_enabled?: number
push_enabled?: number
custom_domain?: string
}
export type UpdateRelayInput = {
@@ -91,6 +94,7 @@ export type UpdateRelayInput = {
blossom_enabled?: number
livekit_enabled?: number
push_enabled?: number
custom_domain?: string
}
export type Tenant = {
+39
View File
@@ -0,0 +1,39 @@
import { createSignal } from "solid-js"
import type { Relay } from "@/lib/api"
import { getRelay, updateRelay } from "@/lib/api"
export default function useCustomDomain(relayId: () => string, mutate: (relay: Relay) => void) {
const [saving, setSaving] = createSignal(false)
const [verifying, setVerifying] = createSignal(false)
const [error, setError] = createSignal<string>()
async function saveDomain(domain: string) {
setSaving(true)
setError(undefined)
try {
const updated = await updateRelay(relayId(), { custom_domain: domain })
mutate(updated)
} catch (e: unknown) {
setError(e instanceof Error ? e.message : "Failed to save domain")
} finally {
setSaving(false)
}
}
// Verification runs in a background poller on the backend; reload the relay so
// the UI picks up the latest custom_domain_verified state.
async function verifyDomain() {
setVerifying(true)
setError(undefined)
try {
const updated = await getRelay(relayId())
mutate(updated)
} catch (e: unknown) {
setError(e instanceof Error ? e.message : "Verification failed")
} finally {
setVerifying(false)
}
}
return { saving, verifying, error, saveDomain, verifyDomain }
}