Add a password-gated private instance mode for xaigen.

Keep Authentik on aigen, isolate library data per instance, and purge Comfy outputs from the desktop after they are saved on the server.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-25 19:24:00 -05:00
co-authored by Cursor
parent e2db183a8e
commit bc0ea613c1
22 changed files with 426 additions and 15 deletions
+3 -1
View File
@@ -65,6 +65,7 @@ function libraryRoot() {
}
export function libraryOwnerKey(event: H3Event) {
if (passwordAuthEnabled()) return privateInstanceId()
const user = getSessionUser(event)
const raw = user?.sub || user?.email || (!authEnabled() ? 'local' : '')
if (!raw) {
@@ -708,7 +709,7 @@ export async function importMissingComfyVideos(owner: string, folderId?: string)
const found: { promptId: string; video: { filename: string; subfolder: string; type: string }; prompt: string; width: number; height: number; steps: number; seed: number }[] = []
for (const [promptId, entry] of Object.entries(history)) {
const video = extractVideo({ [promptId]: entry as Record<string, unknown> }, promptId)
if (!video || known.has(video.filename)) continue
if (!video || known.has(video.filename) || !isOurComfyVideo(video)) continue
const prompt = extractPromptFromHistory(entry) || 'Recovered from ComfyUI'
const meta = extractClipMetaFromHistory(entry)
found.push({
@@ -743,6 +744,7 @@ export async function importMissingComfyVideos(owner: string, folderId?: string)
comfyFilename: item.video.filename
})
imported.push(clip)
await purgeComfyArtifacts({ video: item.video, promptId: item.promptId })
}
return imported
}