From 627ef668e5816e22333001a1babae0d1893e09da Mon Sep 17 00:00:00 2001 From: boban Date: Thu, 23 Apr 2026 02:36:11 +0200 Subject: [PATCH] Feature: Domain Auto-fill, SSL-Skip, Dashboard SSL-Banner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Wizard Schritt 2: leere Domain-Felder werden beim Tippen auto-gefüllt (wer nur eine Domain nutzt muss sie nur einmal eingeben) - Wizard Schritt 4: Checkbox "SSL jetzt überspringen" mit Hinweistext - Wizard Schritt 5: skip-Status wird pro Domain angezeigt - WizardDomains schreibt ssl_configured=0/1 in Settings - SettingsForm: setzt ssl_configured=1 nach erfolgreichem applyDomains - Dashboard: gelber Banner wenn ssl_configured != 1, Link zu Einstellungen Co-Authored-By: Claude Sonnet 4.6 --- app/Console/Commands/WizardDomains.php | 2 ++ app/Livewire/Setup/Wizard.php | 17 ++++++++++++++++- app/Livewire/Ui/Nx/Dashboard.php | 3 +++ app/Livewire/Ui/System/SettingsForm.php | 1 + resources/views/livewire/setup/wizard.blade.php | 12 +++++++++++- .../views/livewire/ui/nx/dashboard.blade.php | 14 ++++++++++++++ 6 files changed, 47 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/WizardDomains.php b/app/Console/Commands/WizardDomains.php index 633aaf7..de51211 100644 --- a/app/Console/Commands/WizardDomains.php +++ b/app/Console/Commands/WizardDomains.php @@ -2,6 +2,7 @@ namespace App\Console\Commands; +use App\Models\Setting; use Illuminate\Console\Command; class WizardDomains extends Command @@ -81,6 +82,7 @@ class WizardDomains extends Command } file_put_contents(self::STATE_DIR . '/done', $allOk ? '1' : '0'); + Setting::set('ssl_configured', $allOk ? '1' : '0'); return self::SUCCESS; } } diff --git a/app/Livewire/Setup/Wizard.php b/app/Livewire/Setup/Wizard.php index 9af8d2c..8c83a82 100644 --- a/app/Livewire/Setup/Wizard.php +++ b/app/Livewire/Setup/Wizard.php @@ -26,6 +26,9 @@ class Wizard extends Component public string $mail_domain = ''; public string $webmail_domain = ''; + // Schritt 4 — Option + public bool $skipSsl = false; + // Schritt 3 — Admin-Account public string $admin_name = ''; public string $admin_email = ''; @@ -52,6 +55,18 @@ class Wizard extends Component $this->webmail_domain = Setting::get('webmail_domain', ''); } + public function updatedUiDomain(): void { $this->fillEmptyDomains($this->ui_domain); } + public function updatedMailDomain(): void { $this->fillEmptyDomains($this->mail_domain); } + public function updatedWebmailDomain(): void { $this->fillEmptyDomains($this->webmail_domain); } + + private function fillEmptyDomains(string $value): void + { + if ($value === '') return; + if ($this->ui_domain === '') $this->ui_domain = $value; + if ($this->mail_domain === '') $this->mail_domain = $value; + if ($this->webmail_domain === '') $this->webmail_domain = $value; + } + public function next(): void { match ($this->step) { @@ -133,7 +148,7 @@ class Wizard extends Component file_put_contents(self::STATE_DIR . "/{$k}", 'pending'); } - $ssl = app()->isProduction() ? 1 : 0; + $ssl = (!$this->skipSsl && app()->isProduction()) ? 1 : 0; $artisan = base_path('artisan'); $cmd = sprintf( 'nohup php %s mailwolt:wizard-domains --ui=%s --mail=%s --webmail=%s --ssl=%d > /dev/null 2>&1 &', diff --git a/app/Livewire/Ui/Nx/Dashboard.php b/app/Livewire/Ui/Nx/Dashboard.php index c197522..19701c1 100644 --- a/app/Livewire/Ui/Nx/Dashboard.php +++ b/app/Livewire/Ui/Nx/Dashboard.php @@ -35,7 +35,10 @@ class Dashboard extends Component $servicesActive = count(array_filter($services, fn($s) => $s['status'] === 'online')); + $sslConfigured = SettingModel::get('ssl_configured', '1') === '1'; + return view('livewire.ui.nx.dashboard', [ + 'sslConfigured' => $sslConfigured, 'domainCount' => Domain::where('is_system', false)->where('is_server', false)->count(), 'mailboxCount' => MailUser::where('is_system', false)->where('is_active', true)->count(), 'servicesActive' => $servicesActive, diff --git a/app/Livewire/Ui/System/SettingsForm.php b/app/Livewire/Ui/System/SettingsForm.php index 1f22eb3..a8951c9 100644 --- a/app/Livewire/Ui/System/SettingsForm.php +++ b/app/Livewire/Ui/System/SettingsForm.php @@ -306,6 +306,7 @@ class SettingsForm extends Component \Illuminate\Support\Facades\Log::info('mailwolt-apply-domains', ['output' => $output]); if ($ok) { + Setting::set('ssl_configured', '1'); $this->dispatch('toast', type: 'done', badge: 'Nginx', title: 'Nginx aktualisiert', text: 'Nginx-Konfiguration wurde neu geladen.', diff --git a/resources/views/livewire/setup/wizard.blade.php b/resources/views/livewire/setup/wizard.blade.php index 1f9131a..bc628b0 100644 --- a/resources/views/livewire/setup/wizard.blade.php +++ b/resources/views/livewire/setup/wizard.blade.php @@ -151,6 +151,16 @@ @endforeach +
+ + @if($skipSsl) +
Nginx wird ohne SSL konfiguriert. Im Dashboard erscheint ein Hinweis bis SSL eingerichtet ist.
+ @endif +
+ {{-- ── Schritt 5: Domain-Setup ── --}} @elseif($step === 5) @if(!$setupDone) @@ -170,7 +180,7 @@ 'done' => ['icon' => '✓', 'color' => 'rgba(34,197,94,.9)', 'bg' => 'rgba(34,197,94,.07)', 'label' => 'Abgeschlossen'], 'nodns' => ['icon' => '!', 'color' => '#fbbf24', 'bg' => 'rgba(251,191,36,.07)', 'label' => 'Kein DNS-Eintrag gefunden'], 'error' => ['icon' => '✗', 'color' => '#f87171', 'bg' => 'rgba(239,68,68,.07)', 'label' => 'Fehler bei Registrierung'], - 'skip' => ['icon' => '–', 'color' => 'var(--mw-t5)', 'bg' => 'var(--mw-bg3)', 'label' => 'Übersprungen'], + 'skip' => ['icon' => '–', 'color' => 'var(--mw-t4)', 'bg' => 'var(--mw-bg3)', 'label' => 'SSL übersprungen'], ]; @endphp diff --git a/resources/views/livewire/ui/nx/dashboard.blade.php b/resources/views/livewire/ui/nx/dashboard.blade.php index 11a3bf8..c99669b 100644 --- a/resources/views/livewire/ui/nx/dashboard.blade.php +++ b/resources/views/livewire/ui/nx/dashboard.blade.php @@ -3,6 +3,20 @@
+{{-- SSL-Banner --}} +@if(!$sslConfigured) +
+ +
+ SSL noch nicht eingerichtet + Domains laufen ohne HTTPS — Zertifikate in den Einstellungen beantragen. +
+ + Jetzt einrichten → + +
+@endif + {{-- Hero Banner --}}