From 6813d53e0669c0df55e8d0193623fda9a4242b1e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 25 May 2023 00:32:49 +0000 Subject: [PATCH 01/17] remove password required for project deletion --- app/controllers/api/projects.php | 6 ------ tests/e2e/Services/Projects/ProjectsConsoleClientTest.php | 8 +++----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 0baff3726a..ff9d544bfb 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -684,17 +684,11 @@ App::delete('/v1/projects/:projectId') ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) ->label('sdk.response.model', Response::MODEL_NONE) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('password', '', new Password(), 'Your user password for confirmation. Must be at least 8 chars.') ->inject('response') ->inject('user') ->inject('dbForConsole') ->inject('deletes') ->action(function (string $projectId, string $password, Response $response, Document $user, Database $dbForConsole, Delete $deletes) { - - if (!Auth::passwordVerify($password, $user->getAttribute('password'), $user->getAttribute('hash'), $user->getAttribute('hashOptions'))) { // Double check user password - throw new Exception(Exception::USER_INVALID_CREDENTIALS); - } - $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 42b18918af..0041f1ce3a 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -2997,15 +2997,13 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $project['headers']['status-code']); - // Delete team + // Delete Project $team = $this->client->call(Client::METHOD_DELETE, '/projects/' . $projectId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'password' => 'password' - ]); + ], $this->getHeaders())); - $this->assertEquals(204, $team['headers']['status-code']); + $this->assertEquals(204, $project['headers']['status-code']); // Ensure I can get team but not a project $team = $this->client->call(Client::METHOD_GET, '/teams/' . $teamId, array_merge([ From 6c38bcc2702bf5f838d52681d8fdae1a49f475cd Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 25 May 2023 01:26:13 +0000 Subject: [PATCH 02/17] fix typo --- tests/e2e/Services/Projects/ProjectsConsoleClientTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 0041f1ce3a..5b333425b0 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -2998,7 +2998,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $project['headers']['status-code']); // Delete Project - $team = $this->client->call(Client::METHOD_DELETE, '/projects/' . $projectId, array_merge([ + $project = $this->client->call(Client::METHOD_DELETE, '/projects/' . $projectId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); From 237658f4e80564b6f6d8a0358213d53c046bc0c8 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 25 May 2023 05:33:06 +0000 Subject: [PATCH 03/17] fix param --- app/controllers/api/projects.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index ff9d544bfb..90aefbf809 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -688,7 +688,7 @@ App::delete('/v1/projects/:projectId') ->inject('user') ->inject('dbForConsole') ->inject('deletes') - ->action(function (string $projectId, string $password, Response $response, Document $user, Database $dbForConsole, Delete $deletes) { + ->action(function (string $projectId, Response $response, Document $user, Database $dbForConsole, Delete $deletes) { $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { From a6643635251152840387337396bb6bdc904617a8 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 2 Jun 2023 12:58:31 +0200 Subject: [PATCH 04/17] fix: trailing wildcards --- app/controllers/general.php | 2 +- app/controllers/web/console.php | 2 +- composer.lock | 51 +++++++++++++++++---------------- tests/e2e/General/HTTPTest.php | 5 ++-- 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 00d5c6347f..1982ea0d7f 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -584,7 +584,7 @@ App::get('/humans.txt') $response->text($template->render(false)); }); -App::get('/.well-known/acme-challenge') +App::get('/.well-known/acme-challenge/*') ->desc('SSL Verification') ->label('scope', 'public') ->label('docs', false) diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index 8115f09285..fa4f76a9d0 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -3,7 +3,7 @@ use Appwrite\Utopia\Response; use Utopia\App; -App::get('/console') +App::get('/console/*') ->alias('/') ->alias('/invite') ->alias('/login') diff --git a/composer.lock b/composer.lock index 3531381c10..99273a9386 100644 --- a/composer.lock +++ b/composer.lock @@ -1652,16 +1652,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.1", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { @@ -1670,7 +1670,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -1699,7 +1699,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" }, "funding": [ { @@ -1715,7 +1715,7 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:25:55+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/polyfill-php80", @@ -2218,16 +2218,16 @@ }, { "name": "utopia-php/framework", - "version": "0.28.2", + "version": "0.28.3", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "bc0144ff3983afa6724c43f2ce578fdbceec21f9" + "reference": "9b6171eeb99a2f0a550f51526d583e012dfac4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/bc0144ff3983afa6724c43f2ce578fdbceec21f9", - "reference": "bc0144ff3983afa6724c43f2ce578fdbceec21f9", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/9b6171eeb99a2f0a550f51526d583e012dfac4e9", + "reference": "9b6171eeb99a2f0a550f51526d583e012dfac4e9", "shasum": "" }, "require": { @@ -2257,9 +2257,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.28.2" + "source": "https://github.com/utopia-php/framework/tree/0.28.3" }, - "time": "2023-05-30T06:47:57+00:00" + "time": "2023-06-02T10:57:17+00:00" }, { "name": "utopia-php/image", @@ -3656,16 +3656,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.1", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "dfc078e8af9c99210337325ff5aa152872c98714" + "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dfc078e8af9c99210337325ff5aa152872c98714", - "reference": "dfc078e8af9c99210337325ff5aa152872c98714", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b2fe4d22a5426f38e014855322200b97b5362c0d", + "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d", "shasum": "" }, "require": { @@ -3708,9 +3708,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.2" }, - "time": "2023-03-27T19:02:04+00:00" + "time": "2023-05-30T18:13:47+00:00" }, { "name": "phpspec/prophecy", @@ -3782,22 +3782,23 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.21.3", + "version": "1.22.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "b0c366dd2cea79407d635839d25423ba07c55dd6" + "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/b0c366dd2cea79407d635839d25423ba07c55dd6", - "reference": "b0c366dd2cea79407d635839d25423ba07c55dd6", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", + "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { + "doctrine/annotations": "^2.0", "nikic/php-parser": "^4.15", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", @@ -3822,9 +3823,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.21.3" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.0" }, - "time": "2023-05-29T19:31:28+00:00" + "time": "2023-06-01T12:35:21+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/tests/e2e/General/HTTPTest.php b/tests/e2e/General/HTTPTest.php index 09a7048eef..608afdccd3 100644 --- a/tests/e2e/General/HTTPTest.php +++ b/tests/e2e/General/HTTPTest.php @@ -77,8 +77,8 @@ class HTTPTest extends Scope 'origin' => 'http://localhost', ])); - $this->assertEquals(404, $response['headers']['status-code']); // 'Unknown path', but validation passed + $this->assertEquals(404, $response['headers']['status-code']); /** * Test for FAILURE @@ -87,7 +87,8 @@ class HTTPTest extends Scope 'origin' => 'http://localhost', ])); - $this->assertEquals(404, $response['headers']['status-code']); + // Check for too many path segments + $this->assertEquals(400, $response['headers']['status-code']); // Cleanup $this->client->setEndpoint($previousEndpoint); From 21b41c475dde1e768ea3df15bafa6cdedf1b2d30 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 2 Jun 2023 14:26:51 +0200 Subject: [PATCH 05/17] chore: prepre 1.3.6 --- CHANGES.md | 7 +++++++ README-CN.md | 6 +++--- README.md | 6 +++--- app/init.php | 4 ++-- docker-compose.yml | 18 +++++++++--------- src/Appwrite/Migration/Migration.php | 1 + 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8c6e7120b7..d1fe64df33 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,10 @@ +# Version 1.3.6 + +## Bugs + +- Fix Console deep linking to result in a 404 [#5632](https://github.com/appwrite/appwrite/pull/5632) +- Fix ACME HTTP Challenge [#5632](https://github.com/appwrite/appwrite/pull/5632) + # Version 1.3.5 ## Bugs diff --git a/README-CN.md b/README-CN.md index 1aa4b7011a..bf0a73adaf 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.3.5 + appwrite/appwrite:1.3.6 ``` ### 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.3.5 + appwrite/appwrite:1.3.6 ``` #### 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.3.5 + appwrite/appwrite:1.3.6 ``` 运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。 diff --git a/README.md b/README.md index bbaaba2311..45caeaa564 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,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.3.5 + appwrite/appwrite:1.3.6 ``` ### Windows @@ -87,7 +87,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.3.5 + appwrite/appwrite:1.3.6 ``` #### PowerShell @@ -97,7 +97,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.3.5 + appwrite/appwrite:1.3.6 ``` 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/init.php b/app/init.php index d959cf24b5..5eb7f67aa3 100644 --- a/app/init.php +++ b/app/init.php @@ -100,8 +100,8 @@ const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate pe const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours -const APP_CACHE_BUSTER = 504; -const APP_VERSION_STABLE = '1.3.5'; +const APP_CACHE_BUSTER = 505; +const APP_VERSION_STABLE = '1.3.6'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; const APP_DATABASE_ATTRIBUTE_IP = 'ip'; diff --git a/docker-compose.yml b/docker-compose.yml index ecb10b9eea..b028bd8544 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -773,15 +773,15 @@ services: networks: - appwrite - # redis-commander: - # image: rediscommander/redis-commander:latest - # restart: unless-stopped - # networks: - # - appwrite - # environment: - # - REDIS_HOSTS=redis - # ports: - # - "8081:8081" + redis-commander: + image: rediscommander/redis-commander:latest + restart: unless-stopped + networks: + - appwrite + environment: + - REDIS_HOSTS=redis + ports: + - "8081:8081" # resque: # image: appwrite/resque-web:1.1.0 diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index dd57e3e81d..b205fdc55a 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -61,6 +61,7 @@ abstract class Migration '1.3.3' => 'V18', '1.3.4' => 'V18', '1.3.5' => 'V18', + '1.3.6' => 'V18', ]; /** From 92cda20448087e9804540dd282325e99ea3186a0 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 2 Jun 2023 14:29:44 +0200 Subject: [PATCH 06/17] chore: revert docker compose changes --- docker-compose.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b028bd8544..ecb10b9eea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -773,15 +773,15 @@ services: networks: - appwrite - redis-commander: - image: rediscommander/redis-commander:latest - restart: unless-stopped - networks: - - appwrite - environment: - - REDIS_HOSTS=redis - ports: - - "8081:8081" + # redis-commander: + # image: rediscommander/redis-commander:latest + # restart: unless-stopped + # networks: + # - appwrite + # environment: + # - REDIS_HOSTS=redis + # ports: + # - "8081:8081" # resque: # image: appwrite/resque-web:1.1.0 From bd6b0dcc431ea8002d667ffe5e9740359afc6b54 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Fri, 2 Jun 2023 14:22:28 -0700 Subject: [PATCH 07/17] Fix the routing for the default OAuth2 pages --- app/controllers/web/console.php | 3 ++- tests/e2e/General/HTTPTest.php | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index fa4f76a9d0..59aad607c1 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -5,10 +5,11 @@ use Utopia\App; App::get('/console/*') ->alias('/') + ->alias('auth/*') ->alias('/invite') ->alias('/login') ->alias('/recover') - ->alias('/register') + ->alias('/register/*') ->groups(['web']) ->label('permission', 'public') ->label('scope', 'home') diff --git a/tests/e2e/General/HTTPTest.php b/tests/e2e/General/HTTPTest.php index 608afdccd3..087b984f9d 100644 --- a/tests/e2e/General/HTTPTest.php +++ b/tests/e2e/General/HTTPTest.php @@ -160,4 +160,15 @@ class HTTPTest extends Scope $this->assertIsString($body['server-ruby']); $this->assertIsString($body['console-cli']); } + + public function testDefaultOAuth2() + { + $response = $this->client->call(Client::METHOD_GET, '/auth/oauth2/success', $this->getHeaders()); + + $this->assertEquals(200, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_GET, '/auth/oauth2/failure', $this->getHeaders()); + + $this->assertEquals(200, $response['headers']['status-code']); + } } From 092f0cfcaf6ef733cf6de579f4997b59ebcf6802 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Fri, 2 Jun 2023 14:22:28 -0700 Subject: [PATCH 08/17] Fix the routing for the default OAuth2 pages --- app/controllers/web/console.php | 3 ++- tests/e2e/General/HTTPTest.php | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index fa4f76a9d0..59aad607c1 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -5,10 +5,11 @@ use Utopia\App; App::get('/console/*') ->alias('/') + ->alias('auth/*') ->alias('/invite') ->alias('/login') ->alias('/recover') - ->alias('/register') + ->alias('/register/*') ->groups(['web']) ->label('permission', 'public') ->label('scope', 'home') diff --git a/tests/e2e/General/HTTPTest.php b/tests/e2e/General/HTTPTest.php index 608afdccd3..087b984f9d 100644 --- a/tests/e2e/General/HTTPTest.php +++ b/tests/e2e/General/HTTPTest.php @@ -160,4 +160,15 @@ class HTTPTest extends Scope $this->assertIsString($body['server-ruby']); $this->assertIsString($body['console-cli']); } + + public function testDefaultOAuth2() + { + $response = $this->client->call(Client::METHOD_GET, '/auth/oauth2/success', $this->getHeaders()); + + $this->assertEquals(200, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_GET, '/auth/oauth2/failure', $this->getHeaders()); + + $this->assertEquals(200, $response['headers']['status-code']); + } } From 8b01c61de3fbfe058a8da36f280c7e81041303a5 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 3 Jun 2023 19:33:51 +0530 Subject: [PATCH 09/17] chore: update utopia-php/framework --- .github/workflows/build-cloud.yml | 53 +++++++++++++++++++++++++++++++ app/console | 2 +- composer.lock | 34 +++++++++++--------- 3 files changed, 73 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/build-cloud.yml diff --git a/.github/workflows/build-cloud.yml b/.github/workflows/build-cloud.yml new file mode 100644 index 0000000000..f4158a3180 --- /dev/null +++ b/.github/workflows/build-cloud.yml @@ -0,0 +1,53 @@ +name: "Release" + +on: + release: + types: [published] + +jobs: + tests: + name: Release + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + # Fetch submodules + submodules: recursive + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: appwrite/appwrite + tags: | + type=semver,pattern={{major}}.{{minor}}.{{patch}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64,linux/arm64 + build-args: | + VERSION=${{ steps.meta.outputs.version }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/app/console b/app/console index 9174d8f8cb..b981302dee 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 9174d8f8cb584744dd7a53f69d324f490ee82ee3 +Subproject commit b981302dee30eab33e155af79f0088822b29a2b6 diff --git a/composer.lock b/composer.lock index 99273a9386..f9afb562f7 100644 --- a/composer.lock +++ b/composer.lock @@ -2218,16 +2218,16 @@ }, { "name": "utopia-php/framework", - "version": "0.28.3", + "version": "0.26.3", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "9b6171eeb99a2f0a550f51526d583e012dfac4e9" + "reference": "7a18a2b0d6c8dba878c926b73650fd2c4eeaa70d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/9b6171eeb99a2f0a550f51526d583e012dfac4e9", - "reference": "9b6171eeb99a2f0a550f51526d583e012dfac4e9", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/7a18a2b0d6c8dba878c926b73650fd2c4eeaa70d", + "reference": "7a18a2b0d6c8dba878c926b73650fd2c4eeaa70d", "shasum": "" }, "require": { @@ -2257,9 +2257,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.28.3" + "source": "https://github.com/utopia-php/framework/tree/0.26.3" }, - "time": "2023-06-02T10:57:17+00:00" + "time": "2023-06-03T14:01:15+00:00" }, { "name": "utopia-php/image", @@ -3083,25 +3083,29 @@ }, { "name": "doctrine/deprecations", - "version": "v1.1.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "8cffffb2218e01f3b370bf763e00e81697725259" + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/8cffffb2218e01f3b370bf763e00e81697725259", - "reference": "8cffffb2218e01f3b370bf763e00e81697725259", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -3120,9 +3124,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.1.0" + "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" }, - "time": "2023-05-29T18:55:17+00:00" + "time": "2023-06-03T09:27:29+00:00" }, { "name": "doctrine/instantiator", From 9dee8346370fc758198e9d287bdd87315667c519 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 3 Jun 2023 19:34:49 +0530 Subject: [PATCH 10/17] chore: remove unrelated files --- .github/workflows/build-cloud.yml | 53 ------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 .github/workflows/build-cloud.yml diff --git a/.github/workflows/build-cloud.yml b/.github/workflows/build-cloud.yml deleted file mode 100644 index f4158a3180..0000000000 --- a/.github/workflows/build-cloud.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: "Release" - -on: - release: - types: [published] - -jobs: - tests: - name: Release - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - # Fetch submodules - submodules: recursive - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: appwrite/appwrite - tags: | - type=semver,pattern={{major}}.{{minor}}.{{patch}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - platforms: linux/amd64,linux/arm64 - build-args: | - VERSION=${{ steps.meta.outputs.version }} - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From 329b6b93bfe3ce1d6356ccde06c824e97361b53e Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 3 Jun 2023 20:11:01 +0530 Subject: [PATCH 11/17] chore: update changelog --- CHANGES.md | 9 +++++++++ README-CN.md | 6 +++--- README.md | 6 +++--- app/init.php | 4 ++-- src/Appwrite/Migration/Migration.php | 1 + 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d1fe64df33..990f19db15 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,12 @@ +# Version 1.3.7 + +- Fix the routing for the default OAuth2 pages [#5640](https://github.com/appwrite/appwrite/pull/5640) [#5648](https://github.com/appwrite/appwrite/pull/5648) +- Add support for trailing slashes in Routes and URLs [#5647](https://github.com/appwrite/appwrite/pull/5647) [#5648](https://github.com/appwrite/appwrite/pull/5648) +## Bugs + +- Fix Console deep linking to result in a 404 [#5632](https://github.com/appwrite/appwrite/pull/5632) +- Fix ACME HTTP Challenge [#5632](https://github.com/appwrite/appwrite/pull/5632) + # Version 1.3.6 ## Bugs diff --git a/README-CN.md b/README-CN.md index bf0a73adaf..d3f52058b5 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.3.6 + appwrite/appwrite:1.3.7 ``` ### 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.3.6 + appwrite/appwrite:1.3.7 ``` #### 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.3.6 + appwrite/appwrite:1.3.7 ``` 运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。 diff --git a/README.md b/README.md index 45caeaa564..b8fffd110a 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,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.3.6 + appwrite/appwrite:1.3.7 ``` ### Windows @@ -87,7 +87,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.3.6 + appwrite/appwrite:1.3.7 ``` #### PowerShell @@ -97,7 +97,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.3.6 + appwrite/appwrite:1.3.7 ``` 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/init.php b/app/init.php index 5eb7f67aa3..0b6efe52c0 100644 --- a/app/init.php +++ b/app/init.php @@ -100,8 +100,8 @@ const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate pe const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours -const APP_CACHE_BUSTER = 505; -const APP_VERSION_STABLE = '1.3.6'; +const APP_CACHE_BUSTER = 506; +const APP_VERSION_STABLE = '1.3.7'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; const APP_DATABASE_ATTRIBUTE_IP = 'ip'; diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index b205fdc55a..7a1f3cad24 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -62,6 +62,7 @@ abstract class Migration '1.3.4' => 'V18', '1.3.5' => 'V18', '1.3.6' => 'V18', + '1.3.7' => 'V18', ]; /** From 9dcf164b2fbae7a23b02e46fe6f5b9f3bd776cdb Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 3 Jun 2023 20:14:11 +0530 Subject: [PATCH 12/17] chore: update composer --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index f9afb562f7..a261c416e7 100644 --- a/composer.lock +++ b/composer.lock @@ -2218,16 +2218,16 @@ }, { "name": "utopia-php/framework", - "version": "0.26.3", + "version": "0.28.4", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "7a18a2b0d6c8dba878c926b73650fd2c4eeaa70d" + "reference": "98c5469efe195aeecc63745dbf8e2f357f8cedac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/7a18a2b0d6c8dba878c926b73650fd2c4eeaa70d", - "reference": "7a18a2b0d6c8dba878c926b73650fd2c4eeaa70d", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/98c5469efe195aeecc63745dbf8e2f357f8cedac", + "reference": "98c5469efe195aeecc63745dbf8e2f357f8cedac", "shasum": "" }, "require": { @@ -2257,9 +2257,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.26.3" + "source": "https://github.com/utopia-php/framework/tree/0.28.4" }, - "time": "2023-06-03T14:01:15+00:00" + "time": "2023-06-03T14:09:22+00:00" }, { "name": "utopia-php/image", From a68f0826e78b2c543177f50009b2112bb5a5a0f1 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 3 Jun 2023 20:14:44 +0530 Subject: [PATCH 13/17] chore: update changelog --- CHANGES.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 990f19db15..abe1dacac1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,11 +1,8 @@ # Version 1.3.7 +## Bugs - Fix the routing for the default OAuth2 pages [#5640](https://github.com/appwrite/appwrite/pull/5640) [#5648](https://github.com/appwrite/appwrite/pull/5648) - Add support for trailing slashes in Routes and URLs [#5647](https://github.com/appwrite/appwrite/pull/5647) [#5648](https://github.com/appwrite/appwrite/pull/5648) -## Bugs - -- Fix Console deep linking to result in a 404 [#5632](https://github.com/appwrite/appwrite/pull/5632) -- Fix ACME HTTP Challenge [#5632](https://github.com/appwrite/appwrite/pull/5632) # Version 1.3.6 From 596998000b76407aaaced89a5ca72341839b7039 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 3 Jun 2023 20:15:40 +0530 Subject: [PATCH 14/17] chore: update console --- app/console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/console b/app/console index b981302dee..9174d8f8cb 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit b981302dee30eab33e155af79f0088822b29a2b6 +Subproject commit 9174d8f8cb584744dd7a53f69d324f490ee82ee3 From b7f4f575219a5b9ccd2d09da89e07fe6a61a87c6 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 Jun 2023 13:51:24 +1200 Subject: [PATCH 15/17] Add new error message to differentiate between missing data and missing data + permissions for document updates --- app/config/errors.php | 7 ++++++- app/controllers/api/databases.php | 2 +- src/Appwrite/Extend/Exception.php | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/config/errors.php b/app/config/errors.php index 9fadde6e93..450ea08141 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -403,9 +403,14 @@ return [ 'description' => 'The document structure is invalid. Please ensure the attributes match the collection definition.', 'code' => 400, ], + Exception::DOCUMENT_MISSING_DATA => [ + 'name' => Exception::DOCUMENT_MISSING_DATA, + 'description' => 'The document data is missing.', + 'code' => 400, + ], Exception::DOCUMENT_MISSING_PAYLOAD => [ 'name' => Exception::DOCUMENT_MISSING_PAYLOAD, - 'description' => 'The document payload is missing.', + 'description' => 'The document data or permissions must be provided.', 'code' => 400, ], Exception::DOCUMENT_ALREADY_EXISTS => [ diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index c4ff448ce4..a4de380561 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2653,7 +2653,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array if (empty($data)) { - throw new Exception(Exception::DOCUMENT_MISSING_PAYLOAD); + throw new Exception(Exception::DOCUMENT_MISSING_DATA); } if (isset($data['$id'])) { diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index ebd12851e2..7ed022b452 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -134,6 +134,7 @@ class Exception extends \Exception /** Documents */ public const DOCUMENT_NOT_FOUND = 'document_not_found'; public const DOCUMENT_INVALID_STRUCTURE = 'document_invalid_structure'; + public const DOCUMENT_MISSING_DATA = 'document_missing_data'; public const DOCUMENT_MISSING_PAYLOAD = 'document_missing_payload'; public const DOCUMENT_ALREADY_EXISTS = 'document_already_exists'; public const DOCUMENT_UPDATE_CONFLICT = 'document_update_conflict'; From ed2c1139a788608516ab08827addaadd95bd57ff Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 9 Jun 2023 13:03:19 +1200 Subject: [PATCH 16/17] Update messages --- app/config/errors.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config/errors.php b/app/config/errors.php index 450ea08141..2983d22cd8 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -405,12 +405,12 @@ return [ ], Exception::DOCUMENT_MISSING_DATA => [ 'name' => Exception::DOCUMENT_MISSING_DATA, - 'description' => 'The document data is missing.', + 'description' => 'The document data is missing. You must provide the document data.', 'code' => 400, ], Exception::DOCUMENT_MISSING_PAYLOAD => [ 'name' => Exception::DOCUMENT_MISSING_PAYLOAD, - 'description' => 'The document data or permissions must be provided.', + 'description' => 'The document data and permissions are missing. You must provide either the document data or permissions to be updated.', 'code' => 400, ], Exception::DOCUMENT_ALREADY_EXISTS => [ From 7e8f6f748a955ad789f00e91fd0a88861aed5955 Mon Sep 17 00:00:00 2001 From: faisalill Date: Sat, 17 Jun 2023 00:20:37 +0530 Subject: [PATCH 17/17] fixed incorrect audity activity on document create --- app/controllers/api/databases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index a4de380561..418c36cc86 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2623,7 +2623,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].create') ->label('scope', 'documents.write') ->label('audits.event', 'document.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}/document/{response.$id}') ->label('usage.metric', 'documents.{scope}.requests.create') ->label('usage.params', ['databaseId:{request.databaseId}', 'collectionId:{request.collectionId}']) ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}')