diff --git a/.env b/.env index 1947ddff1a..1ca5d5fc4e 100644 --- a/.env +++ b/.env @@ -26,7 +26,7 @@ _APP_DNS=172.16.238.100 # CoreDNS _APP_DOMAIN=appwrite.test _APP_CONSOLE_DOMAIN=localhost _APP_DOMAIN_FUNCTIONS=functions.localhost -_APP_DOMAIN_SITES=sites.localhost +_APP_DOMAIN_SITES=sites.localhost,rebranded.localhost _APP_DOMAIN_TARGET_CNAME=cname.localhost _APP_DOMAIN_TARGET_A=203.0.0.1 _APP_DOMAIN_TARGET_AAAA=::1 @@ -102,7 +102,7 @@ _APP_USAGE_AGGREGATION_INTERVAL=30 _APP_STATS_RESOURCES_INTERVAL=30 _APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000 _APP_MAINTENANCE_RETENTION_SCHEDULES=86400 -_APP_INTERVAL_DOMAIN_VERIFICATION=60 +_APP_INTERVAL_DOMAIN_VERIFICATION=120 _APP_INTERVAL_CLEANUP_STALE_EXECUTIONS=300 _APP_USAGE_STATS=enabled _APP_LOGGING_CONFIG= @@ -130,3 +130,4 @@ _APP_PROJECT_REGIONS=default _APP_FUNCTIONS_CREATION_ABUSE_LIMIT=5000 _APP_STATS_USAGE_DUAL_WRITING_DBS=database_db_main _APP_TRUSTED_HEADERS=x-forwarded-for +_APP_POOL_ADAPTER=stack \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index ac8cff0884..e848b6f0b5 100755 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \ --no-plugins --no-scripts --prefer-dist \ `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` -FROM appwrite/base:0.10.6 AS base +FROM appwrite/base:0.11.5 AS base LABEL maintainer="team@appwrite.io" diff --git a/app/cli.php b/app/cli.php index 4b85ba35c6..af67f4e0e6 100644 --- a/app/cli.php +++ b/app/cli.php @@ -30,6 +30,9 @@ use Utopia\Pools\Group; use Utopia\Queue\Broker\Pool as BrokerPool; use Utopia\Queue\Publisher; use Utopia\Registry\Registry; +use Utopia\Span\Exporter; +use Utopia\Span\Span; +use Utopia\Span\Storage; use Utopia\System\System; use Utopia\Telemetry\Adapter\None as NoTelemetry; @@ -325,4 +328,6 @@ $cli $cli->shutdown()->action(fn () => Timer::clearAll()); Runtime::enableCoroutine(SWOOLE_HOOK_ALL); +Span::setStorage(new Storage\Coroutine()); +Span::addExporter(new Exporter\Stdout()); run($cli->run(...)); diff --git a/app/config/collections.php b/app/config/collections.php index 533dee57a8..a74e079dce 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -26,8 +26,8 @@ unset($common['files']); $collections = [ 'buckets' => $buckets, 'databases' => $databases, - 'projects' => array_merge($projects, $common), - 'console' => array_merge($platform, $common), + 'projects' => array_merge_recursive($projects, $common), + 'console' => array_merge_recursive($platform, $common), 'logs' => $logs, ]; diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index 8e214e7999..2fb3168c5b 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -633,29 +633,7 @@ $platformCollections = [ 'name' => 'keys', 'attributes' => [ [ - '$id' => ID::custom('projectInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('projectId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => 0, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => 'resourceType', + '$id' => ID::custom('resourceType'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, @@ -666,7 +644,7 @@ $platformCollections = [ 'filters' => [], ], [ - '$id' => 'resourceId', + '$id' => ID::custom('resourceId'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, @@ -677,7 +655,7 @@ $platformCollections = [ 'filters' => [], ], [ - '$id' => 'resourceInternalId', + '$id' => ID::custom('resourceInternalId'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, @@ -756,21 +734,14 @@ $platformCollections = [ ], 'indexes' => [ [ - '$id' => ID::custom('_key_project'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => '_key_resource', + '$id' => ID::custom('_key_resource'), 'type' => Database::INDEX_KEY, 'attributes' => ['resourceType', 'resourceInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], [ - '$id' => '_key_accessedAt', + '$id' => ID::custom('_key_accessedAt'), 'type' => Database::INDEX_KEY, 'attributes' => ['accessedAt'], 'lengths' => [], diff --git a/app/config/errors.php b/app/config/errors.php index e01d9064bf..62affd8101 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -357,6 +357,11 @@ return [ 'description' => 'API key and session used in the same request. Use either `setSession` or `setKey`. Learn about which authentication method to use in the SSR docs: https://appwrite.io/docs/products/auth/server-side-rendering', 'code' => 403, ], + Exception::USER_JWT_AND_COOKIE_SET => [ + 'name' => Exception::USER_JWT_AND_COOKIE_SET, + 'description' => 'JWT and cookie used in the same request. Use either `setJWT` or `setCookie`. Learn about which authentication method to use in the SSR docs: https://appwrite.io/docs/products/auth/server-side-rendering', + 'code' => 403, + ], Exception::API_KEY_EXPIRED => [ 'name' => Exception::API_KEY_EXPIRED, 'description' => 'The dynamic API key has expired. Please don\'t use dynamic API keys for more than duration of the execution.', @@ -1074,6 +1079,11 @@ return [ 'description' => 'The project key has expired. Please generate a new key using the Appwrite console.', 'code' => 401, ], + Exception::ACCOUNT_KEY_EXPIRED => [ + 'name' => Exception::ACCOUNT_KEY_EXPIRED, + 'description' => 'The account API key has expired. Please generate a new key using the Appwrite console.', + 'code' => 401, + ], Exception::ROUTER_HOST_NOT_FOUND => [ 'name' => Exception::ROUTER_HOST_NOT_FOUND, 'description' => 'Host is not trusted. This could occur because you have not configured a custom domain. Add a custom domain to your project first and try again.', @@ -1328,4 +1338,19 @@ return [ 'description' => 'Target has an invalid provider type.', 'code' => 400, ], + Exception::USER_ID_MISSING => [ + 'name' => Exception::USER_ID_MISSING, + 'description' => 'When using account API key, make sure to pass x-appwrite-user header with your user ID.', + 'code' => 403, + ], + Exception::ORGANIZATION_ID_MISSING => [ + 'name' => Exception::ORGANIZATION_ID_MISSING, + 'description' => 'When using organization API key, make sure to pass x-appwrite-organization header with your organization ID.', + 'code' => 403, + ], + Exception::PROJECT_ID_MISSING => [ + 'name' => Exception::PROJECT_ID_MISSING, + 'description' => 'When using project API key, make sure to pass x-appwrite-project header with your project ID.', + 'code' => 403, + ], ]; diff --git a/app/config/locale/templates/email-base.tpl b/app/config/locale/templates/email-base.tpl index 338cc51252..312632a34a 100644 --- a/app/config/locale/templates/email-base.tpl +++ b/app/config/locale/templates/email-base.tpl @@ -50,17 +50,12 @@ font-style: normal; font-display: swap; } - - @font-face { - font-family: 'Poppins'; - src: url('https://assets.appwrite.io/fonts/poppins/poppins-v23-latin-regular.woff2') format('woff2'); - font-weight: 400; - font-style: normal; - font-display: swap; - }