mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 03:52:50 +08:00
feat: add verified console self-update for release packages
Check official GitHub Releases, require SHA256SUMS, safely extract and swap release-package code, roll back on failed health checks, and persist task state across restarts. Docker and source deployments stay check-only. Add updater tests, route security tests and five-language admin copy.
This commit is contained in:
1 parent
ae6788a796
commit
2de2e23fd3
32 files changed
+3573
-16
No files matched your search
@@ -273,7 +273,50 @@
|
||||
>{{ tr("exportBackup") }}</button
|
||||
></article
|
||||
>
|
||||
<div class="alert info system-notice"><Icon name="info" :size="16"/><span>{{ tr('updateNotice', {version: operations.diagnostics.version || '—'}) }}</span></div>
|
||||
<article class="operation-card update-card" data-admin-update="version">
|
||||
<header>
|
||||
<div><h3>{{ tr('updateTitle') }}</h3><p>{{ tr('updateLead') }}</p></div>
|
||||
<span :class="['state-pill', canApplyUpdates ? 'active' : '']">{{ canApplyUpdates ? tr('updateCanApply') : tr('updateCannotApply') }}</span>
|
||||
</header>
|
||||
<dl class="diagnostic-list">
|
||||
<div><dt>{{ tr('updateCurrentVersion') }}</dt><dd>{{ operations.update.currentVersion || operations.diagnostics.version || '—' }}</dd></div>
|
||||
<div><dt>{{ tr('updateDeploymentMode') }}</dt><dd>{{ deploymentLabel }}</dd></div>
|
||||
<div><dt>{{ tr('updateArchitecture') }}</dt><dd>{{ operations.update.deployment.platform || '—' }} / {{ operations.update.deployment.architecture || '—' }}</dd></div>
|
||||
</dl>
|
||||
<div v-if="operations.update.task" class="update-task" data-admin-update-task>
|
||||
<strong>{{ tr('updateTaskTitle') }}: {{ updateTaskStatusLabel }}</strong>
|
||||
<small v-if="updateTaskErrorText">{{ updateTaskErrorText }}</small>
|
||||
<small v-else-if="operations.update.task.status === 'succeeded'">{{ tr('updateRestartHint') }}</small>
|
||||
<small v-if="operations.update.task.rolledBack">{{ tr('updateRolledBack') }}</small>
|
||||
<small v-if="operations.update.task.finishedAt">{{ formatDate(operations.update.task.finishedAt) }}</small>
|
||||
</div>
|
||||
<div v-if="!canApplyUpdates" class="alert info system-notice">
|
||||
<Icon name="info" :size="16"/><span>{{ blockedUpdateText }}</span>
|
||||
</div>
|
||||
<template v-else>
|
||||
<p class="field-help">{{ tr('updateBackupHint') }}</p>
|
||||
<div class="update-actions">
|
||||
<button class="secondary-button" type="button" :disabled="updateChecking" @click="checkForUpdates">
|
||||
<span v-if="updateChecking" class="spinner small"></span><Icon v-else name="refresh" :size="17"/>
|
||||
{{ updateChecking ? tr('updateChecking') : tr('updateCheckAction') }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="availableUpdates.length" class="update-release-list">
|
||||
<strong>{{ tr('updateSelectRelease') }}</strong>
|
||||
<label v-for="release in availableUpdates" :key="release.version" class="update-release-row">
|
||||
<input v-model="selectedVersion" type="radio" :value="release.version" :disabled="!release.canApply || updateApplying" />
|
||||
<span><strong>v{{ release.version }}</strong> <small>{{ formatDate(release.publishedAt) }}</small></span>
|
||||
<a v-if="release.releaseUrl" :href="release.releaseUrl" target="_blank" rel="noreferrer">{{ tr('updateReleaseNotes') }}</a>
|
||||
<small v-if="!release.canApply" class="muted-label">{{ releaseBlockedText(release) }}</small>
|
||||
</label>
|
||||
<button class="primary-button" type="button" :disabled="!selectedRelease || updateApplying" @click="applySelectedUpdate">
|
||||
<span v-if="updateApplying" class="spinner small"></span>
|
||||
{{ updateApplying ? tr('updateApplying') : tr('updateApplyAction') }}
|
||||
</button>
|
||||
</div>
|
||||
<p v-else-if="updateChecked" class="field-help">{{ tr('updateUpToDate') }}</p>
|
||||
</template>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -288,13 +331,51 @@ import type { AdminConnectionRecord } from "../../../../src/shared/admin-respons
|
||||
const props = defineProps<{
|
||||
model: ReturnType<typeof useAdminOperations>;
|
||||
initialSection?: string;
|
||||
i18n: Pick<ReturnType<typeof useAdminI18n>, "tr" | "formatDate" | "formatAge" | "sessionStateLabel" | "connectionStatusLabel" | "inviteStatusLabel" | "eventName" | "connectionFailureText">;
|
||||
i18n: Pick<ReturnType<typeof useAdminI18n>, "tr" | "formatDate" | "formatAge" | "sessionStateLabel" | "connectionStatusLabel" | "inviteStatusLabel" | "eventName" | "connectionFailureText" | "errorText">;
|
||||
}>();
|
||||
// Request ownership, cancellation and drafts remain in the page's controller.
|
||||
const { operations, operationsLoading, terminatingSession, inviteSubmitting, revokingInvites, inviteForm, createdInvite,
|
||||
loadOperations, terminateSession, createInvite, revokeInvite, copyInviteLink, downloadBackup } = props.model;
|
||||
const { tr, formatDate, formatAge, sessionStateLabel, connectionStatusLabel, inviteStatusLabel, eventName, connectionFailureText } = props.i18n;
|
||||
loadOperations, terminateSession, createInvite, revokeInvite, copyInviteLink, downloadBackup,
|
||||
updateChecking, updateApplying, updateChecked, availableUpdates, selectedVersion, checkForUpdates, applyUpdate } = props.model;
|
||||
const { tr, formatDate, formatAge, sessionStateLabel, connectionStatusLabel, inviteStatusLabel, eventName, connectionFailureText, errorText } = props.i18n;
|
||||
type OperationsSection = 'sessions' | 'invites' | 'logs' | 'audit' | 'maintenance';
|
||||
const canApplyUpdates = computed(() => operations.update.deployment.applyAllowed);
|
||||
const deploymentLabel = computed(() => {
|
||||
const mode = operations.update.deployment.mode;
|
||||
return mode === 'docker' ? tr('updateModeDocker') : mode === 'release-package' ? tr('updateModeReleasePackage') : tr('updateModeSource');
|
||||
});
|
||||
function blockedReasonText(code: string | null) {
|
||||
switch (code) {
|
||||
case 'DEPLOYMENT_DOCKER': return tr('updateBlockedDocker');
|
||||
case 'DEPLOYMENT_SOURCE': return tr('updateBlockedSource');
|
||||
case 'PLATFORM_UNSUPPORTED': return tr('updateBlockedPlatform');
|
||||
case 'ARCH_UNSUPPORTED': return tr('updateBlockedArch');
|
||||
case 'UPDATE_ASSET_UNAVAILABLE': return tr('updateAssetMissing');
|
||||
case 'UPDATE_CHECKSUM_MISSING': return tr('updateChecksumMissing');
|
||||
default: return tr('updateBlockedUnavailable');
|
||||
}
|
||||
}
|
||||
const blockedUpdateText = computed(() => blockedReasonText(operations.update.deployment.reasonCode));
|
||||
const releaseBlockedText = (release: { blockedReason: string | null }) => blockedReasonText(release.blockedReason);
|
||||
function updateStatusText(status: string | undefined) {
|
||||
switch (status) {
|
||||
case 'downloading': return tr('updateStatusDownloading');
|
||||
case 'verifying': return tr('updateStatusVerifying');
|
||||
case 'extracting': return tr('updateStatusExtracting');
|
||||
case 'staging': return tr('updateStatusStaging');
|
||||
case 'restarting': return tr('updateStatusRestarting');
|
||||
case 'succeeded': return tr('updateStatusSucceeded');
|
||||
case 'failed': return tr('updateStatusFailed');
|
||||
default: return '';
|
||||
}
|
||||
}
|
||||
const updateTaskStatusLabel = computed(() => updateStatusText(operations.update.task?.status));
|
||||
const updateTaskErrorText = computed(() => operations.update.task?.errorCode ? errorText(operations.update.task.errorCode) : '');
|
||||
const selectedRelease = computed(() => availableUpdates.value.find(release => release.version === selectedVersion.value && release.canApply) ?? null);
|
||||
function applySelectedUpdate() {
|
||||
const release = selectedRelease.value;
|
||||
if (release) void applyUpdate(release);
|
||||
}
|
||||
const normalizeSection = (value?: string): OperationsSection => value === 'invites' || value === 'logs' || value === 'audit' || value === 'maintenance' ? value : 'sessions';
|
||||
const activeSection = ref<OperationsSection>(normalizeSection(props.initialSection));
|
||||
watch(() => props.initialSection, value => { activeSection.value = normalizeSection(value); });
|
||||
|
||||
@@ -27,6 +27,7 @@ const eventLabels: Record<string, AdminTranslationKey> = {
|
||||
ADMIN_SKIN_INSTALLED: "skinInstalledEvent", ADMIN_SKIN_REMOVED: "skinRemovedEvent",
|
||||
ADMIN_SKIN_ENABLED: "skinEnabledEvent", ADMIN_SKIN_DISABLED: "skinDisabledEvent",
|
||||
INVITE_CREATED: "inviteCreatedEvent", INVITE_REVOKED: "inviteRevokedEvent", INVITE_CONSUMED: "inviteConsumedEvent",
|
||||
ADMIN_UPDATE_STARTED: "updateStartedEvent",
|
||||
TS_ADMIN_SETTINGS_UPDATED: "tsAdminSaved",
|
||||
TS_ADMIN_OVERVIEW_READ: "tsAdminReadEvent",
|
||||
TS_ADMIN_OVERVIEW_FAILED: "tsAdminReadFailedEvent",
|
||||
@@ -51,6 +52,16 @@ const errorLabels: Record<string, AdminTranslationKey> = {
|
||||
TS_ADMIN_CLIENT_CHANGED: "tsAdminClientChanged", TS_ADMIN_CONFIG_CHANGED: "tsAdminConfigChanged", TS_ADMIN_PARTIAL_SUCCESS: "tsAdminPartialError",
|
||||
TS_ADMIN_RATE_LIMITED: "tsAdminRateError", TS_ADMIN_TLS_FAILED: "tsAdminTlsError",
|
||||
TS_ADMIN_READ_FAILED: "tsAdminReadError", TS_ADMIN_TIMEOUT: "tsAdminTimeoutError",
|
||||
UPDATE_IN_PROGRESS: "updateErrorInProgress", UPDATE_CHECKSUM_MISSING: "updateErrorChecksum",
|
||||
UPDATE_CHECKSUM_MISMATCH: "updateErrorChecksum", UPDATE_DIGEST_MISMATCH: "updateErrorChecksum", UPDATE_DIGEST_UNSUPPORTED: "updateErrorChecksum",
|
||||
UPDATE_ARCHIVE_UNSAFE: "updateErrorArchive", UPDATE_ARCHIVE_INVALID: "updateErrorArchive", UPDATE_ARCHIVE_LIMIT: "updateErrorArchive", UPDATE_ARCHIVE_UNSUPPORTED: "updateErrorArchive",
|
||||
UPDATE_PACKAGE_INVALID: "updateErrorPackage", UPDATE_DOWNLOAD_FAILED: "updateErrorDownload", UPDATE_DOWNLOAD_TOO_LARGE: "updateErrorDownload",
|
||||
UPDATE_FAILED: "updateErrorApply", UPDATE_ROLLBACK_FAILED: "updateErrorApply", UPDATE_INTERRUPTED: "updateErrorInterrupted",
|
||||
UPDATE_HEALTH_CHECK_FAILED: "updateErrorApply", UPDATE_ROLLBACK_HEALTH_FAILED: "updateErrorGeneric",
|
||||
UPDATE_RESTART_FAILED: "updateErrorGeneric", UPDATE_RESTART_TIMEOUT: "updateErrorGeneric", UPDATE_PLAN_INVALID: "updateErrorGeneric",
|
||||
UPDATE_NOT_SUPPORTED: "updateErrorGeneric", UPDATE_RELEASE_UNAVAILABLE: "updateErrorGeneric", UPDATE_ASSET_UNAVAILABLE: "updateErrorGeneric",
|
||||
UPDATE_CONFIRMATION_REQUIRED: "updateErrorGeneric", UPDATE_VERSION_INVALID: "updateErrorGeneric", UPDATE_VERSION_NOT_NEWER: "updateErrorGeneric",
|
||||
UPDATE_VERSION_NOT_FOUND: "updateErrorGeneric", UPDATE_RUNNER_MISSING: "updateErrorGeneric", UPDATE_RUNNER_FAILED: "updateErrorGeneric",
|
||||
};
|
||||
const connectionErrors: Record<string, AdminTranslationKey> = {
|
||||
PASSWORD_REQUIRED: "serverPasswordRequiredError", SERVER_PASSWORD_REQUIRED: "serverPasswordRequiredError",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { onScopeDispose, reactive, ref, type Ref } from "vue";
|
||||
import type { AdminSession, ManagedInvite, AdminLog, AdminConnectionRecord } from "../../../src/shared/admin-responses.js";
|
||||
import type { AdminSession, ManagedInvite, AdminLog, AdminConnectionRecord, AdminUpdateRelease, AdminUpdateStatus } from "../../../src/shared/admin-responses.js";
|
||||
import type { copy } from "../i18n/admin.js";
|
||||
import { isAdminRequestCancelled, type AdminApi } from "../services/admin-api.js";
|
||||
import { createAdminRequests } from "../services/admin-requests.js";
|
||||
@@ -12,19 +12,31 @@ interface Options {
|
||||
refreshOverview(): Promise<void>;
|
||||
}
|
||||
|
||||
function emptyUpdateStatus(): AdminUpdateStatus {
|
||||
return {
|
||||
currentVersion: "",
|
||||
deployment: { mode: "source", platform: "", architecture: "", applyAllowed: false, reasonCode: "UPDATE_UNAVAILABLE", upgradePath: "source" },
|
||||
task: null,
|
||||
};
|
||||
}
|
||||
|
||||
export function useAdminOperations(options: Options) {
|
||||
const requests = createAdminRequests();
|
||||
const operationsLoading = ref(false), terminatingSession = ref(""), inviteSubmitting = ref(false);
|
||||
const updateChecking = ref(false), updateApplying = ref(false), updateChecked = ref(false);
|
||||
const availableUpdates = ref<AdminUpdateRelease[]>([]), selectedVersion = ref("");
|
||||
const revokingInvites = reactive(new Set<string>());
|
||||
const inviteForm = reactive({ channel: "", expiresInHours: 24, maxUses: 0 });
|
||||
const createdInvite = ref<{ token: string; link: string } | null>(null);
|
||||
const operations = reactive({ sessions: [] as AdminSession[], invites: [] as ManagedInvite[],
|
||||
diagnostics: { version: "", node: "", platform: "", arch: "", schemaVersion: 0, createdSessions: 0 },
|
||||
update: emptyUpdateStatus(),
|
||||
logs: { available: false, entries: [] as AdminLog[], sessions: [] as AdminConnectionRecord[] }, audit: [] as Array<{ event: string; createdAt: string }> });
|
||||
let noticeTimer: number | undefined;
|
||||
function cancelRequests() {
|
||||
requests.reset();
|
||||
operationsLoading.value = false; terminatingSession.value = ""; inviteSubmitting.value = false;
|
||||
updateChecking.value = false; updateApplying.value = false;
|
||||
revokingInvites.clear();
|
||||
if (noticeTimer !== undefined) window.clearTimeout(noticeTimer);
|
||||
noticeTimer = undefined;
|
||||
@@ -35,6 +47,8 @@ export function useAdminOperations(options: Options) {
|
||||
operations.sessions = []; operations.invites = []; operations.audit = [];
|
||||
operations.logs = { available: false, entries: [], sessions: [] };
|
||||
operations.diagnostics = { version: "", node: "", platform: "", arch: "", schemaVersion: 0, createdSessions: 0 };
|
||||
operations.update = emptyUpdateStatus();
|
||||
availableUpdates.value = []; selectedVersion.value = ""; updateChecked.value = false;
|
||||
Object.assign(inviteForm, { channel: "", expiresInHours: 24, maxUses: 0 });
|
||||
}
|
||||
onScopeDispose(reset);
|
||||
@@ -45,13 +59,15 @@ export function useAdminOperations(options: Options) {
|
||||
const request = requests.begin("load");
|
||||
operationsLoading.value = true;
|
||||
try {
|
||||
const [sessions, invites, diagnostics, logs, audit] = await Promise.all([
|
||||
options.api.sessions(request.signal), options.api.invites(request.signal), options.api.diagnostics(request.signal), options.api.logs(request.signal), options.api.audit(request.signal),
|
||||
const [sessions, invites, diagnostics, update, logs, audit] = await Promise.all([
|
||||
options.api.sessions(request.signal), options.api.invites(request.signal), options.api.diagnostics(request.signal),
|
||||
options.api.updateStatus(request.signal), options.api.logs(request.signal), options.api.audit(request.signal),
|
||||
]);
|
||||
if (!request.isCurrent()) return;
|
||||
operations.sessions = sessions.sessions;
|
||||
operations.invites = invites.invites;
|
||||
operations.diagnostics = { ...diagnostics.gateway, schemaVersion: diagnostics.database.schemaVersion, createdSessions: diagnostics.sessions.created };
|
||||
operations.update = update;
|
||||
operations.logs = logs;
|
||||
operations.audit = audit.events;
|
||||
} catch (error) { if (request.isCurrent()) report(error); }
|
||||
@@ -103,6 +119,31 @@ export function useAdminOperations(options: Options) {
|
||||
} catch (error) { if (request.isCurrent()) report(error); }
|
||||
finally { request.finish(); }
|
||||
}
|
||||
async function checkForUpdates() {
|
||||
if (updateChecking.value) return;
|
||||
const request = requests.begin("update-check");
|
||||
updateChecking.value = true; updateChecked.value = false; availableUpdates.value = []; options.errorMessage.value = "";
|
||||
try {
|
||||
const result = await options.api.checkUpdates(request.signal);
|
||||
if (!request.isCurrent()) return;
|
||||
availableUpdates.value = result.releases;
|
||||
selectedVersion.value = result.releases.find(release => release.canApply)?.version ?? "";
|
||||
updateChecked.value = true;
|
||||
} catch (error) { if (request.isCurrent()) report(error); }
|
||||
finally { if (request.isCurrent()) updateChecking.value = false; request.finish(); }
|
||||
}
|
||||
async function applyUpdate(release: AdminUpdateRelease) {
|
||||
if (updateApplying.value) return;
|
||||
if (!window.confirm(options.tr("updateConfirmApply", { version: release.version }))) return;
|
||||
const request = requests.begin("update-apply");
|
||||
updateApplying.value = true; options.errorMessage.value = "";
|
||||
try {
|
||||
const result = await options.api.applyUpdate({ version: release.version, confirmVersion: release.version }, request.signal);
|
||||
if (!request.isCurrent()) return;
|
||||
operations.update = { ...operations.update, task: result.task, deployment: { ...operations.update.deployment, applyAllowed: false } };
|
||||
} catch (error) { if (request.isCurrent()) report(error); }
|
||||
finally { if (request.isCurrent()) updateApplying.value = false; request.finish(); }
|
||||
}
|
||||
async function downloadBackup() {
|
||||
const request = requests.begin("backup");
|
||||
try {
|
||||
@@ -118,5 +159,7 @@ export function useAdminOperations(options: Options) {
|
||||
finally { request.finish(); }
|
||||
}
|
||||
return { operations, operationsLoading, terminatingSession, inviteSubmitting, revokingInvites, inviteForm, createdInvite,
|
||||
loadOperations, terminateSession, createInvite, revokeInvite, copyInviteLink, downloadBackup, cancelRequests, reset };
|
||||
updateChecking, updateApplying, updateChecked, availableUpdates, selectedVersion,
|
||||
loadOperations, terminateSession, createInvite, revokeInvite, copyInviteLink, downloadBackup, checkForUpdates, applyUpdate,
|
||||
cancelRequests, reset };
|
||||
}
|
||||
@@ -10,6 +10,27 @@ const zh = {
|
||||
adminBrowserSessions: "浏览器会话", adminBrowserSessionsLead: "这里只显示通过此 WebSpeak 实例连接的用户;结束会话会断开对应浏览器。完整 TS 成员列表见 TeamSpeak 服务管理。",
|
||||
adminInviteScope: "这些邀请链接由当前 WebSpeak 实例生成和管理。",
|
||||
adminLogsSection: "连接与日志", adminMaintenanceSection: "诊断与备份",
|
||||
updateTitle: "版本更新", updateLead: "检查官方 GitHub Releases 中的正式版本。发布包安装可在控制台校验并切换版本;Docker 和源码运行只显示检查结果。",
|
||||
updateCurrentVersion: "当前版本", updateDeploymentMode: "部署模式", updateArchitecture: "平台与架构",
|
||||
updateModeDocker: "Docker Compose", updateModeReleasePackage: "发布包", updateModeSource: "源码运行",
|
||||
updateCanApply: "可在此控制台更新", updateCannotApply: "此部署不能在此应用更新",
|
||||
updateCheckAction: "检查正式版", updateChecking: "正在检查…", updateUpToDate: "没有比当前版本更新的正式版。",
|
||||
updateSelectRelease: "选择目标版本", updateApplyAction: "应用更新", updateApplying: "正在准备更新…",
|
||||
updateConfirmApply: "将把 WebSpeak 更新到 v{{version}}。更新前建议先导出备份;进程会重启,页面会短暂断开。继续吗?",
|
||||
updateBackupHint: "建议先使用上方的“导出备份”。控制台只替换程序代码,不会改动 data/、config.json 或 certs/。",
|
||||
updateChecksumMissing: "该版本缺少 SHA256SUMS.txt,已拒绝更新。", updateAssetMissing: "该版本没有适用于当前平台和架构的发布包。",
|
||||
updateBlockedDocker: "容器内不能替换镜像。请保留 webspeak-data volume,在宿主机执行 docker compose pull && docker compose up -d;不要执行 docker compose down -v。",
|
||||
updateBlockedSource: "源码运行没有捆绑运行时,控制台无法安全切换版本。请拉取源码后自行构建(npm ci && npm run build && npm run web:build),或改用发布包/Docker Compose。",
|
||||
updateBlockedPlatform: "当前平台没有官方发布包,只能检查版本。", updateBlockedArch: "当前架构没有官方发布包,只能检查版本。",
|
||||
updateBlockedUnavailable: "此实例未启用控制台更新。", updateTaskTitle: "更新任务",
|
||||
updateStatusDownloading: "正在下载", updateStatusVerifying: "正在校验", updateStatusExtracting: "正在解包", updateStatusStaging: "正在暂存",
|
||||
updateStatusRestarting: "正在重启", updateStatusSucceeded: "更新成功", updateStatusFailed: "更新失败",
|
||||
updateRolledBack: "已恢复上一版本。", updateRestartHint: "更新成功后进程会自动重启;页面断开时请稍后刷新。",
|
||||
updateReleaseNotes: "发行说明",
|
||||
updateErrorChecksum: "校验和缺失或不匹配,已拒绝安装该发布包。", updateErrorArchive: "发布包未通过安全解包检查。",
|
||||
updateErrorDownload: "无法从官方 Release 下载或保存资源。", updateErrorPackage: "发布包内容与所选正式版不匹配。",
|
||||
updateErrorApply: "更新失败,已恢复上一版本。", updateErrorInterrupted: "更新被中断,未确认完成。",
|
||||
updateErrorInProgress: "已有更新任务正在进行。", updateErrorGeneric: "更新未能完成,请查看日志。", updateStartedEvent: "已开始更新",
|
||||
adminWsOverviewTitle: "WebSpeak 管理服务已就绪", adminWsOverviewLead: "先管理实例接入与访客体验;需要管理 TS 服务时,再按需配置独立连接。",
|
||||
adminWsManageLead: "接入策略、站点公告、语音传输、皮肤商店和浏览器会话。",
|
||||
adminTsManageLead: "服务器设置、频道、在线成员、服务器组和封禁。需单独配置 Query 凭据,常规语音连接不需要。",
|
||||
@@ -32,6 +53,27 @@ const en = {
|
||||
adminBrowserSessions: "Browser sessions", adminBrowserSessionsLead: "Only users connected through this WebSpeak instance are listed here. Ending a session disconnects that browser. Use TeamSpeak service management for the full TS client list.",
|
||||
adminInviteScope: "These invite links are created and managed by this WebSpeak instance.",
|
||||
adminLogsSection: "Connections & logs", adminMaintenanceSection: "Diagnostics & backups",
|
||||
updateTitle: "Version update", updateLead: "Check stable versions in the official GitHub Releases. Release-package installs can verify and switch versions here; Docker and source installs only show check results.",
|
||||
updateCurrentVersion: "Current version", updateDeploymentMode: "Deployment", updateArchitecture: "Platform & architecture",
|
||||
updateModeDocker: "Docker Compose", updateModeReleasePackage: "Release package", updateModeSource: "From source",
|
||||
updateCanApply: "Update from this console", updateCannotApply: "This deployment cannot apply updates here",
|
||||
updateCheckAction: "Check stable releases", updateChecking: "Checking…", updateUpToDate: "No stable release is newer than the running version.",
|
||||
updateSelectRelease: "Select target version", updateApplyAction: "Apply update", updateApplying: "Preparing update…",
|
||||
updateConfirmApply: "WebSpeak will be updated to v{{version}}. Export a backup first; the process restarts and this page disconnects briefly. Continue?",
|
||||
updateBackupHint: "Export a backup above first. The console replaces application code only and never touches data/, config.json or certs/.",
|
||||
updateChecksumMissing: "This release has no SHA256SUMS.txt; the update is refused.", updateAssetMissing: "This release has no package for the current platform and architecture.",
|
||||
updateBlockedDocker: "An image cannot be replaced from inside the container. Keep the webspeak-data volume and run docker compose pull && docker compose up -d on the host. Never run docker compose down -v.",
|
||||
updateBlockedSource: "Source installs have no bundled runtime, so the console cannot switch versions safely. Pull the source and rebuild (npm ci && npm run build && npm run web:build), or use a release package/Docker Compose.",
|
||||
updateBlockedPlatform: "No official package exists for this platform; only version checks are available.", updateBlockedArch: "No official package exists for this architecture; only version checks are available.",
|
||||
updateBlockedUnavailable: "Console updates are not enabled for this instance.", updateTaskTitle: "Update task",
|
||||
updateStatusDownloading: "Downloading", updateStatusVerifying: "Verifying", updateStatusExtracting: "Extracting", updateStatusStaging: "Staging",
|
||||
updateStatusRestarting: "Restarting", updateStatusSucceeded: "Update succeeded", updateStatusFailed: "Update failed",
|
||||
updateRolledBack: "The previous version was restored.", updateRestartHint: "The process restarts after a successful update; refresh shortly if this page disconnects.",
|
||||
updateReleaseNotes: "Release notes",
|
||||
updateErrorChecksum: "The checksum is missing or does not match; the package was refused.", updateErrorArchive: "The package failed the safe-extraction checks.",
|
||||
updateErrorDownload: "The official release asset could not be downloaded or saved.", updateErrorPackage: "The package does not match the selected stable release.",
|
||||
updateErrorApply: "The update failed and the previous version was restored.", updateErrorInterrupted: "The update was interrupted before completion was confirmed.",
|
||||
updateErrorInProgress: "Another update task is already running.", updateErrorGeneric: "The update could not be completed; check the logs.", updateStartedEvent: "Update started",
|
||||
adminWsOverviewTitle: "WebSpeak management is ready", adminWsOverviewLead: "Manage instance access and the guest experience first. Configure an independent TS management connection when you need it.",
|
||||
adminWsManageLead: "Access policy, site announcements, voice transport, the skin store and browser sessions.",
|
||||
adminTsManageLead: "Server settings, channels, clients, server groups and bans. Separate Query credentials are required; ordinary voice connections do not need them.",
|
||||
@@ -53,6 +95,27 @@ const de = {
|
||||
adminBrowserSessions: "Browsersitzungen", adminBrowserSessionsLead: "Hier stehen nur Nutzer dieser WebSpeak-Instanz. Beenden trennt den jeweiligen Browser. Die vollständige TS-Mitgliederliste befindet sich in der TeamSpeak-Verwaltung.",
|
||||
adminInviteScope: "Diese Einladungslinks werden von dieser WebSpeak-Instanz erstellt und verwaltet.",
|
||||
adminLogsSection: "Verbindungen & Protokolle", adminMaintenanceSection: "Diagnose & Sicherungen",
|
||||
updateTitle: "Versionsaktualisierung", updateLead: "Stabile Versionen aus den offiziellen GitHub Releases prüfen. Release-Pakete können hier geprüft und gewechselt werden; Docker- und Quellinstallationen zeigen nur Prüfergebnisse.",
|
||||
updateCurrentVersion: "Aktuelle Version", updateDeploymentMode: "Bereitstellung", updateArchitecture: "Plattform & Architektur",
|
||||
updateModeDocker: "Docker Compose", updateModeReleasePackage: "Release-Paket", updateModeSource: "Aus Quellen",
|
||||
updateCanApply: "In dieser Konsole aktualisieren", updateCannotApply: "Diese Bereitstellung kann hier nicht aktualisiert werden",
|
||||
updateCheckAction: "Stabile Versionen prüfen", updateChecking: "Wird geprüft…", updateUpToDate: "Keine stabile Version ist neuer als die laufende.",
|
||||
updateSelectRelease: "Zielversion wählen", updateApplyAction: "Update anwenden", updateApplying: "Update wird vorbereitet…",
|
||||
updateConfirmApply: "WebSpeak wird auf v{{version}} aktualisiert. Vorher eine Sicherung exportieren; der Prozess startet neu und die Seite trennt kurz. Fortfahren?",
|
||||
updateBackupHint: "Zuerst oben eine Sicherung exportieren. Die Konsole ersetzt nur Anwendungscode und ändert data/, config.json oder certs/ nicht.",
|
||||
updateChecksumMissing: "Diesem Release fehlt SHA256SUMS.txt; das Update wird abgelehnt.", updateAssetMissing: "Dieses Release hat kein Paket für Plattform und Architektur.",
|
||||
updateBlockedDocker: "Ein Image kann nicht im Container ersetzt werden. Das Volume webspeak-data behalten und auf dem Host docker compose pull && docker compose up -d ausführen. Niemals docker compose down -v verwenden.",
|
||||
updateBlockedSource: "Quellinstallationen haben keine mitgelieferte Laufzeit; die Konsole kann Versionen nicht sicher wechseln. Quellen aktualisieren und neu bauen (npm ci && npm run build && npm run web:build) oder Release-Paket/Docker Compose verwenden.",
|
||||
updateBlockedPlatform: "Für diese Plattform gibt es kein offizielles Paket; nur Versionsprüfungen sind möglich.", updateBlockedArch: "Für diese Architektur gibt es kein offizielles Paket; nur Versionsprüfungen sind möglich.",
|
||||
updateBlockedUnavailable: "Konsolen-Updates sind für diese Instanz nicht aktiviert.", updateTaskTitle: "Update-Aufgabe",
|
||||
updateStatusDownloading: "Wird heruntergeladen", updateStatusVerifying: "Wird geprüft", updateStatusExtracting: "Wird entpackt", updateStatusStaging: "Wird bereitgestellt",
|
||||
updateStatusRestarting: "Neustart", updateStatusSucceeded: "Update erfolgreich", updateStatusFailed: "Update fehlgeschlagen",
|
||||
updateRolledBack: "Die vorherige Version wurde wiederhergestellt.", updateRestartHint: "Nach erfolgreichem Update startet der Prozess neu; die Seite bei Trennung später neu laden.",
|
||||
updateReleaseNotes: "Release-Notizen",
|
||||
updateErrorChecksum: "Prüfsumme fehlt oder stimmt nicht; das Paket wurde abgelehnt.", updateErrorArchive: "Das Paket hat die sichere Entpackprüfung nicht bestanden.",
|
||||
updateErrorDownload: "Das offizielle Release-Artefakt konnte nicht geladen oder gespeichert werden.", updateErrorPackage: "Das Paket passt nicht zum gewählten stabilen Release.",
|
||||
updateErrorApply: "Das Update ist fehlgeschlagen; die vorherige Version wurde wiederhergestellt.", updateErrorInterrupted: "Das Update wurde vor der Bestätigung unterbrochen.",
|
||||
updateErrorInProgress: "Eine andere Update-Aufgabe läuft bereits.", updateErrorGeneric: "Das Update konnte nicht abgeschlossen werden; Protokolle prüfen.", updateStartedEvent: "Update gestartet",
|
||||
adminWsOverviewTitle: "WebSpeak-Verwaltung ist bereit", adminWsOverviewLead: "Zuerst Instanzzugang und Gastoberfläche verwalten. Eine separate TS-Verbindung nur bei Bedarf einrichten.",
|
||||
adminWsManageLead: "Zugriffsregeln, Website-Ankündigungen, Sprachtransport, Skin-Store und Browsersitzungen.",
|
||||
adminTsManageLead: "Servereinstellungen, Kanäle, Mitglieder, Servergruppen und Sperren. Separate Query-Zugangsdaten sind nötig; normale Sprachverbindungen benötigen sie nicht.",
|
||||
@@ -74,6 +137,27 @@ const ru = {
|
||||
adminBrowserSessions: "Сеансы браузеров", adminBrowserSessionsLead: "Здесь только пользователи этого экземпляра WebSpeak. Завершение сеанса отключает соответствующий браузер. Полный список участников TS доступен в управлении TeamSpeak.",
|
||||
adminInviteScope: "Эти ссылки-приглашения создаются и управляются текущим экземпляром WebSpeak.",
|
||||
adminLogsSection: "Подключения и журналы", adminMaintenanceSection: "Диагностика и копии",
|
||||
updateTitle: "Обновление версии", updateLead: "Проверка стабильных версий в официальных GitHub Releases. Установки из пакета могут проверить и сменить версию здесь; Docker и исходники показывают только результат проверки.",
|
||||
updateCurrentVersion: "Текущая версия", updateDeploymentMode: "Развёртывание", updateArchitecture: "Платформа и архитектура",
|
||||
updateModeDocker: "Docker Compose", updateModeReleasePackage: "Пакет релиза", updateModeSource: "Из исходников",
|
||||
updateCanApply: "Можно обновить из консоли", updateCannotApply: "Это развёртывание нельзя обновить здесь",
|
||||
updateCheckAction: "Проверить стабильные версии", updateChecking: "Проверка…", updateUpToDate: "Нет стабильной версии новее текущей.",
|
||||
updateSelectRelease: "Выберите целевую версию", updateApplyAction: "Применить обновление", updateApplying: "Подготовка обновления…",
|
||||
updateConfirmApply: "WebSpeak будет обновлён до v{{version}}. Сначала экспортируйте резервную копию; процесс перезапустится, страница кратко отключится. Продолжить?",
|
||||
updateBackupHint: "Сначала используйте «Экспорт резервной копии» выше. Консоль заменяет только код приложения и не изменяет data/, config.json или certs/.",
|
||||
updateChecksumMissing: "В релизе нет SHA256SUMS.txt; обновление отклонено.", updateAssetMissing: "В релизе нет пакета для текущей платформы и архитектуры.",
|
||||
updateBlockedDocker: "Образ нельзя заменить изнутри контейнера. Сохраните том webspeak-data и выполните на хосте docker compose pull && docker compose up -d. Никогда не запускайте docker compose down -v.",
|
||||
updateBlockedSource: "В установке из исходников нет встроенной среды выполнения, поэтому консоль не может безопасно сменить версию. Обновите исходники и пересоберите (npm ci && npm run build && npm run web:build) или используйте пакет релиза/Docker Compose.",
|
||||
updateBlockedPlatform: "Для этой платформы нет официального пакета; доступна только проверка версий.", updateBlockedArch: "Для этой архитектуры нет официального пакета; доступна только проверка версий.",
|
||||
updateBlockedUnavailable: "Обновление из консоли для этого экземпляра не включено.", updateTaskTitle: "Задача обновления",
|
||||
updateStatusDownloading: "Скачивание", updateStatusVerifying: "Проверка", updateStatusExtracting: "Распаковка", updateStatusStaging: "Подготовка",
|
||||
updateStatusRestarting: "Перезапуск", updateStatusSucceeded: "Обновление выполнено", updateStatusFailed: "Обновление не удалось",
|
||||
updateRolledBack: "Предыдущая версия восстановлена.", updateRestartHint: "После успешного обновления процесс перезапустится; обновите страницу позже, если она отключилась.",
|
||||
updateReleaseNotes: "Примечания к релизу",
|
||||
updateErrorChecksum: "Контрольная сумма отсутствует или не совпадает; пакет отклонён.", updateErrorArchive: "Пакет не прошёл проверку безопасной распаковки.",
|
||||
updateErrorDownload: "Не удалось скачать или сохранить официальный ресурс релиза.", updateErrorPackage: "Пакет не соответствует выбранному стабильному релизу.",
|
||||
updateErrorApply: "Обновление не удалось; предыдущая версия восстановлена.", updateErrorInterrupted: "Обновление прервано до подтверждения завершения.",
|
||||
updateErrorInProgress: "Другая задача обновления уже выполняется.", updateErrorGeneric: "Не удалось завершить обновление; проверьте журналы.", updateStartedEvent: "Обновление начато",
|
||||
adminWsOverviewTitle: "Управление WebSpeak готово", adminWsOverviewLead: "Настройте доступ и гостевой интерфейс. Отдельное управление TS подключайте по мере необходимости.",
|
||||
adminWsManageLead: "Политика доступа, объявления сайта, голосовой транспорт, магазин тем и сеансы браузеров.",
|
||||
adminTsManageLead: "Настройки сервера, каналы, участники, серверные группы и блокировки. Нужны отдельные данные Query; для обычного голосового подключения они не требуются.",
|
||||
@@ -95,6 +179,27 @@ const ja = {
|
||||
adminBrowserSessions: "ブラウザーセッション", adminBrowserSessionsLead: "この WebSpeak 経由の利用者だけを表示します。終了すると該当のブラウザーが切断されます。TS の全メンバーは TeamSpeak サービス管理で確認できます。",
|
||||
adminInviteScope: "この招待リンクは現在の WebSpeak インスタンスが発行・管理します。",
|
||||
adminLogsSection: "接続とログ", adminMaintenanceSection: "診断とバックアップ",
|
||||
updateTitle: "バージョン更新", updateLead: "公式 GitHub Releases の安定版を確認します。リリースパッケージではここで検証して切り替えられます。Docker とソース実行は確認結果のみ表示します。",
|
||||
updateCurrentVersion: "現在のバージョン", updateDeploymentMode: "デプロイ", updateArchitecture: "プラットフォームとアーキテクチャ",
|
||||
updateModeDocker: "Docker Compose", updateModeReleasePackage: "リリースパッケージ", updateModeSource: "ソース実行",
|
||||
updateCanApply: "このコンソールから更新できます", updateCannotApply: "このデプロイではここから更新できません",
|
||||
updateCheckAction: "安定版を確認", updateChecking: "確認中…", updateUpToDate: "現在より新しい安定版はありません。",
|
||||
updateSelectRelease: "対象バージョンを選択", updateApplyAction: "更新を適用", updateApplying: "更新を準備中…",
|
||||
updateConfirmApply: "WebSpeak を v{{version}} に更新します。先にバックアップを書き出してください。プロセスが再起動し、ページが一時的に切断されます。続行しますか?",
|
||||
updateBackupHint: "先に上の「バックアップを書き出す」を使用してください。コンソールはプログラムコードのみを置き換え、data/、config.json、certs/ は変更しません。",
|
||||
updateChecksumMissing: "このリリースには SHA256SUMS.txt がないため、更新を拒否しました。", updateAssetMissing: "このリリースには現在のプラットフォームとアーキテクチャ向けのパッケージがありません。",
|
||||
updateBlockedDocker: "コンテナ内からイメージは置き換えられません。webspeak-data ボリュームを保持し、ホストで docker compose pull && docker compose up -d を実行してください。docker compose down -v は実行しないでください。",
|
||||
updateBlockedSource: "ソース実行には同梱ランタイムがないため、安全にバージョンを切り替えられません。ソースを取得して再ビルドする(npm ci && npm run build && npm run web:build)か、リリースパッケージ/Docker Compose を使用してください。",
|
||||
updateBlockedPlatform: "このプラットフォーム向けの公式パッケージがないため、バージョン確認のみ可能です。", updateBlockedArch: "このアーキテクチャ向けの公式パッケージがないため、バージョン確認のみ可能です。",
|
||||
updateBlockedUnavailable: "このインスタンスではコンソール更新が有効になっていません。", updateTaskTitle: "更新タスク",
|
||||
updateStatusDownloading: "ダウンロード中", updateStatusVerifying: "検証中", updateStatusExtracting: "展開中", updateStatusStaging: "ステージング中",
|
||||
updateStatusRestarting: "再起動中", updateStatusSucceeded: "更新成功", updateStatusFailed: "更新失敗",
|
||||
updateRolledBack: "以前のバージョンに戻しました。", updateRestartHint: "更新成功後にプロセスが再起動します。ページが切断された場合はしばらくしてから再読み込みしてください。",
|
||||
updateReleaseNotes: "リリースノート",
|
||||
updateErrorChecksum: "チェックサムがないか一致しないため、パッケージを拒否しました。", updateErrorArchive: "パッケージは安全な展開チェックに合格しませんでした。",
|
||||
updateErrorDownload: "公式リリースの資産をダウンロードまたは保存できませんでした。", updateErrorPackage: "パッケージが選択した安定版と一致しません。",
|
||||
updateErrorApply: "更新に失敗し、以前のバージョンに戻しました。", updateErrorInterrupted: "完了確認前に更新が中断されました。",
|
||||
updateErrorInProgress: "別の更新タスクが実行中です。", updateErrorGeneric: "更新を完了できませんでした。ログを確認してください。", updateStartedEvent: "更新を開始",
|
||||
adminWsOverviewTitle: "WebSpeak 管理を利用できます", adminWsOverviewLead: "まず接続方針と訪問者向け画面を管理します。必要な場合だけ、独立した TS 管理接続を設定します。",
|
||||
adminWsManageLead: "アクセス方針、サイトのお知らせ、音声転送、スキンストア、ブラウザー接続。",
|
||||
adminTsManageLead: "サーバー設定、チャンネル、メンバー、サーバーグループ、禁止リスト。専用 Query 認証情報が必要ですが、通常の音声接続には不要です。",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { adminResponses, type AdminResponseReader } from "../../../src/shared/admin-responses.js";
|
||||
import type { AdminSettingsInput, ManagedInviteInput, TsAdminSettingsInput, TsAdminActionRequest } from "../../../src/shared/admin-inputs.js";
|
||||
import type { SkinStoreInstallInput } from "../../../src/shared/skin-store.js";
|
||||
import type { UpdateApplyInput } from "../../../src/shared/update.js";
|
||||
import { pluginResponses, type PluginPackage, type PluginSettingsInput } from "../../../src/shared/plugins.js";
|
||||
|
||||
export class AdminApiError extends Error {
|
||||
@@ -128,6 +129,9 @@ export function createAdminApi(options: AdminApiOptions) {
|
||||
createInvite: (body: ManagedInviteInput, signal?: AbortSignal) => request("/invites", adminResponses.createdInvite, "POST", body, true, signal),
|
||||
revokeInvite: (id: string, signal?: AbortSignal) => request(`/invites/${encodeURIComponent(id)}/revoke`, adminResponses.ok, "POST", {}, true, signal),
|
||||
diagnostics: (signal?: AbortSignal) => request("/diagnostics", adminResponses.diagnostics, "GET", undefined, true, signal),
|
||||
updateStatus: (signal?: AbortSignal) => request("/update", adminResponses.updateStatus, "GET", undefined, true, signal),
|
||||
checkUpdates: (signal?: AbortSignal) => request("/update/check", adminResponses.updateCheck, "POST", {}, true, signal),
|
||||
applyUpdate: (body: UpdateApplyInput, signal?: AbortSignal) => request("/update/apply", adminResponses.updateApplied, "POST", body, true, signal),
|
||||
logs: (signal?: AbortSignal) => request("/logs?limit=100", adminResponses.logs, "GET", undefined, true, signal),
|
||||
audit: (signal?: AbortSignal) => request("/audit?limit=50", adminResponses.audit, "GET", undefined, true, signal),
|
||||
skins: (signal?: AbortSignal) => request("/skins", adminResponses.skins, "GET", undefined, true, signal),
|
||||
|
||||
Reference in new issue
Block a user