Add nameservers variable

This commit is contained in:
Matej Bačo
2025-02-22 18:32:10 +01:00
parent 0a25463b8d
commit aeebdadae1
4 changed files with 14 additions and 1 deletions
+2 -1
View File
@@ -62,7 +62,8 @@ App::get('/v1/console/variables')
'_APP_DOMAIN_ENABLED' => $isDomainEnabled,
'_APP_ASSISTANT_ENABLED' => $isAssistantEnabled,
'_APP_DOMAIN_SITES' => System::getEnv('_APP_DOMAIN_SITES'),
'_APP_OPTIONS_FORCE_HTTPS' => System::getEnv('_APP_OPTIONS_FORCE_HTTPS')
'_APP_OPTIONS_FORCE_HTTPS' => System::getEnv('_APP_OPTIONS_FORCE_HTTPS'),
'_APP_DOMAINS_NAMESERVERS' => System::getEnv('_APP_DOMAINS_NAMESERVERS'),
]);
$response->dynamic($variables, Response::MODEL_CONSOLE_VARIABLES);
@@ -66,6 +66,15 @@ class ConsoleVariables extends Model
'default' => '',
'example' => 'enabled',
]
)
->addRule(
'_APP_DOMAINS_NAMESERVERS',
[
'type' => self::TYPE_STRING,
'description' => 'Comma-separated list of nameservers.',
'default' => '',
'example' => 'ns1.example.com,ns2.example.com',
]
);
}
@@ -34,5 +34,6 @@ class ConsoleConsoleClientTest extends Scope
$this->assertIsBool($response['body']['_APP_ASSISTANT_ENABLED']);
$this->assertIsString($response['body']['_APP_DOMAIN_SITES']);
$this->assertIsString($response['body']['_APP_OPTIONS_FORCE_HTTPS']);
$this->assertIsString($response['body']['_APP_DOMAINS_NAMESERVERS']);
}
}
+2
View File
@@ -8,6 +8,8 @@ use Tests\E2E\Client;
trait ProxyBase
{
use Async;
// TODO: @Meldiron different kinds of rules, creation failure, list, get, update status
protected function createRule(mixed $params): mixed
{