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,