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