CluPilotCloud/app/Services/Dns/HostDnsDirectory.php

30 lines
1.0 KiB
PHP

<?php
namespace App\Services\Dns;
/**
* The internal, WireGuard-only counterpart to HetznerDnsClient: a host's name
* (fsn-01.node.…) resolves only inside the tunnel, via the vpn-dns container's
* dnsmasq --hostsdir, never in the public zone. See RegisterHostDns.
*/
interface HostDnsDirectory
{
/** Writes (or overwrites) the host's entry. Idempotent. */
public function write(string $name, string $fqdn, string $ip): void;
/** Removes the host's entry, if one exists. */
public function remove(string $name): void;
/**
* Schreibt EINE Datei mit einer Zeile je FQDN. Eine leere Liste entfernt sie.
*
* Eine Datei statt einer je Name, weil diese Gruppe sich ändert: fällt ein
* Website-Name weg, verschwindet er dadurch mit — bei einer Datei je Name
* bliebe die verwaiste Zeile stehen und der alte Name zeigte weiter in den
* Tunnel.
*
* @param array<int, string> $fqdns
*/
public function writeMany(string $key, array $fqdns, string $ip): void;
}