diff --git a/app/console b/app/console index e9b113b169..7e31c3e34c 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit e9b113b169f54b879d4d97ce775f5829e0a716ef +Subproject commit 7e31c3e34cfc1a3aa9491e634672f12e6c10be41 diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index 1b51aac2b1..c17e851529 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -29,6 +29,10 @@ App::get('/v1/console/variables') ->label('sdk.response.model', Response::MODEL_CONSOLE_VARIABLES) ->inject('response') ->action(function (Response $response) { + $isDomainEnabled = !empty(App::getEnv('_APP_DOMAIN', '')) + && !empty(App::getEnv('_APP_DOMAIN_TARGET', '')) + && App::getEnv('_APP_DOMAIN', '') !== 'localhost' + && App::getEnv('_APP_DOMAIN_TARGET', '') !== 'localhost'; $isVcsEnabled = !empty(App::getEnv('_APP_VCS_GITHUB_APP_NAME', '')) && !empty(App::getEnv('_APP_VCS_GITHUB_PRIVATE_KEY', '')) @@ -44,6 +48,7 @@ App::get('/v1/console/variables') '_APP_FUNCTIONS_SIZE_LIMIT' => +App::getEnv('_APP_FUNCTIONS_SIZE_LIMIT'), '_APP_USAGE_STATS' => App::getEnv('_APP_USAGE_STATS'), '_APP_VCS_ENABLED' => $isVcsEnabled, + '_APP_DOMAIN_ENABLED' => $isDomainEnabled, '_APP_ASSISTANT_ENABLED' => $isAssistantEnabled ]); diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index e7d93a9621..1359d23b3a 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1521,7 +1521,7 @@ App::patch('/v1/projects/:projectId/smtp') ->label('sdk.response.model', Response::MODEL_PROJECT) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(), 'Enable custom SMTP service') - ->param('senderName', '', new Text(255), 'Name of the email sender', true) + ->param('senderName', '', new Text(255, 0), 'Name of the email sender', true) ->param('senderEmail', '', new Email(), 'Email of the sender', true) ->param('replyTo', '', new Email(), 'Reply to email', true) ->param('host', '', new HostName(), 'SMTP server host name', true) @@ -1753,7 +1753,7 @@ App::patch('/v1/projects/:projectId/templates/email/:type/:locale') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->param('subject', '', new Text(255), 'Email Subject') ->param('message', '', new Text(0), 'Template message') - ->param('senderName', '', new Text(255), 'Name of the email sender', true) + ->param('senderName', '', new Text(255, 0), 'Name of the email sender', true) ->param('senderEmail', '', new Email(), 'Email of the sender', true) ->param('replyTo', '', new Email(), 'Reply to email', true) ->inject('response') diff --git a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php index 39a9a35218..a82b8008cc 100644 --- a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php +++ b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php @@ -40,6 +40,12 @@ class ConsoleVariables extends Model 'default' => false, 'example' => true, ]) + ->addRule('_APP_DOMAIN_ENABLED', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Defines if main domain is configured. If so, custom domains can be created.', + 'default' => false, + 'example' => true, + ]) ->addRule('_APP_ASSISTANT_ENABLED', [ 'type' => self::TYPE_BOOLEAN, 'description' => 'Defines if AI assistant is enabled.',