From fbd00511185f554dd1ae8747af6327aeec3bebeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 28 Mar 2025 11:38:45 +0100 Subject: [PATCH] Make env var public --- app/config/specs/open-api3-latest-console.json | 6 ++++++ app/config/specs/swagger2-latest-console.json | 6 ++++++ app/controllers/api/console.php | 1 + src/Appwrite/Utopia/Response/Model/ConsoleVariables.php | 6 ++++++ 4 files changed, 19 insertions(+) diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index bd2230a4a8..12c6c190b9 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -40890,6 +40890,11 @@ "description": "A domain to use for site URLs.", "x-example": "sites.localhost" }, + "_APP_DOMAIN_FUNCTIONS": { + "type": "string", + "description": "A domain to use for function URLs.", + "x-example": "functions.localhost" + }, "_APP_OPTIONS_FORCE_HTTPS": { "type": "string", "description": "Defines if HTTPS is enforced for all requests.", @@ -40910,6 +40915,7 @@ "_APP_DOMAIN_ENABLED", "_APP_ASSISTANT_ENABLED", "_APP_DOMAIN_SITES", + "_APP_DOMAIN_FUNCTIONS", "_APP_OPTIONS_FORCE_HTTPS", "_APP_DOMAINS_NAMESERVERS" ] diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 0ef66f4f9c..72378fb0ea 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -41552,6 +41552,11 @@ "description": "A domain to use for site URLs.", "x-example": "sites.localhost" }, + "_APP_DOMAIN_FUNCTIONS": { + "type": "string", + "description": "A domain to use for function URLs.", + "x-example": "functions.localhost" + }, "_APP_OPTIONS_FORCE_HTTPS": { "type": "string", "description": "Defines if HTTPS is enforced for all requests.", @@ -41572,6 +41577,7 @@ "_APP_DOMAIN_ENABLED", "_APP_ASSISTANT_ENABLED", "_APP_DOMAIN_SITES", + "_APP_DOMAIN_FUNCTIONS", "_APP_OPTIONS_FORCE_HTTPS", "_APP_DOMAINS_NAMESERVERS" ] diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index d4b191cd62..4cf00faf65 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -62,6 +62,7 @@ App::get('/v1/console/variables') '_APP_DOMAIN_ENABLED' => $isDomainEnabled, '_APP_ASSISTANT_ENABLED' => $isAssistantEnabled, '_APP_DOMAIN_SITES' => System::getEnv('_APP_DOMAIN_SITES'), + '_APP_DOMAIN_FUNCTIONS' => System::getEnv('_APP_DOMAIN_FUNCTIONS'), '_APP_OPTIONS_FORCE_HTTPS' => System::getEnv('_APP_OPTIONS_FORCE_HTTPS'), '_APP_DOMAINS_NAMESERVERS' => System::getEnv('_APP_DOMAINS_NAMESERVERS'), ]); diff --git a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php index 2c1688969d..57f287fc78 100644 --- a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php +++ b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php @@ -58,6 +58,12 @@ class ConsoleVariables extends Model 'default' => '', 'example' => 'sites.localhost', ]) + ->addRule('_APP_DOMAIN_FUNCTIONS', [ + 'type' => self::TYPE_STRING, + 'description' => 'A domain to use for function URLs.', + 'default' => '', + 'example' => 'functions.localhost', + ]) ->addRule( '_APP_OPTIONS_FORCE_HTTPS', [