diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 095449de2..899c27a13 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -18,6 +18,10 @@ jobs: - run: git checkout HEAD^2 + - name: Validate composer.json and composer.lock + run: | + docker run --rm -v $PWD:/app composer sh -c \ + "composer validate" - name: Run Linter run: | docker run --rm -v $PWD:/app composer sh -c \ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 14e1ac5e4..9c9b67830 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -75,8 +75,32 @@ jobs: - name: Run Unit Tests run: docker compose exec appwrite test /usr/src/code/tests/unit - e2e_test: - name: E2E Test + e2e_general_test: + name: E2E General Test + runs-on: ubuntu-latest + needs: setup + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: Load Cache + uses: actions/cache@v3 + with: + key: ${{ env.CACHE_KEY }} + path: /tmp/${{ env.IMAGE }}.tar + fail-on-cache-miss: true + + - name: Load and Start Appwrite + run: | + docker load --input /tmp/${{ env.IMAGE }}.tar + docker compose up -d + sleep 10 + + - name: Run General Tests + run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/General --debug + + e2e_service_test: + name: E2E Service Test runs-on: ubuntu-latest needs: setup strategy: @@ -120,4 +144,4 @@ jobs: sleep 10 - name: Run ${{matrix.service}} Tests - run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.service}} --debug \ No newline at end of file + run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.service}} --debug diff --git a/.gitmodules b/.gitmodules index af1212435..0c2321bcf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "app/console"] path = app/console url = https://github.com/appwrite/console - branch = 3.2.7 + branch = 3.2.16 diff --git a/CHANGES.md b/CHANGES.md index fbe1e548d..5634340d6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,21 @@ +# Version 1.4.13 + +## Notable changes + +* Change enum size validation in update controller [#7164](https://github.com/appwrite/appwrite/pull/7164) +* Bump console to version 3.2.8 in [#7167](https://github.com/appwrite/appwrite/pull/7167) + +## Bug fixes + +* Fix error after adding bigger enum [#7162](https://github.com/appwrite/appwrite/pull/7162) +* Add chunkId to abuse key to prevent rate limit for SDKs [#7154](https://github.com/appwrite/appwrite/pull/7154) + +## Miscellaneous + +* Fix enum test case [#7163](https://github.com/appwrite/appwrite/pull/7163) +* Add flag to send logs to logger [#7155](https://github.com/appwrite/appwrite/pull/7155) +* Add a CI task to validate composer file and lock [#7142](https://github.com/appwrite/appwrite/pull/7142) + # Version 1.4.12 ## Miscellaneous diff --git a/Dockerfile b/Dockerfile index ee9818f39..190df719b 100755 --- a/Dockerfile +++ b/Dockerfile @@ -71,6 +71,9 @@ RUN mkdir -p /storage/uploads && \ chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \ chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug +# Development Executables +RUN chmod +x /usr/local/bin/dev-generate-translations + # Executables RUN chmod +x /usr/local/bin/doctor && \ chmod +x /usr/local/bin/maintenance && \ @@ -95,7 +98,8 @@ RUN chmod +x /usr/local/bin/doctor && \ chmod +x /usr/local/bin/worker-mails && \ chmod +x /usr/local/bin/worker-messaging && \ chmod +x /usr/local/bin/worker-webhooks && \ - chmod +x /usr/local/bin/worker-migrations + chmod +x /usr/local/bin/worker-migrations && \ + chmod +x /usr/local/bin/worker-hamster # Cloud Executabless RUN chmod +x /usr/local/bin/hamster && \ @@ -106,7 +110,8 @@ RUN chmod +x /usr/local/bin/hamster && \ chmod +x /usr/local/bin/delete-orphaned-projects && \ chmod +x /usr/local/bin/clear-card-cache && \ chmod +x /usr/local/bin/calc-users-stats && \ - chmod +x /usr/local/bin/calc-tier-stats + chmod +x /usr/local/bin/calc-tier-stats && \ + chmod +x /usr/local/bin/get-migration-stats # Letsencrypt Permissions RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/ diff --git a/README-CN.md b/README-CN.md index 8e4695e60..0ce27a003 100644 --- a/README-CN.md +++ b/README-CN.md @@ -66,7 +66,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.4.12 + appwrite/appwrite:1.4.13 ``` ### Windows @@ -78,7 +78,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.4.12 + appwrite/appwrite:1.4.13 ``` #### PowerShell @@ -88,7 +88,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.4.12 + appwrite/appwrite:1.4.13 ``` 运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。 diff --git a/README.md b/README.md index 3a1d2dbe9..62b084d32 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.4.12 + appwrite/appwrite:1.4.13 ``` ### Windows @@ -88,7 +88,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.4.12 + appwrite/appwrite:1.4.13 ``` #### PowerShell @@ -98,7 +98,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.4.12 + appwrite/appwrite:1.4.13 ``` Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation. diff --git a/app/cli.php b/app/cli.php index 643a615c4..003f3a1f7 100644 --- a/app/cli.php +++ b/app/cli.php @@ -6,6 +6,7 @@ require_once __DIR__ . '/controllers/general.php'; use Appwrite\Event\Delete; use Appwrite\Event\Certificate; use Appwrite\Event\Func; +use Appwrite\Event\Hamster; use Appwrite\Platform\Appwrite; use Utopia\CLI\CLI; use Utopia\Database\Validator\Authorization; @@ -154,6 +155,9 @@ CLI::setResource('queue', function (Group $pools) { CLI::setResource('queueForFunctions', function (Connection $queue) { return new Func($queue); }, ['queue']); +CLI::setResource('queueForHamster', function (Connection $queue) { + return new Hamster($queue); +}, ['queue']); CLI::setResource('queueForDeletes', function (Connection $queue) { return new Delete($queue); }, ['queue']); diff --git a/app/config/collections.php b/app/config/collections.php index 913de3e06..a2af46293 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -1777,6 +1777,28 @@ $commonCollections = [ 'array' => false, 'filters' => [], ], + [ + '$id' => ID::custom('userId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('userInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], [ '$id' => ID::custom('topicId'), 'type' => Database::VAR_STRING, @@ -1799,6 +1821,17 @@ $commonCollections = [ 'array' => false, 'filters' => [], ], + [ + '$id' => ID::custom('providerType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], ], 'indexes' => [ [ @@ -1815,6 +1848,20 @@ $commonCollections = [ 'lengths' => [], 'orders' => [], ], + [ + '$id' => ID::custom('_key_userId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userId'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_userInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userInternalId'], + 'lengths' => [], + 'orders' => [], + ], [ '$id' => ID::custom('_key_topicId'), 'type' => Database::INDEX_KEY, diff --git a/app/config/errors.php b/app/config/errors.php index 3c0b67c76..2e35bfb88 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -219,6 +219,7 @@ return [ 'name' => Exception::USER_AUTH_METHOD_UNSUPPORTED, 'description' => 'The requested authentication method is either disabled or unsupported. Please check the supported authentication methods in the Appwrite console.', 'code' => 501, + 'publish' => false, ], Exception::USER_PHONE_ALREADY_EXISTS => [ 'name' => Exception::USER_PHONE_ALREADY_EXISTS, @@ -785,7 +786,15 @@ return [ 'code' => 400, ], - /** Provider Errors */ + /** Health */ + Exception::QUEUE_SIZE_EXCEEDED => [ + 'name' => Exception::QUEUE_SIZE_EXCEEDED, + 'description' => 'Queue size threshold hit.', + 'code' => 503, + 'publish' => false + ], + + /** Providers */ Exception::PROVIDER_NOT_FOUND => [ 'name' => Exception::PROVIDER_NOT_FOUND, 'description' => 'Provider with the requested ID could not be found.', @@ -802,7 +811,7 @@ return [ 'code' => 400, ], - /** Topic Errors */ + /** Topics */ Exception::TOPIC_NOT_FOUND => [ 'name' => Exception::TOPIC_NOT_FOUND, 'description' => 'Topic with the request ID could not be found.', @@ -814,7 +823,7 @@ return [ 'code' => 409, ], - /** Subscriber Errors */ + /** Subscribers */ Exception::SUBSCRIBER_NOT_FOUND => [ 'name' => Exception::SUBSCRIBER_NOT_FOUND, 'description' => 'Subscriber with the request ID could not be found.', @@ -826,7 +835,7 @@ return [ 'code' => 409, ], - /** Message Errors */ + /** Messages */ Exception::MESSAGE_NOT_FOUND => [ 'name' => Exception::MESSAGE_NOT_FOUND, 'description' => 'Message with the requested ID could not be found.', @@ -847,5 +856,20 @@ return [ 'description' => 'Message with the requested ID has already been scheduled for delivery.', 'code' => 400, ], + Exception::MESSAGE_TARGET_NOT_EMAIL => [ + 'name' => Exception::MESSAGE_TARGET_NOT_EMAIL, + 'description' => 'Message with the target ID is not an email target:', + 'code' => 400, + ], + Exception::MESSAGE_TARGET_NOT_SMS => [ + 'name' => Exception::MESSAGE_TARGET_NOT_SMS, + 'description' => 'Message with the target ID is not an SMS target:', + 'code' => 400, + ], + Exception::MESSAGE_TARGET_NOT_PUSH => [ + 'name' => Exception::MESSAGE_TARGET_NOT_PUSH, + 'description' => 'Message with the target ID is not a push target:', + 'code' => 400, + ], ]; diff --git a/app/config/locale/templates/email-base.tpl b/app/config/locale/templates/email-base.tpl index f41a9530e..346f2f158 100644 --- a/app/config/locale/templates/email-base.tpl +++ b/app/config/locale/templates/email-base.tpl @@ -8,13 +8,13 @@ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@500;600&display=swap" rel="stylesheet">