diff --git a/.env b/.env index 2e5c45603c..4980315c9a 100644 --- a/.env +++ b/.env @@ -87,7 +87,7 @@ _APP_EXECUTOR_HOST=http://exc1/v1 _APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1 _APP_SITES_RUNTIMES=static-1,node-22,flutter-3.29 _APP_MAINTENANCE_INTERVAL=86400 -_APP_MAINTENANCE_DELAY= +_APP_MAINTENANCE_START_TIME=12:00 _APP_MAINTENANCE_RETENTION_CACHE=2592000 _APP_MAINTENANCE_RETENTION_EXECUTION=1209600 _APP_MAINTENANCE_RETENTION_ABUSE=86400 diff --git a/app/cli.php b/app/cli.php index d1e439cac4..0f0e48bf7d 100644 --- a/app/cli.php +++ b/app/cli.php @@ -10,6 +10,7 @@ use Appwrite\Event\StatsUsage; use Appwrite\Platform\Appwrite; use Appwrite\Runtimes\Runtimes; use Executor\Executor; +use Swoole\Timer; use Utopia\Cache\Adapter\Sharding; use Utopia\Cache\Cache; use Utopia\CLI\CLI; @@ -25,6 +26,9 @@ use Utopia\Pools\Group; use Utopia\Queue\Publisher; use Utopia\Registry\Registry; use Utopia\System\System; +use Utopia\Telemetry\Adapter\None as NoTelemetry; + +use function Swoole\Coroutine\run; // overwriting runtimes to be architecture agnostic for CLI Config::setParam('runtimes', (new Runtimes('v5'))->getAll(supported: false)); @@ -199,7 +203,7 @@ CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { }; }, ['pools', 'cache']); -CLI::setResource('queueForStatsUsage', function (Connection $publisher) { +CLI::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); CLI::setResource('queueForStatsResources', function (Publisher $publisher) { @@ -263,6 +267,8 @@ CLI::setResource('logError', function (Registry $register) { CLI::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST'))); +CLI::setResource('telemetry', fn () => new NoTelemetry()); + $platform = new Appwrite(); $args = $platform->getEnv('argv'); @@ -286,6 +292,10 @@ $cli 'Task', $taskName, ]); + + Timer::clearAll(); }); -$cli->run(); +$cli->shutdown()->action(fn () => Timer::clearAll()); + +run($cli->run(...)); diff --git a/app/config/collections/common.php b/app/config/collections/common.php index 060052c920..2bde67452e 100644 --- a/app/config/collections/common.php +++ b/app/config/collections/common.php @@ -2381,6 +2381,20 @@ return [ 'lengths' => [], 'orders' => [], ], + [ + '$id' => ID::custom('_key_expired'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['expired'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_session_internal_id'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['sessionInternalId'], + 'lengths' => [], + 'orders' => [], + ], ], ], diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index 3fba6a46f6..84f0731443 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -367,7 +367,21 @@ return [ 'attributes' => ['pingedAt'], 'lengths' => [], 'orders' => [], - ] + ], + [ + '$id' => ID::custom('_key_database'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['database'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_region_accessed_at'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['region', 'accessedAt'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -491,6 +505,20 @@ return [ 'lengths' => [], 'orders' => [], ], + [ + '$id' => ID::custom('_key_project_id_region'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectId', 'region'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_region_rt_active'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['region', 'resourceType', 'active'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -1389,6 +1417,13 @@ return [ 'lengths' => [16], 'orders' => [Database::ORDER_ASC], ], + [ + '$id' => ID::custom('_key_piid_riid_rt'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId', 'deploymentInternalId', 'deploymentResourceType'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -1684,7 +1719,14 @@ return [ 'attributes' => ['resourceType'], 'lengths' => [Database::LENGTH_KEY], 'orders' => [Database::ORDER_ASC], - ] + ], + [ + '$id' => ID::custom('_key_piid_riid_rt'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId', 'resourceInternalId', 'resourceType'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -1832,6 +1874,13 @@ return [ 'lengths' => [Database::LENGTH_KEY], 'orders' => [Database::ORDER_ASC], ], + [ + '$id' => ID::custom('_key_piid_prid_rt'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId', 'providerRepositoryId'], + 'lengths' => [], + 'orders' => [], + ], ], ], diff --git a/app/config/collections/projects.php b/app/config/collections/projects.php index fb090099f5..48a0938a1c 100644 --- a/app/config/collections/projects.php +++ b/app/config/collections/projects.php @@ -1809,6 +1809,13 @@ return [ 'lengths' => [], 'orders' => [], ], + [ + '$id' => ID::custom('_key_resource_internal_id'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceInternalId'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -2073,6 +2080,13 @@ return [ 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], + [ + '$id' => ID::custom('_key_function_internal_id'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceInternalId'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -2202,6 +2216,13 @@ return [ 'lengths' => [], 'orders' => [], ], + [ + '$id' => ID::custom('_key_resource_internal_id_resource_type'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceInternalId', 'resourceType'], + 'lengths' => [], + 'orders' => [], + ], ], ], diff --git a/app/config/errors.php b/app/config/errors.php index 9d30170c2d..6d9d29a8ea 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -81,7 +81,7 @@ return [ ], Exception::GENERAL_ROUTE_NOT_FOUND => [ 'name' => Exception::GENERAL_ROUTE_NOT_FOUND, - 'description' => 'The requested route was not found. Please refer to the API docs and try again.', + 'description' => 'Route not found. Please ensure the endpoint is configured correctly and that the API route is valid for this SDK version. Refer to the API docs for more details.', 'code' => 404, ], Exception::GENERAL_CURSOR_NOT_FOUND => [ @@ -499,6 +499,11 @@ return [ 'description' => 'The requested file token has expired.', 'code' => 401, ], + Exception::TOKEN_RESOURCE_TYPE_INVALID => [ + 'name' => Exception::TOKEN_RESOURCE_TYPE_INVALID, + 'description' => 'The resource type for the token is invalid.', + 'code' => 400, + ], /** VCS */ Exception::INSTALLATION_NOT_FOUND => [ diff --git a/app/config/frameworks.php b/app/config/frameworks.php index afdf96145e..f4d8ec7ffa 100644 --- a/app/config/frameworks.php +++ b/app/config/frameworks.php @@ -253,13 +253,30 @@ return [ 'adapters' => [ 'static' => [ 'key' => 'static', - 'buildCommand' => 'flutter build web', - 'installCommand' => '', + 'buildCommand' => 'flutter build web --release -t lib/main.dart', + 'installCommand' => 'flutter pub get', 'outputDirectory' => './build/web', 'startCommand' => 'bash helpers/server.sh', ], ], ], + 'react-native' => [ + 'key' => 'react-native', + 'name' => 'React Native', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'bash helpers/server.sh', + 'fallbackFile' => 'index.html' + ] + ] + ], 'vite' => [ 'key' => 'vite', 'name' => 'Vite', diff --git a/app/config/locale/templates/email-base-styled.tpl b/app/config/locale/templates/email-base-styled.tpl index 4d6972389e..f6d3e8cd63 100644 --- a/app/config/locale/templates/email-base-styled.tpl +++ b/app/config/locale/templates/email-base-styled.tpl @@ -79,7 +79,7 @@