Add _APP_DOMAIN_SITES to console variables

This commit is contained in:
Khushboo Verma
2024-11-20 14:44:22 +05:30
parent 510d871379
commit 00c6549610
5 changed files with 11 additions and 5 deletions
+2 -1
View File
@@ -50,7 +50,8 @@ App::get('/v1/console/variables')
'_APP_USAGE_STATS' => System::getEnv('_APP_USAGE_STATS'),
'_APP_VCS_ENABLED' => $isVcsEnabled,
'_APP_DOMAIN_ENABLED' => $isDomainEnabled,
'_APP_ASSISTANT_ENABLED' => $isAssistantEnabled
'_APP_ASSISTANT_ENABLED' => $isAssistantEnabled,
'_APP_DOMAIN_SITES' => System::getEnv('_APP_DOMAIN_SITES')
]);
$response->dynamic($variables, Response::MODEL_CONSOLE_VARIABLES);
+1 -1
View File
@@ -235,7 +235,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId
$ruleId = md5($domain);
$rule = Authorization::skip(
fn() => $dbForConsole->createDocument('rules', new Document([
fn () => $dbForConsole->createDocument('rules', new Document([
'$id' => $ruleId,
'projectId' => $project->getId(),
'projectInternalId' => $project->getInternalId(),
@@ -169,7 +169,7 @@ class Base extends Action
$ruleId = md5($domain);
$rule = Authorization::skip(
fn() => $dbForConsole->createDocument('rules', new Document([
fn () => $dbForConsole->createDocument('rules', new Document([
'$id' => $ruleId,
'projectId' => $project->getId(),
'projectInternalId' => $project->getInternalId(),
@@ -18,7 +18,6 @@ use Utopia\Database\Document;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
use Utopia\Database\Query;
use Utopia\Database\Validator\Authorization;
use Utopia\Platform\Action;
use Utopia\Platform\Scope\HTTP;
@@ -234,7 +233,7 @@ class CreateSite extends Base
$ruleId = md5($domain);
$rule = Authorization::skip(
fn() => $dbForConsole->createDocument('rules', new Document([
fn () => $dbForConsole->createDocument('rules', new Document([
'$id' => $ruleId,
'projectId' => $project->getId(),
'projectInternalId' => $project->getInternalId(),
@@ -51,6 +51,12 @@ class ConsoleVariables extends Model
'description' => 'Defines if AI assistant is enabled.',
'default' => false,
'example' => true,
])
->addRule('_APP_DOMAIN_SITES', [
'type' => self::TYPE_STRING,
'description' => 'A domain to use for site URLs.',
'default' => '',
'example' => 'sites.localhost',
]);
}