diff --git a/TODO b/TODO index 4636b1e..b2a5832 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,6 @@ -Cron on all 4 ns. -BUG, NS$: No nameserver marked as this server. -BUG, NS1: Only one nameserver is designated as our host OK, but all are … -panels:apiping on all 4 servers -API Endpint cleanup +b4 cron job: check panel, check nameserver1 +check log file location +API Endpoint cleanup check keytype of panel/bindApi more UNIT tests diff --git a/composer.json b/composer.json index b977cad..2b40bf0 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "24unix/bindapi", "description": "manage Bind9 DNS server via REST API", "version": "1.0.9", - "build_number": "371", + "build_number": "372", "authors": [ { "name": "Micha Espey", diff --git a/dist/systemd/README.md b/dist/systemd/README.md index ba60aa4..0b93a13 100644 --- a/dist/systemd/README.md +++ b/dist/systemd/README.md @@ -1,4 +1,4 @@ -Copy this files to /etc/systems/system, adapt the path in the service unit and enable the timer by issuing: +Copy these files to /etc/systems/system, adapt the path in the service unit and enable the timer by issuing: systemctl daemon-reload systemctl enable bindAPI.timer diff --git a/src/Controller/CLIController.php b/src/Controller/CLIController.php index f687b62..52112bf 100644 --- a/src/Controller/CLIController.php +++ b/src/Controller/CLIController.php @@ -105,6 +105,12 @@ class CLIController $this->cronRun(); }))) ->addCommandGroup(commandGroup: (new CommandGroup(name: 'check', description: 'health checks the system can perform')) + ->addCommand(command: new Command( + name: 'cache', + callback: function () { + $this->checkCache(); + }, + description: 'Clear the opcache. Note: It doesn\'t call composer clear-cache.')) ->addCommand(command: new Command( name: 'permissions', callback: function () { @@ -2387,6 +2393,8 @@ const VERSION = '{$versionSting}'; private function cronRun() { $this->logger->info(message: 'cronRun()'); + $this->checkPanel(); + $this->checkNameserver(); $this->domainsUpdate(); } diff --git a/src/Controller/RequestController.php b/src/Controller/RequestController.php index dabcf33..82e5e79 100644 --- a/src/Controller/RequestController.php +++ b/src/Controller/RequestController.php @@ -245,7 +245,9 @@ class RequestController description: 'Returns information of a single domain specified by its domain name.', summary: 'Returns a single domain.', security: [ + ['Authorization' => []] ], + tags: ['Domains'], parameters: [ new OA\Parameter(name: 'name', in: 'path', required: true, schema: new OA\Schema(type: 'string')), @@ -410,9 +412,6 @@ class RequestController } - /** - * @return void - */ private function handleDomainsDeleteRequest(): void { $deleteData = fopen(filename: 'php://input', mode: 'r'); @@ -622,11 +621,7 @@ class RequestController } - /** - * @param String $host - * - * @return string - */ + private function getDomain(string $host): string { $host = strtolower(string: trim(string: $host));