feat: add a panel button to update the manager itself

The manager clones SELF_UPDATE_REPO_URL, builds a new image in the shared build queue and
hands over to a short-lived updater container (new image) that swaps the manager container,
health-checks it and rolls back on failure. Exposed as GET/POST /api/system behind requireAuth;
installation changes answer 409 while an update runs. Session cookie is now SameSite=Lax.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Sonnet 5.5 committed 2026-10-19 05:45:25 +02:00
1 parent 5fb1d6b0b4
commit 4b3c8f213a
23 files changed
+705 -5

No files matched your search

+15
View File
@@ -19,6 +19,18 @@ export interface Installation {
updatedAt: string;
}
export interface SystemInfo {
version: string;
uptimeSec: number;
canSelfUpdate: boolean;
unavailableReason: string | null;
ref: string;
phase: "idle" | "cloning" | "building" | "handing-over";
error: string | null;
log: string;
lastUpdate: { finishedAt: string; ok: boolean; log: string } | null;
}
async function request<T>(path: string, init?: RequestInit): Promise<T> {
const res = await fetch(path, {
...init,
@@ -60,4 +72,7 @@ export const api = {
request<{ bearerToken: string }>(`/api/installations/${id}/regenerate-token`, { method: "POST" }),
remove: (id: string) => request<void>(`/api/installations/${id}`, { method: "DELETE" }),
logs: (id: string) => request<{ log: string }>(`/api/installations/${id}/logs`),
systemInfo: () => request<SystemInfo>("/api/system"),
updateManager: () => request<{ ok: true }>("/api/system/update", { method: "POST" }),
};