Show users hub connection details for their domains
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 36s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m43s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
2024-05-24 11:04:25 +10:00
parent a687b5fd1c
commit 86c27a3f17
4 changed files with 117 additions and 4 deletions

View File

@@ -131,6 +131,36 @@ function our_address(Domain|Address $o=NULL): Collection|Address|NULL
}
}
function our_hostname(Address $o): string
{
$our = our_address($o->domain)->first();
switch ($our->role_id) {
case Address::NODE_ZC:
$domain = collect(explode('.',gethostname()))->forget(0)
->prepend(sprintf('z%d',$our->zone->zone_id));
break;
case Address::NODE_NC:
$domain = collect(explode('.',gethostname()))->forget(0)
->prepend(sprintf('z%d',$our->zone->zone_id))
->prepend(sprintf('n%d',$our->host_id));
break;
case Address::NODE_HC:
$domain = collect(explode('.',gethostname()))->forget(0)
->prepend(sprintf('z%d',$our->zone->zone_id))
->prepend(sprintf('n%d',$our->host_id))
->prepend(sprintf('f%d',$our->node_id));
break;
default:
$domain = collect(explode('.',gethostname()));
}
return $domain->join('.');
}
/**
* Return a list of nodes that collect mail directly from us
*