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

View File

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