Enable overriding the DNS NS hostname

This commit is contained in:
Deon George 2023-11-28 19:57:47 +11:00
parent 9cf0f1e2f4
commit 535a082edd
2 changed files with 6 additions and 3 deletions

View File

@ -152,7 +152,7 @@ final class DNS extends BaseProtocol
self::DNS_NOERROR,
$this->soa(),
[],
[serialize($this->domain_split(gethostname())) => self::DNS_TYPE_NS],
[serialize($this->domain_split(config('fido.dns_ns'))) => self::DNS_TYPE_NS],
);
case self::DNS_TYPE_NS:
@ -160,7 +160,7 @@ final class DNS extends BaseProtocol
return $this->reply(
self::DNS_NOERROR,
[serialize($this->domain_split(gethostname())) => self::DNS_TYPE_NS]);
[serialize($this->domain_split(config('fido.dns_ns'))) => self::DNS_TYPE_NS]);
// Respond to A/AAAA/CNAME queries, with value or NAMEERR
case self::DNS_TYPE_CNAME:
@ -461,7 +461,7 @@ final class DNS extends BaseProtocol
{
return
[serialize([
$this->domain_split(gethostname()),
$this->domain_split(config('fido.dns_ns')),
$this->domain_split(Str::replace('@','.',config('app.mail.mail_from','nobody@'.gethostname()))),
1, // Serial
self::DEFAULT_TTL, // Refresh

View File

@ -1,6 +1,7 @@
<?php
return [
// When sending areafix/filefix messages, validate to addresses
'areafilefix' => ['areafix','filefix','rexfix','areamgr'],
@ -10,6 +11,8 @@ return [
// Directory to use for any data we want to store locally
'dir' => env('FIDO_DIR', 'fido'),
'dns_ns' => env('FIDO_DNS_NS', gethostname()),
// Our Storage::disk() for files storage
'file_disk' => env('FIDO_DIR_FILES', 's3'),