Anpassen der Tlsa Record Ausgabe im Modal
parent
0a03324eec
commit
4a52284245
|
|
@ -0,0 +1,14 @@
|
|||
[90m= [39m[34;4mApp\Models\TlsaRecord[39;24m {#6794
|
||||
[34mid[39m: [35m1[39m,
|
||||
[34mdomain_id[39m: [35m9[39m,
|
||||
[34mservice[39m: "[32m_25._tcp[39m",
|
||||
[34mhost[39m: "[32mmx.nexlab.at[39m",
|
||||
[34musage[39m: [35m3[39m,
|
||||
[34mselector[39m: [35m1[39m,
|
||||
[34mmatching[39m: [35m1[39m,
|
||||
[34mhash[39m: "[32m0922eee5f6090b241a3f8554a366b3c1adc4088eb1cdffa94ae838c6e580b983[39m",
|
||||
[34mcert_path[39m: "[32m/etc/ssl/mail/fullchain.pem[39m",
|
||||
[34mcreated_at[39m: "[32m2025-10-06 15:24:56[39m",
|
||||
[34mupdated_at[39m: "[32m2025-10-06 15:24:56[39m",
|
||||
}
|
||||
|
||||
|
|
@ -27,6 +27,7 @@ class DomainDnsList extends Component
|
|||
$this->systemDomain = Domain::where('is_system', true)->first();
|
||||
// $this->userDomains = Domain::where('is_system', false)->orderBy('domain')->get();
|
||||
$domains = Domain::where('is_system', false)
|
||||
->where('is_server', false)
|
||||
->withCount([
|
||||
'mailUsers as mailboxes_count', // -> mail_users
|
||||
'mailAliases as aliases_count', // -> mail_aliases
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Livewire\Ui\Domain\Modal;
|
||||
|
||||
use App\Models\Domain;
|
||||
use App\Models\TlsaRecord;
|
||||
use App\Support\NetProbe;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use LivewireUI\Modal\ModalComponent;
|
||||
|
|
@ -20,7 +21,10 @@ class DomainDnsModal extends ModalComponent
|
|||
/** @var array<int,array<string,string|int|null>> */
|
||||
public array $dynamic = [];
|
||||
|
||||
public static function modalMaxWidth(): string { return '6xl'; }
|
||||
public static function modalMaxWidth(): string
|
||||
{
|
||||
return '6xl';
|
||||
}
|
||||
|
||||
public function mount(int $domainId): void
|
||||
{
|
||||
|
|
@ -54,15 +58,25 @@ class DomainDnsModal extends ModalComponent
|
|||
$this->static[] = ['type' => 'AAAA', 'name' => $mta, 'value' => $ipv6];
|
||||
$this->static[] = ['type' => 'PTR', 'name' => $this->ptrFromIPv6($ipv6), 'value' => $mta];
|
||||
}
|
||||
if ($tlsa = config('mailwolt.tlsa')) {
|
||||
$this->static[] = ['type'=>'TLSA','name'=>"_25._tcp.$mta",'value'=>$tlsa];
|
||||
|
||||
|
||||
$tlsa = TlsaRecord::forServer()
|
||||
->where('service', '_25._tcp')
|
||||
->latest('id')
|
||||
->first();
|
||||
|
||||
if ($tlsa?->dns_string) {
|
||||
$this->static[] = [
|
||||
'type' => 'TLSA',
|
||||
'name' => "{$tlsa->service}.{$tlsa->host}",
|
||||
'value' => "{$tlsa->usage} {$tlsa->selector} {$tlsa->matching} {$tlsa->hash}",
|
||||
];
|
||||
}
|
||||
$this->static[] = ['type'=>'MX','name'=>$this->domainName,'value'=>"10 $mta."];
|
||||
|
||||
// --- Domain-spezifisch ---
|
||||
$spf = 'v=spf1 mx a -all';
|
||||
$dmarc = "v=DMARC1; p=none; rua=mailto:dmarc@{$this->domainName}; pct=100";
|
||||
|
||||
*
|
||||
$dkim = DB::table('dkim_keys')
|
||||
->where('domain_id', $d->id)->where('is_active', 1)->orderByDesc('id')->first();
|
||||
$selector = $dkim ? $dkim->selector : 'mwl1';
|
||||
|
|
@ -108,6 +122,7 @@ class DomainDnsModal extends ModalComponent
|
|||
$p = array_reverse(explode('.', $ip));
|
||||
return implode('.', $p) . '.in-addr.arpa';
|
||||
}
|
||||
|
||||
private function ptrFromIPv6(string $ip): string
|
||||
{
|
||||
$expanded = strtolower(inet_ntop(inet_pton($ip)));
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TlsaRecord extends Model
|
||||
|
|
@ -10,8 +11,18 @@ class TlsaRecord extends Model
|
|||
'domain_id', 'service', 'host', 'usage', 'selector', 'matching', 'hash', 'cert_path',
|
||||
];
|
||||
|
||||
public function domain() { return $this->belongsTo(Domain::class); }
|
||||
// Relation zur Domain (FK: domain_id)
|
||||
public function domain()
|
||||
{
|
||||
return $this->belongsTo(Domain::class);
|
||||
}
|
||||
|
||||
public function scopeForServer(Builder $q): Builder
|
||||
{
|
||||
return $q->whereHas('domain', fn($d) => $d->where('is_server', true));
|
||||
}
|
||||
|
||||
// Fertige Ausgabe-Zeile
|
||||
public function getDnsStringAttribute(): string
|
||||
{
|
||||
return "{$this->service}.{$this->host}. IN TLSA {$this->usage} {$this->selector} {$this->matching} {$this->hash}";
|
||||
|
|
|
|||
Loading…
Reference in New Issue