feat: add GitHub skin store and organize instance administration

Adopt the pinned published TeamSpeak SDK and direct relay routing.
Add optional TeamSpeak Query administration with encrypted credentials
and separate WebSpeak access, site, operations and skin management.
Distribute Discord Voice through the GitHub skin index, preserve skin
state during updates, and correct KAAK scaling and screen fullscreen.

Validation: 831 tests; backend and frontend builds; five-language UI
checks from narrow screens through 4K and local Query fixture actions.
This commit is contained in:
illusia committed 2026-10-24 12:52:59 +08:00
1 parent 180bfeb52f
commit 0af3236c30
95 files changed
+7678 -709

No files matched your search

+35
View File
@@ -28,6 +28,8 @@ export interface RelayNodeInput {
id?: string;
name: string;
target: string;
/** HTTPS origin of the WebSpeak voice gateway hosted on this relay. */
voiceEndpoint?: string;
enabled: boolean;
token?: string;
tokenAction?: "keep" | "replace" | "remove";
@@ -38,3 +40,36 @@ export interface ManagedInviteInput {
expiresInHours: number;
maxUses: number;
}
export interface TsAdminSettingsInput {
enabled: boolean;
transport?: "web" | "ssh" | "tcp";
queryHost?: string;
webQueryUrl?: string;
apiKey?: string;
apiKeyAction?: "keep" | "replace" | "remove";
/** 0 selects the fixed instance by its voice port. */
serverId?: number;
queryPort: number;
username: string;
password?: string;
passwordAction?: "keep" | "replace" | "remove";
hostKeyFingerprint: string;
}
export type TsAdminAction =
| { action: "server.update"; name: string; welcomeMessage: string; maxClients: number }
| { action: "channel.create"; name: string; parentId: string; description: string; permanent: boolean; password?: string }
| { action: "channel.update"; channelId: string; name: string }
| { action: "channel.delete"; channelId: string }
| { action: "client.move"; clientId: number; clientUid: string; channelId: string }
| { action: "client.kick"; clientId: number; clientUid: string; reason: string }
| { action: "client.ban"; clientId: number; clientUid: string; reason: string; durationSeconds: number }
| { action: "client.group"; clientId: number; clientUid: string; groupId: string; remove: boolean }
| { action: "ban.delete"; banId: string };
export interface TsAdminActionRequest {
/** Revision of the management configuration used to read the selected objects. */
configurationRevision: string;
operation: TsAdminAction;
}
+32 -1
View File
@@ -23,7 +23,7 @@ function object<T extends Record<string, Reader>>(fields: T): AdminResponseReade
}
const auditEvent = object({ event: text, createdAt: text });
const relayNode = object({ id: text, name: text, enabled: boolean, target: text, hasToken: boolean });
const relayNode = object({ id: text, name: text, enabled: boolean, target: text, voiceEndpoint: text, hasToken: boolean });
const welcomeTexts = object({ zh: text, en: text, de: text, ru: text, ja: text });
const settings = object({
target: text, hasPassword: boolean, accessMode: choice("fixed", "open"), siteName: text,
@@ -64,6 +64,33 @@ const skin = object({
description: optional(text), previewUrl: optional(text), previewMimeType: optional(text),
builtIn: optional(boolean), enabled: optional(boolean), previewKind: optional(choice("day", "night", "illusia")),
});
const storeMetadata = object({
schemaVersion: value => value === 1 ? 1 as const : invalid(),
id: text, name: text, version: text, author: text, license: text, description: text, minAppVersion: text,
package: object({ ref: text, path: text, sha256: text }),
});
const skinStore = object({
repository: text, appVersion: text, fetchedAt: number,
entries: array(object({ id: text, repository: text, metadata: nullable(storeMetadata), revision: text, compatible: boolean, error: nullable(text) })),
});
const tsAdminSettings = object({
configurationRevision: text,
fixedMode: boolean, enabled: boolean, queryPort: number, username: text,
transport: choice("web", "ssh", "tcp"), queryHost: text, webQueryUrl: text, serverId: number, hasApiKey: boolean,
hasPassword: boolean, hostKeyFingerprint: text, updatedAt: text,
});
const tsAdminOverview = object({
configurationRevision: text,
serverName: text, serverVersion: text, serverFamily: choice("ts3", "ts6", "unknown"),
channelCount: number, clientCount: number,
welcomeMessage: text, maxClients: number, uptimeSeconds: number,
channels: array(object({ id: text, parentID: text, name: text, description: text, totalClients: number, hasPassword: boolean })),
clients: array(object({ id: number, uid: text, nickname: text, channelID: text, serverGroups: array(text), away: boolean, inputMuted: boolean, outputMuted: boolean })),
groups: array(object({ id: text, name: text })), groupsAvailable: boolean, bansAvailable: boolean,
bans: array(object({ id: text, name: text, uid: text, reason: text, durationSeconds: number, createdAt: nullable(text) })),
observedAt: text,
});
const savedTsAdminSettings = object({ ok: choice(true), settings: tsAdminSettings });
const sessionStatus = object({ authenticated: boolean, mustChangePassword: optional(boolean), csrfToken: optional(text) });
export const adminResponses = {
@@ -87,6 +114,10 @@ export const adminResponses = {
database: object({ schemaVersion: number }), sessions: object({ created: number }),
}),
skins: object({ skins: array(skin), defaultSkinId: text }),
skinStore,
tsAdminSettings,
savedTsAdminSettings,
tsAdminOverview,
defaultSkin: object({ ok: choice(true), defaultSkinId: text }),
updatedSkin: object({ ok: choice(true), skin, defaultSkinId: text }),
uploadedSkin: object({ ok: choice(true), skin }),
+66
View File
@@ -0,0 +1,66 @@
/** Public GitHub distribution contract. Packages still use the ordinary .wskin importer. */
export const SKIN_STORE_REPOSITORY = "https://github.com/Huddle-Up-Forge/webspeak-skins";
export const SKIN_STORE_INDEX_URL = "https://raw.githubusercontent.com/Huddle-Up-Forge/webspeak-skins/master/index.json";
export interface SkinStoreMetadata {
schemaVersion: 1;
id: string;
name: string;
version: string;
author: string;
license: string;
description: string;
minAppVersion: string;
package: { ref: string; path: string; sha256: string };
}
export interface SkinStoreEntry {
id: string;
repository: string;
metadata: SkinStoreMetadata | null;
revision: string;
compatible: boolean;
error: string | null;
}
export interface SkinStoreCatalog {
repository: string;
appVersion: string;
fetchedAt: number;
entries: SkinStoreEntry[];
}
export interface SkinStoreInstallInput {
id: string;
revision: string;
/** Compare-and-set: do not overwrite a package another administrator changed. */
installedVersion: string | null;
}
const semver = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
export function isSkinStoreVersion(value: unknown): value is string {
return typeof value === "string" && value.length <= 32 && semver.test(value);
}
/** SemVer precedence, including prereleases; build metadata does not affect ordering. */
export function compareSkinVersions(left: string, right: string): number {
const a = semver.exec(left), b = semver.exec(right);
if (!a || !b) throw new Error("INVALID_SKIN_VERSION");
for (let i = 1; i <= 3; i++) {
if (a[i] !== b[i]) return BigInt(a[i]) < BigInt(b[i]) ? -1 : 1;
}
if (a[4] === b[4]) return 0;
if (!a[4]) return 1;
if (!b[4]) return -1;
const x = a[4].split("."), y = b[4].split(".");
for (let i = 0; i < Math.max(x.length, y.length); i++) {
if (x[i] === undefined) return -1;
if (y[i] === undefined) return 1;
if (x[i] === y[i]) continue;
const nx = /^\d+$/.test(x[i]), ny = /^\d+$/.test(y[i]);
if (nx && ny) return BigInt(x[i]) < BigInt(y[i]) ? -1 : 1;
if (nx !== ny) return nx ? -1 : 1;
return x[i] < y[i] ? -1 : 1;
}
return 0;
}