From 7956b47aa82e9197efbbcc45bfb058b564018eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 18 Feb 2026 11:06:56 +0100 Subject: [PATCH 1/4] Target rule for screenshot --- docker-compose.yml | 1 + .../Modules/Functions/Workers/Screenshots.php | 38 ++++--------------- 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 635b1cb2cf..df9f6246fd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -565,6 +565,7 @@ services: # Specific - _APP_BROWSER_HOST - _APP_WORKER_SCREENSHOTS_ROUTER + - _APP_OPTIONS_FORCE_HTTPS # Basic - _APP_ENV - _APP_WORKER_PER_CORE diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php b/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php index 485078af88..8e0d54dc1b 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php @@ -111,52 +111,28 @@ class Screenshots extends Action throw new \Exception('Bucket not found'); } - $routerHost = System::getEnv('_APP_WORKER_SCREENSHOTS_ROUTER', 'http://appwrite'); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; + $routerHost = "$protocol://{$rule->getAttribute('domain')}"; $configs = [ 'screenshotLight' => [ - 'headers' => [ 'x-appwrite-hostname' => $rule->getAttribute('domain') ], + 'headers' => [], 'url' => $routerHost . '/?appwrite-preview=1&appwrite-theme=light', 'theme' => 'light' ], 'screenshotDark' => [ - 'headers' => [ 'x-appwrite-hostname' => $rule->getAttribute('domain') ], + 'headers' => [], 'url' => $routerHost . '/?appwrite-preview=1&appwrite-theme=dark', 'theme' => 'dark' ], ]; - $jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 0); - $apiKey = $jwtObj->encode([ - 'hostnameOverride' => true, - 'disabledMetrics' => [ - METRIC_EXECUTIONS, - METRIC_EXECUTIONS_COMPUTE, - METRIC_EXECUTIONS_MB_SECONDS, - METRIC_NETWORK_REQUESTS, - METRIC_NETWORK_INBOUND, - METRIC_NETWORK_OUTBOUND, - str_replace(["{resourceType}"], [RESOURCE_TYPE_SITES], METRIC_RESOURCE_TYPE_EXECUTIONS), - str_replace(["{resourceType}"], [RESOURCE_TYPE_SITES], METRIC_RESOURCE_TYPE_EXECUTIONS_COMPUTE), - str_replace(["{resourceType}"], [RESOURCE_TYPE_SITES], METRIC_RESOURCE_TYPE_EXECUTIONS_MB_SECONDS), - str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), - str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), - str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), - ], - 'bannerDisabled' => true, - 'projectCheckDisabled' => true, - 'previewAuthDisabled' => true, - 'deploymentStatusIgnored' => true - ]); - $screenshotError = null; - $screenshots = batch(\array_map(function ($key) use ($configs, $apiKey, $site, $client, &$screenshotError) { - return function () use ($key, $configs, $apiKey, $site, $client, &$screenshotError) { + $screenshots = batch(\array_map(function ($key) use ($configs, $site, $client, &$screenshotError) { + return function () use ($key, $configs, $site, $client, &$screenshotError) { try { $config = $configs[$key]; - $config['headers'] = \array_merge($config['headers'] ?? [], [ - 'x-appwrite-key' => API_KEY_DYNAMIC . '_' . $apiKey - ]); + $config['headers'] = $config['headers'] ?? []; $config['sleep'] = 3000; $frameworks = Config::getParam('frameworks', []); From 84eb065eb079b86e2aab26ddd3284283b87e32c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 18 Feb 2026 11:07:31 +0100 Subject: [PATCH 2/4] Screenshot after rule ready --- .../Modules/Functions/Workers/Builds.php | 20 +++++++++---------- .../Modules/Functions/Workers/Screenshots.php | 1 - 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 0245084b5e..db5a0532f1 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -1013,16 +1013,6 @@ class Builds extends Action Console::log('Deployment activated'); } - /** Screenshot site */ - if ($resource->getCollection() === 'sites') { - $queueForScreenshots - ->setDeploymentId($deployment->getId()) - ->setProject($project) - ->trigger(); - - Console::log('Site screenshot queued'); - } - $this->afterDeploymentSuccess( $project, $deployment, @@ -1123,6 +1113,16 @@ class Builds extends Action $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule); } + /** Screenshot site */ + if ($resource->getCollection() === 'sites') { + $queueForScreenshots + ->setDeploymentId($deployment->getId()) + ->setProject($project) + ->trigger(); + + Console::log('Site screenshot queued'); + } + Console::info('Deployment action finished'); } catch (\Throwable $th) { Console::warning('Build failed:'); diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php b/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php index 8e0d54dc1b..5acc7fd83f 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php @@ -2,7 +2,6 @@ namespace Appwrite\Platform\Modules\Functions\Workers; -use Ahc\Jwt\JWT; use Appwrite\Event\Realtime; use Appwrite\Permission; use Appwrite\Role; From f1f03fd35ef6627f07d993e914a6b9319e7849a9 Mon Sep 17 00:00:00 2001 From: Harsh Mahajan Date: Wed, 18 Feb 2026 16:22:33 +0530 Subject: [PATCH 3/4] fix: preserve template type casing in specs --- .../specs/open-api3-latest-console.json | 173 ++++++++++++++++-- app/config/specs/open-api3-latest-server.json | 104 +++++++++++ app/config/specs/swagger2-latest-console.json | 173 ++++++++++++++++-- app/config/specs/swagger2-latest-server.json | 104 +++++++++++ app/controllers/api/projects.php | 12 +- 5 files changed, 524 insertions(+), 42 deletions(-) diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index b57aea9ddc..3d51c714f7 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -14422,27 +14422,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -14458,25 +14469,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -14807,27 +14827,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -14843,25 +14874,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -15214,27 +15254,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -15250,25 +15301,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -24560,7 +24620,7 @@ "parameters": [ { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, resourceId, resourceType, statusCounters, resourceData, errors", "required": false, "schema": { "type": "array", @@ -24671,7 +24731,10 @@ "file", "function", "deployment", - "environment-variable" + "environment-variable", + "site", + "site-deployment", + "site-variable" ], "x-enum-name": null, "x-enum-keys": [] @@ -24778,7 +24841,10 @@ "file", "function", "deployment", - "environment-variable" + "environment-variable", + "site", + "site-deployment", + "site-variable" ], "x-enum-name": null, "x-enum-keys": [] @@ -30460,12 +30526,12 @@ "x-example": "verification", "enum": [ "verification", - "magicsession", + "magicSession", "recovery", "invitation", - "mfachallenge", - "sessionalert", - "otpsession" + "mfaChallenge", + "sessionAlert", + "otpSession" ], "x-enum-name": "EmailTemplateType", "x-enum-keys": [] @@ -30685,12 +30751,12 @@ "x-example": "verification", "enum": [ "verification", - "magicsession", + "magicSession", "recovery", "invitation", - "mfachallenge", - "sessionalert", - "otpsession" + "mfaChallenge", + "sessionAlert", + "otpSession" ], "x-enum-name": "EmailTemplateType", "x-enum-keys": [] @@ -30952,12 +31018,12 @@ "x-example": "verification", "enum": [ "verification", - "magicsession", + "magicSession", "recovery", "invitation", - "mfachallenge", - "sessionalert", - "otpsession" + "mfaChallenge", + "sessionAlert", + "otpSession" ], "x-enum-name": "EmailTemplateType", "x-enum-keys": [] @@ -31245,7 +31311,7 @@ "verification", "login", "invitation", - "mfachallenge" + "mfaChallenge" ], "x-enum-name": "SmsTemplateType", "x-enum-keys": [] @@ -31535,7 +31601,7 @@ "verification", "login", "invitation", - "mfachallenge" + "mfaChallenge" ], "x-enum-name": "SmsTemplateType", "x-enum-keys": [] @@ -31840,7 +31906,7 @@ "verification", "login", "invitation", - "mfachallenge" + "mfaChallenge" ], "x-enum-name": "SmsTemplateType", "x-enum-keys": [] @@ -33318,27 +33384,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -33354,25 +33431,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -34005,27 +34091,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -34041,25 +34138,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -52962,6 +53068,18 @@ { "$ref": "#\/components\/schemas\/attributePolygon" }, + { + "$ref": "#\/components\/schemas\/attributeVarchar" + }, + { + "$ref": "#\/components\/schemas\/attributeText" + }, + { + "$ref": "#\/components\/schemas\/attributeMediumtext" + }, + { + "$ref": "#\/components\/schemas\/attributeLongtext" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -53072,6 +53190,18 @@ { "$ref": "#\/components\/schemas\/attributePolygon" }, + { + "$ref": "#\/components\/schemas\/attributeVarchar" + }, + { + "$ref": "#\/components\/schemas\/attributeText" + }, + { + "$ref": "#\/components\/schemas\/attributeMediumtext" + }, + { + "$ref": "#\/components\/schemas\/attributeLongtext" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -60494,6 +60624,11 @@ "vip" ] }, + "status": { + "type": "string", + "description": "Project status.", + "x-example": "active" + }, "authEmailPassword": { "type": "boolean", "description": "Email\/Password auth method status", @@ -60639,6 +60774,7 @@ "pingCount", "pingedAt", "labels", + "status", "authEmailPassword", "authUsersAuthMagicURL", "authEmailOtp", @@ -60710,6 +60846,7 @@ "labels": [ "vip" ], + "status": "active", "authEmailPassword": true, "authUsersAuthMagicURL": true, "authEmailOtp": true, diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 016d44fbc4..b15f065444 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -13458,27 +13458,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -13494,25 +13505,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -13927,27 +13947,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -13963,25 +13994,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -23491,27 +23531,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -23527,25 +23578,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -23918,27 +23978,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -23954,25 +24025,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -41008,6 +41088,18 @@ { "$ref": "#\/components\/schemas\/attributePolygon" }, + { + "$ref": "#\/components\/schemas\/attributeVarchar" + }, + { + "$ref": "#\/components\/schemas\/attributeText" + }, + { + "$ref": "#\/components\/schemas\/attributeMediumtext" + }, + { + "$ref": "#\/components\/schemas\/attributeLongtext" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -41118,6 +41210,18 @@ { "$ref": "#\/components\/schemas\/attributePolygon" }, + { + "$ref": "#\/components\/schemas\/attributeVarchar" + }, + { + "$ref": "#\/components\/schemas\/attributeText" + }, + { + "$ref": "#\/components\/schemas\/attributeMediumtext" + }, + { + "$ref": "#\/components\/schemas\/attributeLongtext" + }, { "$ref": "#\/components\/schemas\/attributeString" } diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 06673c7ad9..ce936d75b3 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -14361,27 +14361,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -14397,25 +14408,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -14760,27 +14780,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -14796,25 +14827,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -15154,27 +15194,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -15190,25 +15241,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -24662,7 +24722,7 @@ "parameters": [ { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, resourceId, resourceType, statusCounters, resourceData, errors", "required": false, "type": "array", "collectionFormat": "multi", @@ -24772,7 +24832,10 @@ "file", "function", "deployment", - "environment-variable" + "environment-variable", + "site", + "site-deployment", + "site-variable" ], "x-enum-name": null, "x-enum-keys": [] @@ -24881,7 +24944,10 @@ "file", "function", "deployment", - "environment-variable" + "environment-variable", + "site", + "site-deployment", + "site-variable" ], "x-enum-name": null, "x-enum-keys": [] @@ -30563,12 +30629,12 @@ "x-example": "verification", "enum": [ "verification", - "magicsession", + "magicSession", "recovery", "invitation", - "mfachallenge", - "sessionalert", - "otpsession" + "mfaChallenge", + "sessionAlert", + "otpSession" ], "x-enum-name": "EmailTemplateType", "x-enum-keys": [], @@ -30784,12 +30850,12 @@ "x-example": "verification", "enum": [ "verification", - "magicsession", + "magicSession", "recovery", "invitation", - "mfachallenge", - "sessionalert", - "otpsession" + "mfaChallenge", + "sessionAlert", + "otpSession" ], "x-enum-name": "EmailTemplateType", "x-enum-keys": [], @@ -31050,12 +31116,12 @@ "x-example": "verification", "enum": [ "verification", - "magicsession", + "magicSession", "recovery", "invitation", - "mfachallenge", - "sessionalert", - "otpsession" + "mfaChallenge", + "sessionAlert", + "otpSession" ], "x-enum-name": "EmailTemplateType", "x-enum-keys": [], @@ -31337,7 +31403,7 @@ "verification", "login", "invitation", - "mfachallenge" + "mfaChallenge" ], "x-enum-name": "SmsTemplateType", "x-enum-keys": [], @@ -31623,7 +31689,7 @@ "verification", "login", "invitation", - "mfachallenge" + "mfaChallenge" ], "x-enum-name": "SmsTemplateType", "x-enum-keys": [], @@ -31923,7 +31989,7 @@ "verification", "login", "invitation", - "mfachallenge" + "mfaChallenge" ], "x-enum-name": "SmsTemplateType", "x-enum-keys": [], @@ -33419,27 +33485,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -33455,25 +33532,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -34109,27 +34195,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -34145,25 +34242,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -52773,6 +52879,18 @@ { "$ref": "#\/definitions\/attributePolygon" }, + { + "$ref": "#\/definitions\/attributeVarchar" + }, + { + "$ref": "#\/definitions\/attributeText" + }, + { + "$ref": "#\/definitions\/attributeMediumtext" + }, + { + "$ref": "#\/definitions\/attributeLongtext" + }, { "$ref": "#\/definitions\/attributeString" } @@ -52884,6 +53002,18 @@ { "$ref": "#\/definitions\/attributePolygon" }, + { + "$ref": "#\/definitions\/attributeVarchar" + }, + { + "$ref": "#\/definitions\/attributeText" + }, + { + "$ref": "#\/definitions\/attributeMediumtext" + }, + { + "$ref": "#\/definitions\/attributeLongtext" + }, { "$ref": "#\/definitions\/attributeString" } @@ -60327,6 +60457,11 @@ "vip" ] }, + "status": { + "type": "string", + "description": "Project status.", + "x-example": "active" + }, "authEmailPassword": { "type": "boolean", "description": "Email\/Password auth method status", @@ -60472,6 +60607,7 @@ "pingCount", "pingedAt", "labels", + "status", "authEmailPassword", "authUsersAuthMagicURL", "authEmailOtp", @@ -60543,6 +60679,7 @@ "labels": [ "vip" ], + "status": "active", "authEmailPassword": true, "authUsersAuthMagicURL": true, "authEmailOtp": true, diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index d61880e9b8..a99a82d13d 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -13406,27 +13406,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -13442,25 +13453,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -13888,27 +13908,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -13924,25 +13955,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -23626,27 +23666,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -23662,25 +23713,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -24066,27 +24126,38 @@ "node-20.0", "node-21.0", "node-22", + "node-23", + "node-24", + "node-25", "php-8.0", "php-8.1", "php-8.2", "php-8.3", + "php-8.4", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", + "ruby-3.4", + "ruby-4.0", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", + "python-3.13", + "python-3.14", "python-ml-3.11", "python-ml-3.12", + "python-ml-3.13", "deno-1.21", "deno-1.24", "deno-1.35", "deno-1.40", "deno-1.46", "deno-2.0", + "deno-2.5", + "deno-2.6", "dart-2.15", "dart-2.16", "dart-2.17", @@ -24102,25 +24173,34 @@ "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", + "dotnet-10", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "java-22", + "java-25", "swift-5.5", "swift-5.8", "swift-5.9", "swift-5.10", + "swift-6.2", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "kotlin-2.0", + "kotlin-2.3", "cpp-17", "cpp-20", "bun-1.0", "bun-1.1", + "bun-1.2", + "bun-1.3", "go-1.23", + "go-1.24", + "go-1.25", + "go-1.26", "static-1", "flutter-3.24", "flutter-3.27", @@ -40916,6 +40996,18 @@ { "$ref": "#\/definitions\/attributePolygon" }, + { + "$ref": "#\/definitions\/attributeVarchar" + }, + { + "$ref": "#\/definitions\/attributeText" + }, + { + "$ref": "#\/definitions\/attributeMediumtext" + }, + { + "$ref": "#\/definitions\/attributeLongtext" + }, { "$ref": "#\/definitions\/attributeString" } @@ -41027,6 +41119,18 @@ { "$ref": "#\/definitions\/attributePolygon" }, + { + "$ref": "#\/definitions\/attributeVarchar" + }, + { + "$ref": "#\/definitions\/attributeText" + }, + { + "$ref": "#\/definitions\/attributeMediumtext" + }, + { + "$ref": "#\/definitions\/attributeLongtext" + }, { "$ref": "#\/definitions\/attributeString" } diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 51d141dc27..b4f3fa26ca 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1922,7 +1922,7 @@ Http::get('/v1/projects/:projectId/templates/sms/:type/:locale') ) ]) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') + ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? [], true), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') ->inject('dbForPlatform') @@ -1970,7 +1970,7 @@ Http::get('/v1/projects/:projectId/templates/email/:type/:locale') ] )) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') + ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? [], true), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') ->inject('dbForPlatform') @@ -2089,7 +2089,7 @@ Http::patch('/v1/projects/:projectId/templates/sms/:type/:locale') ) ]) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') + ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? [], true), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->param('message', '', new Text(0), 'Template message') ->inject('response') @@ -2136,7 +2136,7 @@ Http::patch('/v1/projects/:projectId/templates/email/:type/:locale') ] )) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') + ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? [], true), 'Template type') ->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') @@ -2215,7 +2215,7 @@ Http::delete('/v1/projects/:projectId/templates/sms/:type/:locale') ) ]) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') + ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? [], true), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') ->inject('dbForPlatform') @@ -2266,7 +2266,7 @@ Http::delete('/v1/projects/:projectId/templates/email/:type/:locale') contentType: ContentType::JSON )) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') + ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? [], true), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') ->inject('dbForPlatform') From 2f32e312c84b3063a023eb84a28419d383125098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 18 Feb 2026 12:56:42 +0100 Subject: [PATCH 4/4] Fix tests --- .../Modules/Functions/Workers/Screenshots.php | 44 ++++++++++++++++--- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php b/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php index 5acc7fd83f..065fe477eb 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php @@ -2,6 +2,7 @@ namespace Appwrite\Platform\Modules\Functions\Workers; +use Ahc\Jwt\JWT; use Appwrite\Event\Realtime; use Appwrite\Permission; use Appwrite\Role; @@ -110,28 +111,57 @@ class Screenshots extends Action throw new \Exception('Bucket not found'); } - $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; - $routerHost = "$protocol://{$rule->getAttribute('domain')}"; + $routerHost = System::getEnv('_APP_WORKER_SCREENSHOTS_ROUTER', ''); + if (empty($routerHost)) { + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; + $routerHost = "$protocol://{$rule->getAttribute('domain')}"; + } + $configs = [ 'screenshotLight' => [ - 'headers' => [], + 'headers' => [ 'x-appwrite-hostname' => $rule->getAttribute('domain') ], 'url' => $routerHost . '/?appwrite-preview=1&appwrite-theme=light', 'theme' => 'light' ], 'screenshotDark' => [ - 'headers' => [], + 'headers' => [ 'x-appwrite-hostname' => $rule->getAttribute('domain') ], 'url' => $routerHost . '/?appwrite-preview=1&appwrite-theme=dark', 'theme' => 'dark' ], ]; + $jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 0); + $apiKey = $jwtObj->encode([ + 'hostnameOverride' => true, + 'disabledMetrics' => [ + METRIC_EXECUTIONS, + METRIC_EXECUTIONS_COMPUTE, + METRIC_EXECUTIONS_MB_SECONDS, + METRIC_NETWORK_REQUESTS, + METRIC_NETWORK_INBOUND, + METRIC_NETWORK_OUTBOUND, + str_replace(["{resourceType}"], [RESOURCE_TYPE_SITES], METRIC_RESOURCE_TYPE_EXECUTIONS), + str_replace(["{resourceType}"], [RESOURCE_TYPE_SITES], METRIC_RESOURCE_TYPE_EXECUTIONS_COMPUTE), + str_replace(["{resourceType}"], [RESOURCE_TYPE_SITES], METRIC_RESOURCE_TYPE_EXECUTIONS_MB_SECONDS), + str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), + str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), + str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), + ], + 'bannerDisabled' => true, + 'projectCheckDisabled' => true, + 'previewAuthDisabled' => true, + 'deploymentStatusIgnored' => true + ]); + $screenshotError = null; - $screenshots = batch(\array_map(function ($key) use ($configs, $site, $client, &$screenshotError) { - return function () use ($key, $configs, $site, $client, &$screenshotError) { + $screenshots = batch(\array_map(function ($key) use ($configs, $apiKey, $site, $client, &$screenshotError) { + return function () use ($key, $configs, $apiKey, $site, $client, &$screenshotError) { try { $config = $configs[$key]; - $config['headers'] = $config['headers'] ?? []; + $config['headers'] = \array_merge($config['headers'] ?? [], [ + 'x-appwrite-key' => API_KEY_DYNAMIC . '_' . $apiKey + ]); $config['sleep'] = 3000; $frameworks = Config::getParam('frameworks', []);