added chekcs for cron job

This commit is contained in:
tracer 2024-05-01 18:39:55 +02:00
parent 753e96ed85
commit 4e056f6831
5 changed files with 16 additions and 15 deletions

8
TODO
View File

@ -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

View File

@ -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",

View File

@ -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

View File

@ -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();
}

View File

@ -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));