From 894f753b81239d86137eeb6c22b84b5a136f5aeb Mon Sep 17 00:00:00 2001 From: boban Date: Fri, 24 Apr 2026 16:11:50 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Wizard=20SSL-Flow=20end-to-end=20sauber?= =?UTF-8?q?=20gel=C3=B6st?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - pollSetup() macht keinen auto-redirect mehr (port 443 wäre noch nicht offen) - "Zum Login" ist jetzt ein plain ohne Livewire-POST → nginx leitet /login nach SSL-Switch automatisch auf HTTPS weiter - mailwolt-apply-domains schreibt done=1/0 (je nach Cert-Status) VOR nginx-Switch + sleep 6s damit Polling noch 3x done lesen kann bevor port 443 öffnet - done=1 nur wenn mindestens ein LE-Cert erfolgreich ausgestellt wurde Co-Authored-By: Claude Sonnet 4.6 --- app/Livewire/Setup/Wizard.php | 6 ------ installer.sh | 13 +++++++++---- resources/views/livewire/setup/wizard.blade.php | 6 ++++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/Livewire/Setup/Wizard.php b/app/Livewire/Setup/Wizard.php index 94db3ab..7424d69 100644 --- a/app/Livewire/Setup/Wizard.php +++ b/app/Livewire/Setup/Wizard.php @@ -181,12 +181,6 @@ class Wizard extends Component $done = @file_get_contents(self::STATE_DIR . '/done'); if ($done !== false) { $this->setupDone = true; - - // Bei erfolgreichem SSL sofort auf HTTPS weiterleiten, - // damit Livewire nicht mehr über HTTP pollt - if (trim($done) === '1' && $this->ui_domain) { - $this->redirect('https://' . $this->ui_domain . '/setup', navigate: false); - } } } diff --git a/installer.sh b/installer.sh index ebd90ae..1da571f 100644 --- a/installer.sh +++ b/installer.sh @@ -776,15 +776,20 @@ CONF fi ) > "${NGINX_SITE}" -# State-Dateien VOR dem nginx-Switch schreiben damit der Browser -# noch über HTTP redirecten kann bevor nginx auf HTTPS wechselt +# State-Dateien VOR dem nginx-Switch schreiben: +# Browser-Poll (alle 2s) liest done=1 → Polling stoppt → "Zum Login" erscheint. +# Danach 6s sleep → nginx switchet auf HTTPS → User klickt Link → funktioniert. STATE_DIR="/var/lib/mailwolt/wizard" if [ -d "${STATE_DIR}" ]; then for k in ui mail webmail; do [ -f "${STATE_DIR}/${k}" ] && printf "done" > "${STATE_DIR}/${k}" done - printf "1" > "${STATE_DIR}/done" - sleep 6 # 3 Poll-Zyklen (à 2s) — Browser hat Zeit zu redirecten + if [ "${UI_HAS_CERT}" = "1" ] || [ "${WM_HAS_CERT}" = "1" ]; then + printf "1" > "${STATE_DIR}/done" + else + printf "0" > "${STATE_DIR}/done" + fi + sleep 6 fi nginx -t && systemctl reload nginx diff --git a/resources/views/livewire/setup/wizard.blade.php b/resources/views/livewire/setup/wizard.blade.php index fe95ce8..d644229 100644 --- a/resources/views/livewire/setup/wizard.blade.php +++ b/resources/views/livewire/setup/wizard.blade.php @@ -292,10 +292,12 @@ @elseif($step === 5 && $setupDone)
- +
@endif