Domain Create Modal anpassen Fehler auf Null
parent
c143414119
commit
b10cb90b09
|
|
@ -265,17 +265,17 @@ class DomainCreateModal extends ModalComponent
|
|||
]);
|
||||
|
||||
|
||||
app(DnsRecordService::class)->provision(
|
||||
$domain,
|
||||
$dkim['selector'] ?? null,
|
||||
$dkim['dns_txt'] ?? null,
|
||||
[
|
||||
'spf_tail' => Setting::get('mailpool.spf_tail', '~all'),
|
||||
'spf_extra' => Setting::get('mailpool.spf_extra', []),
|
||||
'dmarc_policy' => Setting::get('mailpool.dmarc_policy', 'none'),
|
||||
'rua' => Setting::get('mailpool.rua', null),
|
||||
]
|
||||
);
|
||||
// app(DnsRecordService::class)->provision(
|
||||
// $domain,
|
||||
// $dkim['selector'] ?? null,
|
||||
// $dkim['dns_txt'] ?? null,
|
||||
// [
|
||||
// 'spf_tail' => Setting::get('mailpool.spf_tail', '~all'),
|
||||
// 'spf_extra' => Setting::get('mailpool.spf_extra', []),
|
||||
// 'dmarc_policy' => Setting::get('mailpool.dmarc_policy', 'none'),
|
||||
// 'rua' => Setting::get('mailpool.rua', null),
|
||||
// ]
|
||||
// );
|
||||
|
||||
// app(TlsaService::class)->createForDomain($domain);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,19 +16,13 @@ class DomainObserver
|
|||
*/
|
||||
public function created(Domain $domain): void
|
||||
{
|
||||
// Standardwerte aus Config oder .env
|
||||
$selector = config('mailwolt.dkim.selector', 'mwl1');
|
||||
$bits = (int) config('mailwolt.dkim.bits', 2048);
|
||||
$selector = (string) config('mailpool.defaults.dkim_selector', 'dkim');
|
||||
$bits = (int) config('mailpool.defaults.dkim_bits', 2048);
|
||||
|
||||
// Keypair erzeugen
|
||||
$res = app(DkimService::class)->generateForDomain(
|
||||
domainId: $domain,
|
||||
bits: $bits,
|
||||
selector: $selector
|
||||
);
|
||||
$res = app(\App\Services\DkimService::class)
|
||||
->generateForDomain($domain, $bits, $selector);
|
||||
|
||||
// In dkim_keys speichern
|
||||
$dk = DkimKey::create([
|
||||
$dk = \App\Models\DkimKey::create([
|
||||
'domain_id' => $domain->id,
|
||||
'selector' => $res['selector'],
|
||||
'private_key_pem' => $res['private_pem'],
|
||||
|
|
@ -36,14 +30,57 @@ class DomainObserver
|
|||
'is_active' => true,
|
||||
]);
|
||||
|
||||
// Helper-Job zum Installieren starten
|
||||
InstallDkimKey::dispatch(
|
||||
// Helper aufrufen (Pfad aus $res['priv_path']!)
|
||||
dispatch(new \App\Jobs\InstallDkimKey(
|
||||
domainId: $domain->id,
|
||||
dkimKeyId: $dk->id,
|
||||
privPath: $res['priv_path'],
|
||||
dnsTxtContent: $res['dns_txt']
|
||||
)->afterCommit();
|
||||
dnsTxtContent: $res['dns_txt'],
|
||||
));
|
||||
|
||||
// DNS-Records gleich anlegen/aktualisieren
|
||||
app(\App\Services\DnsRecordService::class)->provision(
|
||||
$domain,
|
||||
$dk->selector,
|
||||
"v=DKIM1; k=rsa; p={$dk->public_key_txt}",
|
||||
[
|
||||
'spf_tail' => \App\Models\Setting::get('mailpool.spf_tail', '~all'),
|
||||
'spf_extra' => \App\Models\Setting::get('mailpool.spf_extra', []),
|
||||
'dmarc_policy' => \App\Models\Setting::get('mailpool.dmarc_policy', 'none'),
|
||||
'rua' => \App\Models\Setting::get('mailpool.rua', null),
|
||||
]
|
||||
);
|
||||
}
|
||||
// public function created(Domain $domain): void
|
||||
// {
|
||||
// // Standardwerte aus Config oder .env
|
||||
// $selector = config('mailwolt.dkim.selector', 'mwl1');
|
||||
// $bits = (int) config('mailwolt.dkim.bits', 2048);
|
||||
//
|
||||
// // Keypair erzeugen
|
||||
// $res = app(DkimService::class)->generateForDomain(
|
||||
// domainId: $domain,
|
||||
// bits: $bits,
|
||||
// selector: $selector
|
||||
// );
|
||||
//
|
||||
// // In dkim_keys speichern
|
||||
// $dk = DkimKey::create([
|
||||
// 'domain_id' => $domain->id,
|
||||
// 'selector' => $res['selector'],
|
||||
// 'private_key_pem' => $res['private_pem'],
|
||||
// 'public_key_txt' => preg_replace('/^v=DKIM1; k=rsa; p=/', '', $res['dns_txt']),
|
||||
// 'is_active' => true,
|
||||
// ]);
|
||||
//
|
||||
// // Helper-Job zum Installieren starten
|
||||
// InstallDkimKey::dispatch(
|
||||
// domainId: $domain->id,
|
||||
// dkimKeyId: $dk->id,
|
||||
// privPath: $res['priv_path'],
|
||||
// dnsTxtContent: $res['dns_txt']
|
||||
// )->afterCommit();
|
||||
// }
|
||||
|
||||
/**
|
||||
* Beim Löschen alle DKIM-Selector dieser Domain aus OpenDKIM entfernen.
|
||||
|
|
|
|||
Loading…
Reference in New Issue