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