Fix: DKIM-Fehler blockiert nicht mehr Domain-Erstellung + nur 1 Toast beim Speichern

- DomainObserver: DKIM-install-Fehler wird geloggt statt Domain-Create zu blockieren
- saveDomains: nur noch 1 Toast, alle Zwischen-Toasts (Nginx, DNS, Sysmail) entfernt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main v1.1.374
boban 2026-04-27 00:02:12 +02:00
parent 742c39f91a
commit fa8e9e7e88
2 changed files with 10 additions and 27 deletions

View File

@ -272,11 +272,7 @@ class SettingsForm extends Component
\Illuminate\Support\Facades\Log::error('SystemDomainSeeder failed', [
'fqdn' => $expectedFqdn,
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
]);
$this->dispatch('toast', type: 'warn', badge: 'Sysmail',
title: 'System-Domain konnte nicht angelegt werden',
text: $e->getMessage(), duration: 8000);
}
}
@ -398,11 +394,7 @@ class SettingsForm extends Component
}
if ($unreachable) {
$this->dispatch('toast', type: 'warn', badge: 'DNS',
title: 'DNS noch nicht erreichbar',
text: 'Kein DNS-Eintrag für: ' . implode(', ', $unreachable) . '. Domains wurden trotzdem gespeichert — Nginx-Konfiguration bitte nach DNS-Setup erneut speichern.',
duration: 9000,
);
Log::info('mailwolt-apply-domains skipped (DNS not ready)', ['unreachable' => $unreachable]);
return;
}
@ -423,23 +415,8 @@ class SettingsForm extends Component
if ($ok) {
Setting::set('ssl_configured', '1');
$this->dispatch('toast', type: 'done', badge: 'Nginx',
title: 'Nginx aktualisiert',
text: 'Nginx-Konfiguration wurde neu geladen.',
duration: 5000,
);
} else {
$lines = array_filter(
explode("\n", (string) $output),
fn($l) => preg_match('/\[!\]|error|failed|fehler|nginx\s+-t/i', trim($l))
);
$detail = implode(' · ', array_map('trim', array_slice(array_values($lines), 0, 3)));
$this->dispatch('toast', type: 'warn', badge: 'Nginx',
title: 'Nginx-Konfiguration fehlgeschlagen',
text: $detail ?: 'Nginx konnte nicht neu geladen werden. Domains gespeichert. Siehe Laravel-Log.',
duration: 10000,
);
Log::warning('mailwolt-apply-domains failed', ['output' => $output]);
}
}

View File

@ -20,8 +20,14 @@ class DomainObserver
$selector = (string) config('mailpool.defaults.dkim_selector', 'mwl1');
$bits = (int) config('mailpool.defaults.dkim_bits', 2048);
// Service erledigt: Key generieren, DB (upsert) pflegen, Helper ausführen, OpenDKIM reloaden
try {
app(\App\Services\DkimService::class)->generateForDomain($domain, $bits, $selector);
} catch (\Throwable $e) {
Log::warning('DKIM install skipped (sudo/helper not ready)', [
'domain' => $domain->domain,
'error' => $e->getMessage(),
]);
}
// DNS-Records: aktiven Key aus DB lesen und provisionieren
$active = $domain->dkimKeys()->where('is_active', true)->latest()->first();