From 617d463a5a39c1b881c4f278e1f563a5fe14c197 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 12 Jul 2026 00:30:24 +0000 Subject: [PATCH] fix: updateWebsiteProject - kein hasPreview-Attribut, TLS-Sync nach Appwrite-Update - hasPreview existiert im Live-Schema nicht -> Appwrite lehnte Update ab - syncPreviewTls muss NACH updateDocument laufen, sonst liest es isPublic noch im alten Zustand (oeffentlicher Router bekam faelschlich preview-auth) Co-Authored-By: Claude Opus 4.8 --- server/services/giteaAdmin.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/services/giteaAdmin.js b/server/services/giteaAdmin.js index d134ec3..71789ca 100644 --- a/server/services/giteaAdmin.js +++ b/server/services/giteaAdmin.js @@ -430,12 +430,6 @@ export async function updateWebsiteProject(projectId, { projectName, subdomain, } } - // Sicherstellen, dass die Traefik-Router den public/auth-Zustand widerspiegeln, - // auch wenn kein Redeploy stattfand (z.B. nur Typ preview <-> website getauscht). - try { await syncPreviewTls() } catch (err) { - console.error('[updateWebsiteProject] TLS-Sync fehlgeschlagen:', err.message) - } - const previewUrl = hasWebsite && nextSubdomain ? buildPreviewUrl(nextSubdomain) : '' const updated = await updateDocument(config.collections.websiteProjects, projectId, { projectName: nextName, @@ -443,7 +437,6 @@ export async function updateWebsiteProject(projectId, { projectName, subdomain, previewUrl, projectType: nextType, isPublic, - hasPreview: hasWebsite, status: hasWebsite ? (deployResult.deployed ? 'deployed' : 'pending') : 'created', provisioningStatus: hasWebsite ? (deployResult.deployed ? 'ready' : (deployResult.error ? 'deploy_failed' : 'pending')) @@ -451,6 +444,13 @@ export async function updateWebsiteProject(projectId, { projectName, subdomain, updatedAt: new Date().toISOString(), }) + // TLS-Router NACH dem Appwrite-Update synchronisieren, damit der public/auth- + // Zustand (isPublic) korrekt gelesen wird - auch wenn kein Redeploy stattfand + // (z.B. nur Typ preview <-> website getauscht). + try { await syncPreviewTls() } catch (err) { + console.error('[updateWebsiteProject] TLS-Sync fehlgeschlagen:', err.message) + } + return { project: updated, deploy: deployResult,