mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-11-30 18:42:49 +08:00
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.
79 lines
1.8 KiB
TypeScript
79 lines
1.8 KiB
TypeScript
/**
|
|
* Browser-safe projections of the administrator update API.
|
|
*
|
|
* The console never receives download URLs or local paths. It selects a
|
|
* version, and the server re-resolves the official GitHub release asset
|
|
* before doing any work.
|
|
*/
|
|
export type UpdateDeploymentMode = "docker" | "release-package" | "source";
|
|
export type UpdateUpgradePath = "docker-compose" | "release-package" | "source";
|
|
export type UpdateTaskStatus =
|
|
| "downloading"
|
|
| "verifying"
|
|
| "extracting"
|
|
| "staging"
|
|
| "restarting"
|
|
| "succeeded"
|
|
| "failed";
|
|
export type UpdateStepStatus = "running" | "succeeded" | "failed";
|
|
|
|
export interface UpdateStepView {
|
|
name: string;
|
|
status: UpdateStepStatus;
|
|
at: string;
|
|
detail?: string;
|
|
}
|
|
|
|
export interface UpdateTaskView {
|
|
id: string;
|
|
status: UpdateTaskStatus;
|
|
fromVersion: string;
|
|
targetVersion: string;
|
|
startedAt: string;
|
|
updatedAt: string;
|
|
finishedAt: string | null;
|
|
errorCode: string | null;
|
|
errorMessage: string | null;
|
|
rolledBack: boolean;
|
|
steps: UpdateStepView[];
|
|
}
|
|
|
|
export interface UpdateDeploymentView {
|
|
mode: UpdateDeploymentMode;
|
|
platform: string;
|
|
architecture: string;
|
|
applyAllowed: boolean;
|
|
reasonCode: string | null;
|
|
upgradePath: UpdateUpgradePath;
|
|
}
|
|
|
|
export interface UpdateStatusView {
|
|
currentVersion: string;
|
|
deployment: UpdateDeploymentView;
|
|
task: UpdateTaskView | null;
|
|
}
|
|
|
|
export interface UpdateReleaseView {
|
|
version: string;
|
|
tag: string;
|
|
publishedAt: string;
|
|
releaseUrl: string;
|
|
assetName: string;
|
|
assetSize: number;
|
|
assetAvailable: boolean;
|
|
hasChecksums: boolean;
|
|
digest: string | null;
|
|
canApply: boolean;
|
|
blockedReason: string | null;
|
|
}
|
|
|
|
export interface UpdateCheckView {
|
|
currentVersion: string;
|
|
releases: UpdateReleaseView[];
|
|
}
|
|
|
|
export interface UpdateApplyInput {
|
|
version: string;
|
|
confirmVersion: string;
|
|
}
|