From 8368ff0ffe991d5bc45bd835e4b5c9753d282786 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 11 Aug 2023 23:43:55 +0000 Subject: [PATCH 01/45] chore: cleanup dockerfile --- Dockerfile | 88 --------------------------------------------------- composer.lock | 73 +++++++++++++++++++++--------------------- 2 files changed, 37 insertions(+), 124 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1a55209208..6e9753b92e 100755 --- a/Dockerfile +++ b/Dockerfile @@ -33,97 +33,9 @@ FROM appwrite/base:0.2.2 as final LABEL maintainer="team@appwrite.io" -ARG VERSION=dev ARG DEBUG=false ENV DEBUG=$DEBUG -ENV DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} -ENV DOCKER_COMPOSE_VERSION=v2.5.0 - -ENV _APP_SERVER=swoole \ - _APP_ENV=production \ - _APP_LOCALE=en \ - _APP_WORKER_PER_CORE= \ - _APP_DOMAIN=localhost \ - _APP_DOMAIN_TARGET=localhost \ - _APP_HOME=https://appwrite.io \ - _APP_EDITION=community \ - _APP_CONSOLE_WHITELIST_ROOT=enabled \ - _APP_CONSOLE_WHITELIST_EMAILS= \ - _APP_CONSOLE_WHITELIST_IPS= \ - _APP_SYSTEM_EMAIL_NAME= \ - _APP_SYSTEM_EMAIL_ADDRESS= \ - _APP_SYSTEM_RESPONSE_FORMAT= \ - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS= \ - _APP_OPTIONS_ABUSE=enabled \ - _APP_OPTIONS_FORCE_HTTPS=disabled \ - _APP_OPENSSL_KEY_V1=your-secret-key \ - _APP_STORAGE_LIMIT=10000000 \ - _APP_STORAGE_ANTIVIRUS=enabled \ - _APP_STORAGE_ANTIVIRUS_HOST=clamav \ - _APP_STORAGE_ANTIVIRUS_PORT=3310 \ - _APP_STORAGE_DEVICE=Local \ - _APP_STORAGE_S3_ACCESS_KEY= \ - _APP_STORAGE_S3_SECRET= \ - _APP_STORAGE_S3_REGION= \ - _APP_STORAGE_S3_BUCKET= \ - _APP_STORAGE_DO_SPACES_ACCESS_KEY= \ - _APP_STORAGE_DO_SPACES_SECRET= \ - _APP_STORAGE_DO_SPACES_REGION= \ - _APP_STORAGE_DO_SPACES_BUCKET= \ - _APP_STORAGE_BACKBLAZE_ACCESS_KEY= \ - _APP_STORAGE_BACKBLAZE_SECRET= \ - _APP_STORAGE_BACKBLAZE_REGION= \ - _APP_STORAGE_BACKBLAZE_BUCKET= \ - _APP_STORAGE_LINODE_ACCESS_KEY= \ - _APP_STORAGE_LINODE_SECRET= \ - _APP_STORAGE_LINODE_REGION= \ - _APP_STORAGE_LINODE_BUCKET= \ - _APP_STORAGE_WASABI_ACCESS_KEY= \ - _APP_STORAGE_WASABI_SECRET= \ - _APP_STORAGE_WASABI_REGION= \ - _APP_STORAGE_WASABI_BUCKET= \ - _APP_REDIS_HOST=redis \ - _APP_REDIS_PORT=6379 \ - _APP_DB_HOST=mariadb \ - _APP_DB_PORT=3306 \ - _APP_DB_USER=root \ - _APP_DB_PASS=password \ - _APP_DB_SCHEMA=appwrite \ - _APP_INFLUXDB_HOST=influxdb \ - _APP_INFLUXDB_PORT=8086 \ - _APP_STATSD_HOST=telegraf \ - _APP_STATSD_PORT=8125 \ - _APP_SMTP_HOST= \ - _APP_SMTP_PORT= \ - _APP_SMTP_SECURE= \ - _APP_SMTP_USERNAME= \ - _APP_SMTP_PASSWORD= \ - _APP_SMS_PROVIDER= \ - _APP_SMS_FROM= \ - _APP_FUNCTIONS_SIZE_LIMIT=30000000 \ - _APP_FUNCTIONS_TIMEOUT=900 \ - _APP_FUNCTIONS_CONTAINERS=10 \ - _APP_FUNCTIONS_CPUS=1 \ - _APP_FUNCTIONS_MEMORY=128 \ - _APP_FUNCTIONS_MEMORY_SWAP=128 \ - _APP_EXECUTOR_SECRET=a-random-secret \ - _APP_EXECUTOR_HOST=http://appwrite-executor/v1 \ - _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes \ - _APP_SETUP=self-hosted \ - _APP_VERSION=$VERSION \ - _APP_USAGE_STATS=enabled \ - _APP_USAGE_AGGREGATION_INTERVAL=30 \ - # 14 Days = 1209600 s - _APP_MAINTENANCE_RETENTION_EXECUTION=1209600 \ - _APP_MAINTENANCE_RETENTION_AUDIT=1209600 \ - # 1 Day = 86400 s - _APP_MAINTENANCE_RETENTION_ABUSE=86400 \ - _APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000 \ - _APP_MAINTENANCE_INTERVAL=86400 \ - _APP_LOGGING_PROVIDER= \ - _APP_LOGGING_CONFIG= - RUN \ if [ "$DEBUG" == "true" ]; then \ apk add boost boost-dev; \ diff --git a/composer.lock b/composer.lock index 5e6640b9fb..fe2ef22cdb 100644 --- a/composer.lock +++ b/composer.lock @@ -607,16 +607,16 @@ }, { "name": "guzzlehttp/promises", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6" + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", "shasum": "" }, "require": { @@ -670,7 +670,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.0" + "source": "https://github.com/guzzle/promises/tree/2.0.1" }, "funding": [ { @@ -686,20 +686,20 @@ "type": "tidelift" } ], - "time": "2023-05-21T13:50:22+00:00" + "time": "2023-08-03T15:11:55+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.5.0", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6" + "reference": "8bd7c33a0734ae1c5d074360512beb716bef3f77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/8bd7c33a0734ae1c5d074360512beb716bef3f77", + "reference": "8bd7c33a0734ae1c5d074360512beb716bef3f77", "shasum": "" }, "require": { @@ -786,7 +786,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.5.0" + "source": "https://github.com/guzzle/psr7/tree/2.6.0" }, "funding": [ { @@ -802,7 +802,7 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:11:26+00:00" + "time": "2023-08-03T15:06:02+00:00" }, { "name": "influxdb/influxdb-php", @@ -3791,16 +3791,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.22.1", + "version": "1.23.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0" + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/65c39594fbd8c67abfc68bb323f86447bab79cc0", - "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/846ae76eef31c6d7790fac9bc399ecee45160b26", + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26", "shasum": "" }, "require": { @@ -3832,22 +3832,22 @@ "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.22.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.1" }, - "time": "2023-06-29T20:46:06+00:00" + "time": "2023-08-03T16:32:59+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.26", + "version": "9.2.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1", + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1", "shasum": "" }, "require": { @@ -3903,7 +3903,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27" }, "funding": [ { @@ -3911,7 +3912,7 @@ "type": "github" } ], - "time": "2023-03-06T12:58:08+00:00" + "time": "2023-07-26T13:44:30+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4763,16 +4764,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bde739e7565280bda77be70044ac1047bc007e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", "shasum": "" }, "require": { @@ -4815,7 +4816,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" }, "funding": [ { @@ -4823,7 +4824,7 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-08-02T09:26:13+00:00" }, { "name": "sebastian/lines-of-code", @@ -5586,16 +5587,16 @@ }, { "name": "twig/twig", - "version": "v3.6.1", + "version": "v3.7.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd" + "reference": "5cf942bbab3df42afa918caeba947f1b690af64b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", - "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/5cf942bbab3df42afa918caeba947f1b690af64b", + "reference": "5cf942bbab3df42afa918caeba947f1b690af64b", "shasum": "" }, "require": { @@ -5641,7 +5642,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.6.1" + "source": "https://github.com/twigphp/Twig/tree/v3.7.0" }, "funding": [ { @@ -5653,7 +5654,7 @@ "type": "tidelift" } ], - "time": "2023-06-08T12:52:13+00:00" + "time": "2023-07-26T07:16:09+00:00" } ], "aliases": [], From 96354098f10f77eeb18b45494a3a8c22359b97ca Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 11 Aug 2023 23:45:05 +0000 Subject: [PATCH 02/45] chore: cleanup dockerfile --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 6e9753b92e..f62b88b163 100755 --- a/Dockerfile +++ b/Dockerfile @@ -33,9 +33,12 @@ FROM appwrite/base:0.2.2 as final LABEL maintainer="team@appwrite.io" +ARG VERSION=dev ARG DEBUG=false ENV DEBUG=$DEBUG +ENV _APP_VERSION=$VERSION + RUN \ if [ "$DEBUG" == "true" ]; then \ apk add boost boost-dev; \ From 31191c0be83360d952c9bec4c37100a5b00113b9 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 11 Aug 2023 23:49:10 +0000 Subject: [PATCH 03/45] chore: cleanup dockerfile --- .env | 1 + Dockerfile | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.env b/.env index 372bfd7baa..6a399636d0 100644 --- a/.env +++ b/.env @@ -1,4 +1,5 @@ _APP_ENV=development +_APP_VERSION=dev _APP_LOCALE=en _APP_WORKER_PER_CORE=6 _APP_CONSOLE_WHITELIST_ROOT=disabled diff --git a/Dockerfile b/Dockerfile index f62b88b163..6e9753b92e 100755 --- a/Dockerfile +++ b/Dockerfile @@ -33,12 +33,9 @@ FROM appwrite/base:0.2.2 as final LABEL maintainer="team@appwrite.io" -ARG VERSION=dev ARG DEBUG=false ENV DEBUG=$DEBUG -ENV _APP_VERSION=$VERSION - RUN \ if [ "$DEBUG" == "true" ]; then \ apk add boost boost-dev; \ From d9307724db1896d45245fd18ee797d7cb03d1363 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 13 Aug 2023 13:34:51 +0000 Subject: [PATCH 04/45] feat: add missing variable to docker compose --- composer.lock | 12 ++++++------ docker-compose.yml | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index fe2ef22cdb..949c2f2b2a 100644 --- a/composer.lock +++ b/composer.lock @@ -3665,16 +3665,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d" + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b2fe4d22a5426f38e014855322200b97b5362c0d", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", "shasum": "" }, "require": { @@ -3717,9 +3717,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.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3" }, - "time": "2023-05-30T18:13:47+00:00" + "time": "2023-08-12T11:01:26+00:00" }, { "name": "phpspec/prophecy", diff --git a/docker-compose.yml b/docker-compose.yml index ecb10b9eea..242d9129e8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -95,6 +95,7 @@ services: - -dopcache.preload=opcache.preload=/usr/src/code/app/preload.php environment: - _APP_ENV + - _APP_VERSION - _APP_WORKER_PER_CORE - _APP_LOCALE - _APP_CONSOLE_WHITELIST_ROOT From b0f5a0e67709d7f2c5f5e0c4c078ce6522c20366 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 13 Aug 2023 14:20:29 +0000 Subject: [PATCH 05/45] feat: add version to dockerfile --- Dockerfile | 3 +++ docker-compose.yml | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6e9753b92e..f62b88b163 100755 --- a/Dockerfile +++ b/Dockerfile @@ -33,9 +33,12 @@ FROM appwrite/base:0.2.2 as final LABEL maintainer="team@appwrite.io" +ARG VERSION=dev ARG DEBUG=false ENV DEBUG=$DEBUG +ENV _APP_VERSION=$VERSION + RUN \ if [ "$DEBUG" == "true" ]; then \ apk add boost boost-dev; \ diff --git a/docker-compose.yml b/docker-compose.yml index 242d9129e8..ecb10b9eea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -95,7 +95,6 @@ services: - -dopcache.preload=opcache.preload=/usr/src/code/app/preload.php environment: - _APP_ENV - - _APP_VERSION - _APP_WORKER_PER_CORE - _APP_LOCALE - _APP_CONSOLE_WHITELIST_ROOT From 06c0b189f092d1bc831618375a7015016225efc5 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 13 Aug 2023 14:21:06 +0000 Subject: [PATCH 06/45] feat: add version to dockerfile --- .env | 1 - 1 file changed, 1 deletion(-) diff --git a/.env b/.env index 6a399636d0..372bfd7baa 100644 --- a/.env +++ b/.env @@ -1,5 +1,4 @@ _APP_ENV=development -_APP_VERSION=dev _APP_LOCALE=en _APP_WORKER_PER_CORE=6 _APP_CONSOLE_WHITELIST_ROOT=disabled From 61c054c20b39748459b878152f9f5dfc0fd0b1c3 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 1 Sep 2023 15:25:16 -0400 Subject: [PATCH 07/45] chore: update deps --- app/console | 2 +- composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/console b/app/console index 9174d8f8cb..88b6d59051 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 9174d8f8cb584744dd7a53f69d324f490ee82ee3 +Subproject commit 88b6d59051992ed86183ee83d77bf678d1cb73bf diff --git a/composer.lock b/composer.lock index 8a3bf6d014..6e98aca893 100644 --- a/composer.lock +++ b/composer.lock @@ -3460,16 +3460,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.34.1", + "version": "0.34.2", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "81538d10abacd81350c265b516c72ef315116013" + "reference": "06ea25aace27790e42d57fdbc7ccf97e0b31a6ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/81538d10abacd81350c265b516c72ef315116013", - "reference": "81538d10abacd81350c265b516c72ef315116013", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/06ea25aace27790e42d57fdbc7ccf97e0b31a6ba", + "reference": "06ea25aace27790e42d57fdbc7ccf97e0b31a6ba", "shasum": "" }, "require": { @@ -3505,9 +3505,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.34.1" + "source": "https://github.com/appwrite/sdk-generator/tree/0.34.2" }, - "time": "2023-08-30T07:57:31+00:00" + "time": "2023-08-31T14:10:33+00:00" }, { "name": "doctrine/deprecations", From 3fd77bdda79b0a0638f0d035e1696442bdbf77f7 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 1 Sep 2023 15:29:30 -0400 Subject: [PATCH 08/45] chore: revert composer.lock --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 6e98aca893..8a3bf6d014 100644 --- a/composer.lock +++ b/composer.lock @@ -3460,16 +3460,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.34.2", + "version": "0.34.1", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "06ea25aace27790e42d57fdbc7ccf97e0b31a6ba" + "reference": "81538d10abacd81350c265b516c72ef315116013" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/06ea25aace27790e42d57fdbc7ccf97e0b31a6ba", - "reference": "06ea25aace27790e42d57fdbc7ccf97e0b31a6ba", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/81538d10abacd81350c265b516c72ef315116013", + "reference": "81538d10abacd81350c265b516c72ef315116013", "shasum": "" }, "require": { @@ -3505,9 +3505,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.34.2" + "source": "https://github.com/appwrite/sdk-generator/tree/0.34.1" }, - "time": "2023-08-31T14:10:33+00:00" + "time": "2023-08-30T07:57:31+00:00" }, { "name": "doctrine/deprecations", From 31a7cca9061d4fa67651d636b83d8fd103025cd2 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 1 Sep 2023 17:08:51 -0400 Subject: [PATCH 09/45] chore: add missing env variable --- .env | 3 ++- docker-compose.yml | 1 + src/Appwrite/Platform/Tasks/Doctor.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 6ef35b57c1..025f8ae8be 100644 --- a/.env +++ b/.env @@ -1,4 +1,5 @@ -_APP_ENV=development +_APP_ENV=production +_APP_HOME=https://appwrite.io _APP_LOCALE=en _APP_WORKER_PER_CORE=6 _APP_CONSOLE_WHITELIST_ROOT=disabled diff --git a/docker-compose.yml b/docker-compose.yml index b27c3581af..35326655b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -95,6 +95,7 @@ services: - -dopcache.preload=opcache.preload=/usr/src/code/app/preload.php environment: - _APP_ENV + - _APP_HOME - _APP_WORKER_PER_CORE - _APP_LOCALE - _APP_CONSOLE_WHITELIST_ROOT diff --git a/src/Appwrite/Platform/Tasks/Doctor.php b/src/Appwrite/Platform/Tasks/Doctor.php index 9a6d6a2847..423dd78fe7 100644 --- a/src/Appwrite/Platform/Tasks/Doctor.php +++ b/src/Appwrite/Platform/Tasks/Doctor.php @@ -245,7 +245,7 @@ class Doctor extends Action try { if (App::isProduction()) { Console::log(''); - $version = \json_decode(@\file_get_contents(App::getEnv('_APP_HOME', 'http://localhost') . '/v1/health/version'), true); + $version = \json_decode(@\file_get_contents(App::getEnv('_APP_HOME', 'http://localhost') . '/version'), true); if ($version && isset($version['version'])) { if (\version_compare($version['version'], App::getEnv('_APP_VERSION', 'UNKNOWN')) === 0) { From 036b565f8f9d815ce9e34c4ee1d2aa0af21b0e87 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 1 Sep 2023 17:09:15 -0400 Subject: [PATCH 10/45] chore: add missing env variable --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 025f8ae8be..3ad31d65f6 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -_APP_ENV=production +_APP_ENV=development _APP_HOME=https://appwrite.io _APP_LOCALE=en _APP_WORKER_PER_CORE=6 From b3807e6e22c45da34cdb871076c13e081fc76d2d Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 1 Sep 2023 17:17:58 -0400 Subject: [PATCH 11/45] chore: move env variable to dockerfile --- .env | 1 - Dockerfile | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 3ad31d65f6..6ef35b57c1 100644 --- a/.env +++ b/.env @@ -1,5 +1,4 @@ _APP_ENV=development -_APP_HOME=https://appwrite.io _APP_LOCALE=en _APP_WORKER_PER_CORE=6 _APP_CONSOLE_WHITELIST_ROOT=disabled diff --git a/Dockerfile b/Dockerfile index 0145c346b7..8cea481543 100755 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,8 @@ ARG VERSION=dev ARG DEBUG=false ENV DEBUG=$DEBUG -ENV _APP_VERSION=$VERSION +ENV _APP_VERSION=$VERSION \ + _APP_HOME=https://appwrite.io RUN \ if [ "$DEBUG" == "true" ]; then \ From fad4bfcb1cb72ff1addc4a051c6a651f45c537af Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 1 Sep 2023 17:18:52 -0400 Subject: [PATCH 12/45] chore: move env variable to dockerfile --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 35326655b8..b27c3581af 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -95,7 +95,6 @@ services: - -dopcache.preload=opcache.preload=/usr/src/code/app/preload.php environment: - _APP_ENV - - _APP_HOME - _APP_WORKER_PER_CORE - _APP_LOCALE - _APP_CONSOLE_WHITELIST_ROOT From f4cba83072551e2f8cdcfd7bb3afd549ed0a300d Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 1 Sep 2023 18:46:49 -0400 Subject: [PATCH 13/45] chore: update default env variables --- app/config/variables.php | 2 +- composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/config/variables.php b/app/config/variables.php index b39eb9c41d..410d8203a8 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -65,7 +65,7 @@ return [ 'name' => '_APP_DOMAIN_FUNCTIONS', 'description' => 'A domain to use for function preview URLs. Setting to empty turns off function preview URLs.', 'introduction' => '', - 'default' => '', + 'default' => 'functions.localhost', 'required' => false, 'question' => '', 'filter' => '' diff --git a/composer.lock b/composer.lock index 8a3bf6d014..6e98aca893 100644 --- a/composer.lock +++ b/composer.lock @@ -3460,16 +3460,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.34.1", + "version": "0.34.2", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "81538d10abacd81350c265b516c72ef315116013" + "reference": "06ea25aace27790e42d57fdbc7ccf97e0b31a6ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/81538d10abacd81350c265b516c72ef315116013", - "reference": "81538d10abacd81350c265b516c72ef315116013", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/06ea25aace27790e42d57fdbc7ccf97e0b31a6ba", + "reference": "06ea25aace27790e42d57fdbc7ccf97e0b31a6ba", "shasum": "" }, "require": { @@ -3505,9 +3505,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.34.1" + "source": "https://github.com/appwrite/sdk-generator/tree/0.34.2" }, - "time": "2023-08-30T07:57:31+00:00" + "time": "2023-08-31T14:10:33+00:00" }, { "name": "doctrine/deprecations", From a46879f1cba0973367d78f0cf549168888e5595d Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 5 Sep 2023 18:29:11 +0300 Subject: [PATCH 14/45] cache key reformat --- app/controllers/shared/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 9dd800b69b..b65e35e605 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -203,7 +203,7 @@ App::init() $useCache = $route->getLabel('cache', false); if ($useCache) { - $key = md5($request->getURI() . implode('*', $request->getParams())) . '*' . APP_CACHE_BUSTER; + $key = md5($request->getURI() . implode('*', $request->getParams()) . '*' . APP_CACHE_BUSTER); $cache = new Cache( new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId()) ); @@ -491,7 +491,7 @@ App::shutdown() $resourceType = $parseLabel($pattern, $responsePayload, $requestParams, $user); } - $key = md5($request->getURI() . implode('*', $request->getParams())) . '*' . APP_CACHE_BUSTER; + $key = md5($request->getURI() . implode('*', $request->getParams()) . '*' . APP_CACHE_BUSTER); $data = json_encode([ 'resourceType' => $resourceType, 'resource' => $resource, From f246d4d6e5c52c3ecc2a627f8dfc5e42806af194 Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 5 Sep 2023 21:21:24 +0300 Subject: [PATCH 15/45] removed $route->setIsActive(false); from cache output --- app/controllers/shared/api.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index b65e35e605..13db405091 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -255,7 +255,6 @@ App::init() ->send(base64_decode($data['payload'])) ; - $route->setIsActive(false); } else { $response->addHeader('X-Appwrite-Cache', 'miss'); } From d18788ffde1f4b577bd548d76afb443a593cc0d4 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Fri, 8 Sep 2023 12:08:18 -0700 Subject: [PATCH 16/45] Add _APP_OPENSSL_KEY_V1 to the compose file The appwrite-schedules container fetches functions and needs the openssl key to decrypt function variables. Without this, the variables may end up being false. --- app/views/install/compose.phtml | 1 + docker-compose.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 4c07d606f5..2fca03a041 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -615,6 +615,7 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER diff --git a/docker-compose.yml b/docker-compose.yml index 58feb4a62b..bd04c8a793 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -671,6 +671,7 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER From 93e2a4fb8dd36ae163a8a62653668b632c5110e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 11 Sep 2023 12:22:16 +0200 Subject: [PATCH 17/45] Add v2 old vars support --- app/controllers/api/functions.php | 10 ++++++++++ app/workers/functions.php | 22 +++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 1cabc77eb7..aedade13e9 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1658,6 +1658,16 @@ App::post('/v1/functions/:functionId/executions') $vars = []; + // V2 vars + if ($version === 'v2') { + $vars = \array_merge($vars, [ + 'APPWRITE_FUNCTION_TRIGGER' => $headers['x-appwrite-trigger'] ?? '', + 'APPWRITE_FUNCTION_DATA' => $body ?? '', + 'APPWRITE_FUNCTION_USER_ID' => $headers['x-appwrite-user-id'] ?? '', + 'APPWRITE_FUNCTION_JWT' => $headers['x-appwrite-user-jwt'] ?? '' + ]); + } + // Shared vars foreach ($function->getAttribute('varsProject', []) as $var) { $vars[$var->getAttribute('key')] = $var->getAttribute('value', ''); diff --git a/app/workers/functions.php b/app/workers/functions.php index 9fa1c7df16..619d33387a 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -140,8 +140,25 @@ Server::setResource('execute', function () { $durationStart = \microtime(true); + $body = $eventData ?? ''; + if (empty($body)) { + $body = $data ?? ''; + } + $vars = []; + // V2 vars + if ($version === 'v2') { + $vars = \array_merge($vars, [ + 'APPWRITE_FUNCTION_TRIGGER' => $headers['x-appwrite-trigger'] ?? '', + 'APPWRITE_FUNCTION_DATA' => $body ?? '', + 'APPWRITE_FUNCTION_EVENT_DATA' => $body ?? '', + 'APPWRITE_FUNCTION_EVENT' => $headers['x-appwrite-event'] ?? '', + 'APPWRITE_FUNCTION_USER_ID' => $headers['x-appwrite-user-id'] ?? '', + 'APPWRITE_FUNCTION_JWT' => $headers['x-appwrite-user-jwt'] ?? '' + ]); + } + // Shared vars foreach ($function->getAttribute('varsProject', []) as $var) { $vars[$var->getAttribute('key')] = $var->getAttribute('value', ''); @@ -162,11 +179,6 @@ Server::setResource('execute', function () { 'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '', ]); - $body = $eventData ?? ''; - if (empty($body)) { - $body = $data ?? ''; - } - /** Execute function */ try { $version = $function->getAttribute('version', 'v2'); From 5cb03da0017d0dfcf2e413997d7e2568cf4a0cc9 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Mon, 11 Sep 2023 23:24:11 -0400 Subject: [PATCH 18/45] Extracting function event validator to its own class. --- app/controllers/api/functions.php | 6 +- src/Appwrite/Event/Validator/Event.php | 6 -- .../Event/Validator/FunctionEvent.php | 25 +++++++ src/Appwrite/GraphQL/Types/Mapper.php | 1 + .../Validator/FunctionEventValidatorTest.php | 73 +++++++++++++++++++ 5 files changed, 102 insertions(+), 9 deletions(-) create mode 100644 src/Appwrite/Event/Validator/FunctionEvent.php create mode 100644 tests/unit/Event/Validator/FunctionEventValidatorTest.php diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 1cabc77eb7..ba323dc5a4 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -7,7 +7,7 @@ use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Event\Func; use Appwrite\Event\Usage; -use Appwrite\Event\Validator\Event as ValidatorEvent; +use Appwrite\Event\Validator\FunctionEvent; use Appwrite\Utopia\Response\Model\Rule; use Appwrite\Extend\Exception; use Appwrite\Utopia\Database\Validator\CustomId; @@ -136,7 +136,7 @@ App::post('/v1/functions') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') ->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.') ->param('execute', [], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true) - ->param('events', [], new ArrayList(new ValidatorEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true) + ->param('events', [], new ArrayList(new FunctionEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true) ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true) ->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Function maximum execution time in seconds.', true) ->param('enabled', true, new Boolean(), 'Is function enabled? When set to \'disabled\', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.', true) @@ -662,7 +662,7 @@ App::put('/v1/functions/:functionId') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') ->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.', true) ->param('execute', [], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true) - ->param('events', [], new ArrayList(new ValidatorEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true) + ->param('events', [], new ArrayList(new FunctionEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true) ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true) ->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Maximum execution time in seconds.', true) ->param('enabled', true, new Boolean(), 'Is function enabled? When set to \'disabled\', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.', true) diff --git a/src/Appwrite/Event/Validator/Event.php b/src/Appwrite/Event/Validator/Event.php index 3f22900486..2061d53ed8 100644 --- a/src/Appwrite/Event/Validator/Event.php +++ b/src/Appwrite/Event/Validator/Event.php @@ -45,12 +45,6 @@ class Event extends Validator * Identify all sections of the pattern. */ $type = $parts[0] ?? false; - - if ($type == 'functions') { - $this->message = 'Triggering a function on a function event is not allowed.'; - return false; - } - $resource = $parts[1] ?? false; $hasSubResource = $count > 3 && ($events[$type]['$resource'] ?? false) && ($events[$type][$parts[2]]['$resource'] ?? false); $hasSubSubResource = $count > 5 && $hasSubResource && ($events[$type][$parts[2]][$parts[4]]['$resource'] ?? false); diff --git a/src/Appwrite/Event/Validator/FunctionEvent.php b/src/Appwrite/Event/Validator/FunctionEvent.php new file mode 100644 index 0000000000..6443b127ad --- /dev/null +++ b/src/Appwrite/Event/Validator/FunctionEvent.php @@ -0,0 +1,25 @@ +message = 'Triggering a function on a function event is not allowed.'; + return false; + } + + return parent::isValid($value); + } +} diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 0f9ad661f6..280d094a0c 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -235,6 +235,7 @@ class Mapper case 'Utopia\Validator\Domain': case 'Appwrite\Network\Validator\Email': case 'Appwrite\Event\Validator\Event': + case 'Appwrite\Event\Validator\FunctionEvent': case 'Utopia\Validator\HexColor': case 'Utopia\Validator\Host': case 'Utopia\Validator\IP': diff --git a/tests/unit/Event/Validator/FunctionEventValidatorTest.php b/tests/unit/Event/Validator/FunctionEventValidatorTest.php new file mode 100644 index 0000000000..ea59f6771a --- /dev/null +++ b/tests/unit/Event/Validator/FunctionEventValidatorTest.php @@ -0,0 +1,73 @@ +object = new FunctionEvent(); + } + + public function tearDown(): void + { + } + + public function testValues(): void + { + /** + * Test for SUCCESS + */ + $this->assertTrue($this->object->isValid('users.*.create')); + $this->assertTrue($this->object->isValid('users.torsten.update')); + $this->assertTrue($this->object->isValid('users.torsten')); + $this->assertTrue($this->object->isValid('users.*.update.email')); + $this->assertTrue($this->object->isValid('users.*.update')); + $this->assertTrue($this->object->isValid('users.*')); + $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.prolog.create')); + $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.prolog')); + $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.*.create')); + $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.*')); + $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.prolog.create')); + $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.prolog')); + $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.*.create')); + $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.*')); + $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.prolog.create')); + $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.prolog')); + $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.*.create')); + $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.*')); + $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.prolog.create')); + $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.prolog')); + $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.*.create')); + $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.*')); + $this->assertTrue($this->object->isValid('databases.*.collections.*')); + $this->assertTrue($this->object->isValid('databases.*')); + $this->assertTrue($this->object->isValid('databases.books')); + $this->assertTrue($this->object->isValid('databases.books.collections.chapters')); + $this->assertTrue($this->object->isValid('databases.books.collections.*')); + $this->assertTrue($this->object->isValid('buckets.*')); + $this->assertTrue($this->object->isValid('teams.*')); + $this->assertTrue($this->object->isValid('users.*')); + $this->assertTrue($this->object->isValid('teams.*.memberships.*.update.status')); + + /** + * Test for FAILURE + */ + $this->assertFalse($this->object->isValid(false)); + $this->assertFalse($this->object->isValid(null)); + $this->assertFalse($this->object->isValid('')); + $this->assertFalse($this->object->isValid('unknown.*')); + $this->assertFalse($this->object->isValid('collections')); + $this->assertFalse($this->object->isValid('collections.*.unknown')); + $this->assertFalse($this->object->isValid('collections.*.documents.*.unknown')); + $this->assertFalse($this->object->isValid('users.torsten.unknown')); + $this->assertFalse($this->object->isValid('users.torsten.delete.email')); + $this->assertFalse($this->object->isValid('teams.*.memberships.*.update.unknown')); + $this->assertFalse($this->object->isValid('functions.*')); + } +} From b37c2658ecb899996c93bf66e0a1223eb728c854 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Mon, 11 Sep 2023 23:56:30 -0400 Subject: [PATCH 19/45] Adding the `functions.*` test for the base event --- tests/unit/Event/Validator/EventValidatorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/Event/Validator/EventValidatorTest.php b/tests/unit/Event/Validator/EventValidatorTest.php index cf62ecca65..e9f652adeb 100644 --- a/tests/unit/Event/Validator/EventValidatorTest.php +++ b/tests/unit/Event/Validator/EventValidatorTest.php @@ -50,7 +50,7 @@ class EventValidatorTest extends TestCase $this->assertTrue($this->object->isValid('databases.books')); $this->assertTrue($this->object->isValid('databases.books.collections.chapters')); $this->assertTrue($this->object->isValid('databases.books.collections.*')); - // $this->assertTrue($this->object->isValid('functions.*')); TODO @christyjacob4 : enable test once we allow functions.* events + $this->assertTrue($this->object->isValid('functions.*')); $this->assertTrue($this->object->isValid('buckets.*')); $this->assertTrue($this->object->isValid('teams.*')); $this->assertTrue($this->object->isValid('users.*')); From 6b0c24a9d670fbf94f350c4bce7ef1764a540bf3 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Tue, 12 Sep 2023 12:05:11 -0700 Subject: [PATCH 20/45] Update user creation from teams and users services to not set accessedAt accessedAt should only be updated when a user performs some sort of action. Creating a user via the users API or by adding them to a team is an action done by someone else, not the user themselves. As such, the accessedAt timestamp shouldn't update. --- app/controllers/api/teams.php | 1 - app/controllers/api/users.php | 1 - 2 files changed, 2 deletions(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 2e263827a6..f20df71dad 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -491,7 +491,6 @@ App::post('/v1/teams/:teamId/memberships') 'tokens' => null, 'memberships' => null, 'search' => implode(' ', [$userId, $email, $name]), - 'accessedAt' => DateTime::now(), ]))); } catch (Duplicate $th) { throw new Exception(Exception::USER_ALREADY_EXISTS); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 00520ae8d7..bd3ff67662 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -97,7 +97,6 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e 'tokens' => null, 'memberships' => null, 'search' => implode(' ', [$userId, $email, $phone, $name]), - 'accessedAt' => DateTime::now(), ])); } catch (Duplicate $th) { throw new Exception(Exception::USER_ALREADY_EXISTS); From c30fa277d3eae6148b4a1c6e2f5ef39a4375a1b5 Mon Sep 17 00:00:00 2001 From: shimon Date: Wed, 13 Sep 2023 10:24:36 +0300 Subject: [PATCH 21/45] linter fix --- app/controllers/shared/api.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 13db405091..c2102057fa 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -254,7 +254,6 @@ App::init() ->setContentType($data['contentType']) ->send(base64_decode($data['payload'])) ; - } else { $response->addHeader('X-Appwrite-Cache', 'miss'); } From 8b7147965e7f717e6c6928ce3e2fc870d952276b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 13 Sep 2023 14:45:19 +0200 Subject: [PATCH 22/45] Fix git deploys with S3 storage --- app/views/install/compose.phtml | 21 +++++++++++++++++++++ app/workers/builds.php | 18 +++++++++++------- docker-compose.yml | 21 +++++++++++++++++++++ 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 2fca03a041..f2ad01f576 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -383,6 +383,27 @@ services: - _APP_FUNCTIONS_MEMORY - _APP_OPTIONS_FORCE_HTTPS - _APP_DOMAIN + - _APP_STORAGE_DEVICE + - _APP_STORAGE_S3_ACCESS_KEY + - _APP_STORAGE_S3_SECRET + - _APP_STORAGE_S3_REGION + - _APP_STORAGE_S3_BUCKET + - _APP_STORAGE_DO_SPACES_ACCESS_KEY + - _APP_STORAGE_DO_SPACES_SECRET + - _APP_STORAGE_DO_SPACES_REGION + - _APP_STORAGE_DO_SPACES_BUCKET + - _APP_STORAGE_BACKBLAZE_ACCESS_KEY + - _APP_STORAGE_BACKBLAZE_SECRET + - _APP_STORAGE_BACKBLAZE_REGION + - _APP_STORAGE_BACKBLAZE_BUCKET + - _APP_STORAGE_LINODE_ACCESS_KEY + - _APP_STORAGE_LINODE_SECRET + - _APP_STORAGE_LINODE_REGION + - _APP_STORAGE_LINODE_BUCKET + - _APP_STORAGE_WASABI_ACCESS_KEY + - _APP_STORAGE_WASABI_SECRET + - _APP_STORAGE_WASABI_REGION + - _APP_STORAGE_WASABI_BUCKET appwrite-worker-certificates: image: /: diff --git a/app/workers/builds.php b/app/workers/builds.php index 5f8ea9c4ce..89aa22edb7 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -20,6 +20,7 @@ use Utopia\Database\Database; use Utopia\Database\Query; use Utopia\Storage\Storage; use Utopia\Database\Validator\Authorization; +use Utopia\Storage\Device\Local; use Utopia\VCS\Adapter\Git\GitHub; require_once __DIR__ . '/../init.php'; @@ -248,22 +249,25 @@ class BuildsV1 extends Worker ); } - Console::execute('tar --exclude code.tar.gz -czf /tmp/builds/' . \escapeshellcmd($buildId) . '/code.tar.gz -C /tmp/builds/' . \escapeshellcmd($buildId) . '/code' . (empty($rootDirectory) ? '' : '/' . $rootDirectory) . ' .', '', $stdout, $stderr); + $tmpPath = '/tmp/builds/' . \escapeshellcmd($buildId); + $tmpPathFile = $tmpPath . '/code.tar.gz'; + + Console::execute('tar --exclude code.tar.gz -czf ' . $tmpPathFile . ' -C /tmp/builds/' . \escapeshellcmd($buildId) . '/code' . (empty($rootDirectory) ? '' : '/' . $rootDirectory) . ' .', '', $stdout, $stderr); $deviceFunctions = $this->getFunctionsDevice($project->getId()); - $fileName = 'code.tar.gz'; - $fileTmpName = '/tmp/builds/' . $buildId . '/code.tar.gz'; + $localDevice = new Local(); + $buffer = $localDevice->read($tmpPathFile); + $mimeType = $localDevice->getFileMimeType($tmpPathFile); - $path = $deviceFunctions->getPath($deployment->getId() . '.' . \pathinfo($fileName, PATHINFO_EXTENSION)); - - $result = $deviceFunctions->move($fileTmpName, $path); + $path = $deviceFunctions->getPath($deployment->getId() . '.' . \pathinfo('code.tar.gz', PATHINFO_EXTENSION)); + $result = $deviceFunctions->write($path, $buffer, $mimeType); if (!$result) { throw new \Exception("Unable to move file"); } - Console::execute('rm -rf /tmp/builds/' . \escapeshellcmd($buildId), '', $stdout, $stderr); + Console::execute('rm -rf ' . $tmpPath, '', $stdout, $stderr); $source = $path; diff --git a/docker-compose.yml b/docker-compose.yml index bd04c8a793..5b7e070e78 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -418,6 +418,27 @@ services: - _APP_FUNCTIONS_MEMORY - _APP_OPTIONS_FORCE_HTTPS - _APP_DOMAIN + - _APP_STORAGE_DEVICE + - _APP_STORAGE_S3_ACCESS_KEY + - _APP_STORAGE_S3_SECRET + - _APP_STORAGE_S3_REGION + - _APP_STORAGE_S3_BUCKET + - _APP_STORAGE_DO_SPACES_ACCESS_KEY + - _APP_STORAGE_DO_SPACES_SECRET + - _APP_STORAGE_DO_SPACES_REGION + - _APP_STORAGE_DO_SPACES_BUCKET + - _APP_STORAGE_BACKBLAZE_ACCESS_KEY + - _APP_STORAGE_BACKBLAZE_SECRET + - _APP_STORAGE_BACKBLAZE_REGION + - _APP_STORAGE_BACKBLAZE_BUCKET + - _APP_STORAGE_LINODE_ACCESS_KEY + - _APP_STORAGE_LINODE_SECRET + - _APP_STORAGE_LINODE_REGION + - _APP_STORAGE_LINODE_BUCKET + - _APP_STORAGE_WASABI_ACCESS_KEY + - _APP_STORAGE_WASABI_SECRET + - _APP_STORAGE_WASABI_REGION + - _APP_STORAGE_WASABI_BUCKET appwrite-worker-certificates: entrypoint: worker-certificates From 87281717284bbf85b339f24a842f026e27b8fbb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 13 Sep 2023 19:29:58 +0200 Subject: [PATCH 23/45] Add Bun support --- app/views/install/compose.phtml | 2 +- composer.json | 2 +- composer.lock | 20 ++++++++++---------- docker-compose.yml | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 2fca03a041..c2e729fd65 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -641,7 +641,7 @@ services: hostname: appwrite-executor <<: *x-logging stop_signal: SIGINT - image: openruntimes/executor:0.4.0 + image: openruntimes/executor:0.4.1 networks: - appwrite - runtimes diff --git a/composer.json b/composer.json index cfec16a8d1..b954c2a18d 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "ext-openssl": "*", "ext-zlib": "*", "ext-sockets": "*", - "appwrite/php-runtimes": "0.12.0", + "appwrite/php-runtimes": "0.13.*", "appwrite/php-clamav": "2.0.*", "utopia-php/abuse": "0.31.*", "utopia-php/analytics": "0.10.*", diff --git a/composer.lock b/composer.lock index 7d412e42c4..d434ec4a39 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1fe72c576bd9209f9db6e56cac8cd16a", + "content-hash": "5f20933c4389b2644bb7588330cb891d", "packages": [ { "name": "adhocore/jwt", @@ -156,11 +156,11 @@ }, { "name": "appwrite/php-runtimes", - "version": "0.12.0", + "version": "0.13.0", "source": { "type": "git", "url": "https://github.com/appwrite/runtimes.git", - "reference": "5aa672ae744be0d7a3d4bf4c93455c65e9a23b4f" + "reference": "5ab496b3908992b39275994a23783701c4b3de84" }, "require": { "php": ">=8.0", @@ -195,7 +195,7 @@ "php", "runtimes" ], - "time": "2023-08-07T09:56:11+00:00" + "time": "2023-09-12T19:38:43+00:00" }, { "name": "chillerlan/php-qrcode", @@ -4261,16 +4261,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.27", + "version": "9.2.28", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1" + "reference": "7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1", - "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef", + "reference": "7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef", "shasum": "" }, "require": { @@ -4327,7 +4327,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.28" }, "funding": [ { @@ -4335,7 +4335,7 @@ "type": "github" } ], - "time": "2023-07-26T13:44:30+00:00" + "time": "2023-09-12T14:36:20+00:00" }, { "name": "phpunit/php-file-iterator", diff --git a/docker-compose.yml b/docker-compose.yml index bd04c8a793..4f6bb9ca93 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -695,7 +695,7 @@ services: hostname: appwrite-executor <<: *x-logging stop_signal: SIGINT - image: openruntimes/executor:0.4.0 + image: openruntimes/executor:0.4.1 networks: - appwrite - runtimes From 408bef06e8b62ae04fd51be106217c232ad09b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 13 Sep 2023 21:08:12 +0200 Subject: [PATCH 24/45] Upgrade VCS lib --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index b954c2a18d..30b2709cb9 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,7 @@ "utopia-php/registry": "0.5.*", "utopia-php/storage": "0.14.*", "utopia-php/swoole": "0.5.*", - "utopia-php/vcs": "0.4.*", + "utopia-php/vcs": "0.5.*", "utopia-php/websocket": "0.1.*", "resque/php-resque": "1.3.6", "matomo/device-detector": "6.1.*", diff --git a/composer.lock b/composer.lock index d434ec4a39..1c1e68c1f1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5f20933c4389b2644bb7588330cb891d", + "content-hash": "e6e65dc385ee20f37e53fa1116c6ba33", "packages": [ { "name": "adhocore/jwt", @@ -3228,16 +3228,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.4.0", + "version": "0.5.0", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "08078af30865827adb8aafb32929c968ce541a28" + "reference": "47144f272030b7ed1b05471f2cb3aabeb8cb831c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/08078af30865827adb8aafb32929c968ce541a28", - "reference": "08078af30865827adb8aafb32929c968ce541a28", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/47144f272030b7ed1b05471f2cb3aabeb8cb831c", + "reference": "47144f272030b7ed1b05471f2cb3aabeb8cb831c", "shasum": "" }, "require": { @@ -3271,9 +3271,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.4.0" + "source": "https://github.com/utopia-php/vcs/tree/0.5.0" }, - "time": "2023-08-30T16:17:03+00:00" + "time": "2023-09-13T19:05:52+00:00" }, { "name": "utopia-php/websocket", From 0690b00c300956f93120602e4dfb00f3ee98f1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 13 Sep 2023 21:08:49 +0200 Subject: [PATCH 25/45] Add Bun auto detection --- app/controllers/api/vcs.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 67f59b9e40..2abf4ef30c 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -23,6 +23,7 @@ use Utopia\Database\Helpers\Role; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; +use Utopia\Detector\Adapter\Bun; use Utopia\Detector\Adapter\CPP; use Utopia\Detector\Adapter\Dart; use Utopia\Detector\Adapter\Deno; @@ -469,6 +470,7 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:pr $detectorFactory ->addDetector(new JavaScript()) + ->addDetector(new Bun()) ->addDetector(new PHP()) ->addDetector(new Python()) ->addDetector(new Dart()) @@ -549,6 +551,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories') $detectorFactory ->addDetector(new JavaScript()) + ->addDetector(new Bun()) ->addDetector(new PHP()) ->addDetector(new Python()) ->addDetector(new Dart()) From f8c9c2f39bb323f85111723c7313b29fefffa945 Mon Sep 17 00:00:00 2001 From: Prateek Banga Date: Thu, 14 Sep 2023 00:48:50 +0530 Subject: [PATCH 26/45] fixes manual internal id insertion --- app/controllers/api/account.php | 10 ++ app/controllers/api/functions.php | 3 +- app/workers/certificates.php | 2 + composer.json | 2 +- composer.lock | 165 +++++++++--------------------- 5 files changed, 63 insertions(+), 119 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index ab6799ab3d..547a8a47f1 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -146,6 +146,8 @@ App::post('/v1/account') 'search' => implode(' ', [$userId, $email, $name]), 'accessedAt' => DateTime::now(), ]); + // remove internalId from new user + $user->removeAttribute('$internalId'); Authorization::skip(fn() => $dbForProject->createDocument('users', $user)); } catch (Duplicate) { throw new Exception(Exception::USER_ALREADY_EXISTS); @@ -653,6 +655,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') 'search' => implode(' ', [$userId, $email, $name]), 'accessedAt' => DateTime::now(), ]); + // Remove internalId from new user + $user->removeAttribute('$internalId'); Authorization::skip(fn() => $dbForProject->createDocument('users', $user)); } catch (Duplicate) { $failureRedirect(Exception::USER_ALREADY_EXISTS); @@ -955,6 +959,8 @@ App::post('/v1/account/sessions/magic-url') 'accessedAt' => DateTime::now(), ]); + // Remove internalId from new user + $user->removeAttribute('$internalId'); Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); } @@ -1284,6 +1290,8 @@ App::post('/v1/account/sessions/phone') 'accessedAt' => DateTime::now(), ]); + // Remove internalId from new user + $user->removeAttribute('$internalId'); Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); } @@ -1534,6 +1542,8 @@ App::post('/v1/account/sessions/anonymous') 'search' => $userId, 'accessedAt' => DateTime::now(), ]); + // Remove internalId from new user + $user->removeAttribute('$internalId'); Authorization::skip(fn() => $dbForProject->createDocument('users', $user)); // Create session token diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index aedade13e9..55aba8bc71 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1456,9 +1456,10 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId') $deploymentId = ID::unique(); + // Remove internalId from new deployment + $deployment->removeAttribute('$internalId'); $deployment = $dbForProject->createDocument('deployments', $deployment->setAttributes([ '$id' => $deploymentId, - '$internalId' => '', 'buildId' => '', 'buildInternalId' => '', 'entrypoint' => $function->getAttribute('entrypoint'), diff --git a/app/workers/certificates.php b/app/workers/certificates.php index d390ed442e..5b358cdae6 100644 --- a/app/workers/certificates.php +++ b/app/workers/certificates.php @@ -174,6 +174,8 @@ class CertificatesV1 extends Worker $certificate = $this->dbForConsole->updateDocument('certificates', $certificate->getId(), $certificate); } else { + // Remove internalId from new certificate + $certificate->removeAttribute('$internalId'); $certificate = $this->dbForConsole->createDocument('certificates', $certificate); } diff --git a/composer.json b/composer.json index cfec16a8d1..66954b6d4f 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ "utopia-php/cache": "0.8.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.43.0", + "utopia-php/database": "0.43.*", "utopia-php/domains": "0.3.*", "utopia-php/dsn": "0.1.*", "utopia-php/framework": "0.31.0", diff --git a/composer.lock b/composer.lock index 7d412e42c4..f6a8700af9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1fe72c576bd9209f9db6e56cac8cd16a", + "content-hash": "ce37f32b5c3c12e85d8d67bad35f57d7", "packages": [ { "name": "adhocore/jwt", @@ -386,79 +386,6 @@ }, "time": "2023-04-18T15:34:23+00:00" }, - { - "name": "composer/package-versions-deprecated", - "version": "1.11.99.5", - "source": { - "type": "git", - "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7 || ^8" - }, - "replace": { - "ocramius/package-versions": "1.11.99" - }, - "require-dev": { - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13", - "phpunit/phpunit": "^6.5 || ^7" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "support": { - "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-01-17T14:14:24+00:00" - }, { "name": "dragonmantank/cron-expression", "version": "v3.3.2", @@ -914,24 +841,28 @@ }, { "name": "jean85/pretty-package-versions", - "version": "1.6.0", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "1e0104b46f045868f11942aea058cd7186d6c303" + "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/1e0104b46f045868f11942aea058cd7186d6c303", - "reference": "1e0104b46f045868f11942aea058cd7186d6c303", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/ae547e455a3d8babd07b96966b17d7fd21d9c6af", + "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af", "shasum": "" }, "require": { - "composer/package-versions-deprecated": "^1.8.0", - "php": "^7.0|^8.0" + "composer-runtime-api": "^2.0.0", + "php": "^7.1|^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.0|^8.5|^9.2" + "friendsofphp/php-cs-fixer": "^2.17", + "jean85/composer-provided-replaced-stub-package": "^1.0", + "phpstan/phpstan": "^0.12.66", + "phpunit/phpunit": "^7.5|^8.5|^9.4", + "vimeo/psalm": "^4.3" }, "type": "library", "extra": { @@ -954,7 +885,7 @@ "email": "alessandro.lai85@gmail.com" } ], - "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "description": "A library to get pretty versions strings of installed dependencies", "keywords": [ "composer", "package", @@ -963,9 +894,9 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/1.6.0" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.5" }, - "time": "2021-02-04T16:20:16+00:00" + "time": "2021-10-08T21:21:46+00:00" }, { "name": "laravel/pint", @@ -1188,34 +1119,35 @@ }, { "name": "mongodb/mongodb", - "version": "1.8.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "953dbc19443aa9314c44b7217a16873347e6840d" + "reference": "b0bbd657f84219212487d01a8ffe93a789e1e488" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/953dbc19443aa9314c44b7217a16873347e6840d", - "reference": "953dbc19443aa9314c44b7217a16873347e6840d", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/b0bbd657f84219212487d01a8ffe93a789e1e488", + "reference": "b0bbd657f84219212487d01a8ffe93a789e1e488", "shasum": "" }, "require": { "ext-hash": "*", "ext-json": "*", - "ext-mongodb": "^1.8.1", - "jean85/pretty-package-versions": "^1.2", - "php": "^7.0 || ^8.0", + "ext-mongodb": "^1.11.0", + "jean85/pretty-package-versions": "^1.2 || ^2.0.1", + "php": "^7.1 || ^8.0", "symfony/polyfill-php80": "^1.19" }, "require-dev": { - "squizlabs/php_codesniffer": "^3.5, <3.5.5", - "symfony/phpunit-bridge": "5.x-dev" + "doctrine/coding-standard": "^9.0", + "squizlabs/php_codesniffer": "^3.6", + "symfony/phpunit-bridge": "^5.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { @@ -1250,9 +1182,9 @@ ], "support": { "issues": "https://github.com/mongodb/mongo-php-library/issues", - "source": "https://github.com/mongodb/mongo-php-library/tree/1.8.0" + "source": "https://github.com/mongodb/mongo-php-library/tree/1.10.0" }, - "time": "2020-11-25T12:26:02+00:00" + "time": "2021-10-20T22:22:37+00:00" }, { "name": "mustangostang/spyc", @@ -2220,16 +2152,16 @@ }, { "name": "utopia-php/database", - "version": "0.43.0", + "version": "0.43.2", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "fb96fc6c94d5efcd43913c34bece62daba76a5e9" + "reference": "f2626acd42665a9987c94af1c93bf20c28d55c9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/fb96fc6c94d5efcd43913c34bece62daba76a5e9", - "reference": "fb96fc6c94d5efcd43913c34bece62daba76a5e9", + "url": "https://api.github.com/repos/utopia-php/database/zipball/f2626acd42665a9987c94af1c93bf20c28d55c9d", + "reference": "f2626acd42665a9987c94af1c93bf20c28d55c9d", "shasum": "" }, "require": { @@ -2238,12 +2170,11 @@ "php": ">=8.0", "utopia-php/cache": "0.8.*", "utopia-php/framework": "0.*.*", - "utopia-php/mongo": "0.2.*" + "utopia-php/mongo": "0.3.*" }, "require-dev": { "fakerphp/faker": "^1.14", "laravel/pint": "1.4.*", - "mongodb/mongodb": "1.8.0", "pcov/clobber": "^2.0", "phpstan/phpstan": "1.10.*", "phpunit/phpunit": "^9.4", @@ -2271,9 +2202,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.43.0" + "source": "https://github.com/utopia-php/database/tree/0.43.2" }, - "time": "2023-08-29T10:18:39+00:00" + "time": "2023-09-07T19:04:33+00:00" }, { "name": "utopia-php/domains", @@ -2691,21 +2622,21 @@ }, { "name": "utopia-php/mongo", - "version": "0.2.0", + "version": "0.3.1", "source": { "type": "git", "url": "https://github.com/utopia-php/mongo.git", - "reference": "b6dfb31b93c07c59b8bbd62a3b52e3b97a407c09" + "reference": "52326a9a43e2d27ff0c15c48ba746dacbe9a7aee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/mongo/zipball/b6dfb31b93c07c59b8bbd62a3b52e3b97a407c09", - "reference": "b6dfb31b93c07c59b8bbd62a3b52e3b97a407c09", + "url": "https://api.github.com/repos/utopia-php/mongo/zipball/52326a9a43e2d27ff0c15c48ba746dacbe9a7aee", + "reference": "52326a9a43e2d27ff0c15c48ba746dacbe9a7aee", "shasum": "" }, "require": { "ext-mongodb": "*", - "mongodb/mongodb": "1.8.0", + "mongodb/mongodb": "1.10.0", "php": ">=8.0" }, "require-dev": { @@ -2745,9 +2676,9 @@ ], "support": { "issues": "https://github.com/utopia-php/mongo/issues", - "source": "https://github.com/utopia-php/mongo/tree/0.2.0" + "source": "https://github.com/utopia-php/mongo/tree/0.3.1" }, - "time": "2023-03-22T10:44:29+00:00" + "time": "2023-09-01T17:25:28+00:00" }, { "name": "utopia-php/orchestration", @@ -4261,16 +4192,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.27", + "version": "9.2.28", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1" + "reference": "7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1", - "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef", + "reference": "7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef", "shasum": "" }, "require": { @@ -4327,7 +4258,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.28" }, "funding": [ { @@ -4335,7 +4266,7 @@ "type": "github" } ], - "time": "2023-07-26T13:44:30+00:00" + "time": "2023-09-12T14:36:20+00:00" }, { "name": "phpunit/php-file-iterator", From 15dd6863dd52069970be8228608ca93e66391b42 Mon Sep 17 00:00:00 2001 From: Prateek Banga Date: Thu, 14 Sep 2023 01:07:30 +0530 Subject: [PATCH 27/45] removes comments --- app/controllers/api/account.php | 5 ----- app/controllers/api/functions.php | 1 - app/workers/certificates.php | 1 - 3 files changed, 7 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 547a8a47f1..87dcd95f03 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -146,7 +146,6 @@ App::post('/v1/account') 'search' => implode(' ', [$userId, $email, $name]), 'accessedAt' => DateTime::now(), ]); - // remove internalId from new user $user->removeAttribute('$internalId'); Authorization::skip(fn() => $dbForProject->createDocument('users', $user)); } catch (Duplicate) { @@ -655,7 +654,6 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') 'search' => implode(' ', [$userId, $email, $name]), 'accessedAt' => DateTime::now(), ]); - // Remove internalId from new user $user->removeAttribute('$internalId'); Authorization::skip(fn() => $dbForProject->createDocument('users', $user)); } catch (Duplicate) { @@ -959,7 +957,6 @@ App::post('/v1/account/sessions/magic-url') 'accessedAt' => DateTime::now(), ]); - // Remove internalId from new user $user->removeAttribute('$internalId'); Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); } @@ -1290,7 +1287,6 @@ App::post('/v1/account/sessions/phone') 'accessedAt' => DateTime::now(), ]); - // Remove internalId from new user $user->removeAttribute('$internalId'); Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); } @@ -1542,7 +1538,6 @@ App::post('/v1/account/sessions/anonymous') 'search' => $userId, 'accessedAt' => DateTime::now(), ]); - // Remove internalId from new user $user->removeAttribute('$internalId'); Authorization::skip(fn() => $dbForProject->createDocument('users', $user)); diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 55aba8bc71..7c51d5377e 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1456,7 +1456,6 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId') $deploymentId = ID::unique(); - // Remove internalId from new deployment $deployment->removeAttribute('$internalId'); $deployment = $dbForProject->createDocument('deployments', $deployment->setAttributes([ '$id' => $deploymentId, diff --git a/app/workers/certificates.php b/app/workers/certificates.php index 5b358cdae6..4a3b9bccb5 100644 --- a/app/workers/certificates.php +++ b/app/workers/certificates.php @@ -174,7 +174,6 @@ class CertificatesV1 extends Worker $certificate = $this->dbForConsole->updateDocument('certificates', $certificate->getId(), $certificate); } else { - // Remove internalId from new certificate $certificate->removeAttribute('$internalId'); $certificate = $this->dbForConsole->createDocument('certificates', $certificate); } From 15f54c0dba23ca452fe4b2eb2cb1c4e60fba3d78 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 13 Sep 2023 16:23:14 -0700 Subject: [PATCH 28/45] Fix the _APP_FUNCTIONS_MAINTENANCE_INTERVAL variable * Clarify the description and make it match the other maintenance variables. * Fix the introduction since it was introduced in 1.4.0 and not 1.2.0. * Fix the default value because it was 1 hour in the previous versions and a number that is too low will conflict with a function's timeout. --- app/config/variables.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/config/variables.php b/app/config/variables.php index 8d31ee350b..4f8f370e79 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -846,10 +846,11 @@ return [ ], [ 'name' => '_APP_FUNCTIONS_MAINTENANCE_INTERVAL', - 'description' => 'Interval how often executor checks for inactive runimes. The default value is 60 seconds.', - 'introduction' => '1.2.0', - 'default' => '60', + 'description' => 'Interval value containing the number of seconds that the executor should wait before checking for inactive runtimes. The default value is 3600 seconds (1 hour).', + 'introduction' => '1.4.0', + 'default' => '3600', 'required' => false, + 'overwrite' => true, 'question' => '', 'filter' => '' ], From 629e0879ff8e69978d2a530b2ca87acc58f46d1c Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 14 Sep 2023 15:22:44 +0000 Subject: [PATCH 29/45] chore: update composer --- composer.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 9a31949eb9..e6e5f18eac 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ce37f32b5c3c12e85d8d67bad35f57d7", + "content-hash": "c93602b2d146c738d4ca7477a64288d2", "packages": [ { "name": "adhocore/jwt", From 0f902d4d2eef21a2f841402b664d5e32c2d147b4 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 14 Sep 2023 18:18:18 +0000 Subject: [PATCH 30/45] chore: update dependencies --- composer.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/composer.lock b/composer.lock index e6e5f18eac..00fd47675b 100644 --- a/composer.lock +++ b/composer.lock @@ -65,16 +65,16 @@ }, { "name": "appwrite/appwrite", - "version": "8.0.0", + "version": "10.0.0", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-for-php.git", - "reference": "2b9e966edf35c4061179ed98ea364698ab30de8b" + "reference": "461eedf4efd502dc905c3055f36f0e3583f67390" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/2b9e966edf35c4061179ed98ea364698ab30de8b", - "reference": "2b9e966edf35c4061179ed98ea364698ab30de8b", + "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/461eedf4efd502dc905c3055f36f0e3583f67390", + "reference": "461eedf4efd502dc905c3055f36f0e3583f67390", "shasum": "" }, "require": { @@ -99,10 +99,10 @@ "support": { "email": "team@appwrite.io", "issues": "https://github.com/appwrite/sdk-for-php/issues", - "source": "https://github.com/appwrite/sdk-for-php/tree/8.0.0", + "source": "https://github.com/appwrite/sdk-for-php/tree/10.0.0", "url": "https://appwrite.io/support" }, - "time": "2023-04-12T10:16:28+00:00" + "time": "2023-09-07T23:28:31+00:00" }, { "name": "appwrite/php-clamav", @@ -2564,27 +2564,27 @@ }, { "name": "utopia-php/migration", - "version": "0.3.3", + "version": "0.3.4", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "45bd831ed9819994f05cb3b467c58f8155e27692" + "reference": "ade836d61b3e1547bc9f0dc300ee75b24ab49f7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/45bd831ed9819994f05cb3b467c58f8155e27692", - "reference": "45bd831ed9819994f05cb3b467c58f8155e27692", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/ade836d61b3e1547bc9f0dc300ee75b24ab49f7a", + "reference": "ade836d61b3e1547bc9f0dc300ee75b24ab49f7a", "shasum": "" }, "require": { - "appwrite/appwrite": "^8.0", - "php": ">=8.0", - "utopia-php/cli": "^0.15.0" + "appwrite/appwrite": "10.0.*", + "php": "8.*", + "utopia-php/cli": "0.*" }, "require-dev": { - "laravel/pint": "^1.10", - "phpunit/phpunit": "^9.3", - "vlucas/phpdotenv": "^5.5" + "laravel/pint": "1.*", + "phpunit/phpunit": "9.*", + "vlucas/phpdotenv": "5.*" }, "type": "library", "autoload": { @@ -2616,9 +2616,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.3.3" + "source": "https://github.com/utopia-php/migration/tree/0.3.4" }, - "time": "2023-09-06T03:54:54+00:00" + "time": "2023-09-14T17:17:55+00:00" }, { "name": "utopia-php/mongo", From 316cd4f8f8e5bdaa56cc872c28bd35b0fbe2b502 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 14 Sep 2023 15:11:40 -0400 Subject: [PATCH 31/45] Bump CLI, Swift, Apple SDK versions --- app/config/platforms.php | 6 +++--- composer.json | 2 +- composer.lock | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index 8a41b6e675..75789473b9 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -81,7 +81,7 @@ return [ [ 'key' => 'apple', 'name' => 'Apple', - 'version' => '4.0.0', + 'version' => '4.0.1', 'url' => 'https://github.com/appwrite/sdk-for-apple', 'package' => 'https://github.com/appwrite/sdk-for-apple', 'enabled' => true, @@ -203,7 +203,7 @@ return [ [ 'key' => 'cli', 'name' => 'Command Line', - 'version' => '4.0.0', + 'version' => '4.1.0', 'url' => 'https://github.com/appwrite/sdk-for-cli', 'package' => 'https://www.npmjs.com/package/appwrite-cli', 'enabled' => true, @@ -415,7 +415,7 @@ return [ [ 'key' => 'swift', 'name' => 'Swift', - 'version' => '4.0.0', + 'version' => '4.0.1', 'url' => 'https://github.com/appwrite/sdk-for-swift', 'package' => 'https://github.com/appwrite/sdk-for-swift', 'enabled' => true, diff --git a/composer.json b/composer.json index 07bfc8c06d..7775b990df 100644 --- a/composer.json +++ b/composer.json @@ -86,8 +86,8 @@ } ], "require-dev": { - "appwrite/sdk-generator": "0.35.0", "ext-fileinfo": "*", + "appwrite/sdk-generator": "0.35.*", "phpunit/phpunit": "9.5.20", "squizlabs/php_codesniffer": "^3.7", "swoole/ide-helper": "5.0.2", diff --git a/composer.lock b/composer.lock index e6e5f18eac..8dd1c7568f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c93602b2d146c738d4ca7477a64288d2", + "content-hash": "54d54b76790d03a0bcfb9bbd23ed1009", "packages": [ { "name": "adhocore/jwt", @@ -3391,16 +3391,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.35.0", + "version": "0.35.2", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "edd5da6763d7f8f28155b77200682c69d08c9954" + "reference": "2dfe0430a64ffd2a07078d83b20144b871acac3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/edd5da6763d7f8f28155b77200682c69d08c9954", - "reference": "edd5da6763d7f8f28155b77200682c69d08c9954", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/2dfe0430a64ffd2a07078d83b20144b871acac3b", + "reference": "2dfe0430a64ffd2a07078d83b20144b871acac3b", "shasum": "" }, "require": { @@ -3436,9 +3436,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.35.0" + "source": "https://github.com/appwrite/sdk-generator/tree/0.35.2" }, - "time": "2023-09-07T17:13:18+00:00" + "time": "2023-09-14T14:59:50+00:00" }, { "name": "doctrine/deprecations", From 1e6b37f980b7b37945731c6ed262dff09c57f412 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 14 Sep 2023 19:53:32 +0000 Subject: [PATCH 32/45] chore: update appwrite version --- app/init.php | 2 +- composer.lock | 2 +- src/Appwrite/Migration/Migration.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/init.php b/app/init.php index 73044793e6..1e17756482 100644 --- a/app/init.php +++ b/app/init.php @@ -109,7 +109,7 @@ const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours const APP_CACHE_BUSTER = 509; -const APP_VERSION_STABLE = '1.4.2'; +const APP_VERSION_STABLE = '1.4.3'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; const APP_DATABASE_ATTRIBUTE_IP = 'ip'; diff --git a/composer.lock b/composer.lock index 88d67caa12..2580f92b3a 100644 --- a/composer.lock +++ b/composer.lock @@ -6027,5 +6027,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index 2a53ae27ca..09f39d3169 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -67,6 +67,7 @@ abstract class Migration '1.4.0' => 'V19', '1.4.1' => 'V19', '1.4.2' => 'V19', + '1.4.3' => 'V19', ]; /** From 38d610610cb867fe6b126f142a2f83df1bdb1a94 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 14 Sep 2023 19:58:52 +0000 Subject: [PATCH 33/45] chore: update changelog --- CHANGES.md | 11 +++++++++++ README-CN.md | 6 +++--- README.md | 6 +++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f31010bea4..a95a3a81d9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,14 @@ +# Version 1.4.3 + +## Features +- Support for the all new bun runtime + +## Fixes +- Add _APP_OPENSSL_KEY_V1 to the compose file [#6199](https://github.com/appwrite/appwrite/pull/6199) +- Fix: V2 functions env vars [#6215](https://github.com/appwrite/appwrite/pull/6215) +- Fix: Don't update User Accessed At for Users and Teams APIs [#6222](https://github.com/appwrite/appwrite/pull/6222) +- Fix: Git deploys with S3 [#6227](https://github.com/appwrite/appwrite/pull/6227) + # Version 1.4.2 ## Fixes diff --git a/README-CN.md b/README-CN.md index 8550695cc4..d85532be66 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.2 + appwrite/appwrite:1.4.3 ``` ### 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.2 + appwrite/appwrite:1.4.3 ``` #### 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.2 + appwrite/appwrite:1.4.3 ``` 运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。 diff --git a/README.md b/README.md index 68f4fdb1c0..90a5896f98 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.4.2 + appwrite/appwrite:1.4.3 ``` ### 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.4.2 + appwrite/appwrite:1.4.3 ``` #### 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.4.2 + appwrite/appwrite:1.4.3 ``` 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. From 5b76886375b3b54a1c5e2ba51e2e6be714f3344d Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 14 Sep 2023 19:59:43 +0000 Subject: [PATCH 34/45] chore: update changelog --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a95a3a81d9..e56455a4e7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,7 @@ # Version 1.4.3 ## Features -- Support for the all new bun runtime +- Support for the all new bun runtime [#6230](https://github.com/appwrite/appwrite/pull/6230) ## Fixes - Add _APP_OPENSSL_KEY_V1 to the compose file [#6199](https://github.com/appwrite/appwrite/pull/6199) From 3f00ebbf5d712e194942adc5e6ff4461b452b8c3 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 14 Sep 2023 20:00:25 +0000 Subject: [PATCH 35/45] chore: update changelog --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index e56455a4e7..38e74b5d0d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,8 @@ - Fix: V2 functions env vars [#6215](https://github.com/appwrite/appwrite/pull/6215) - Fix: Don't update User Accessed At for Users and Teams APIs [#6222](https://github.com/appwrite/appwrite/pull/6222) - Fix: Git deploys with S3 [#6227](https://github.com/appwrite/appwrite/pull/6227) +- Fix: manual internal id insertion [#6232](https://github.com/appwrite/appwrite/pull/6232) +- Fix: function timeout [#6235](https://github.com/appwrite/appwrite/pull/6235) # Version 1.4.2 From 27b58fdf1e6fd41ec3d5d152bb9cb146137bbc97 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 14 Sep 2023 20:05:51 +0000 Subject: [PATCH 36/45] chore: increase cache buster --- app/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/init.php b/app/init.php index 1e17756482..ba133ec7fb 100644 --- a/app/init.php +++ b/app/init.php @@ -108,7 +108,7 @@ const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours -const APP_CACHE_BUSTER = 509; +const APP_CACHE_BUSTER = 510; const APP_VERSION_STABLE = '1.4.3'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; From 66526edbe74f08a822fc41d12550be2a6247d362 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 14 Sep 2023 16:08:07 -0400 Subject: [PATCH 37/45] Update CHANGES.md Co-authored-by: Jake Barnby --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 38e74b5d0d..d08ce2fcec 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ - Fix: Git deploys with S3 [#6227](https://github.com/appwrite/appwrite/pull/6227) - Fix: manual internal id insertion [#6232](https://github.com/appwrite/appwrite/pull/6232) - Fix: function timeout [#6235](https://github.com/appwrite/appwrite/pull/6235) +- Fix: Missing keys when updating document via relationship [#320](https://github.com/utopia-php/database/pull/320) # Version 1.4.2 From e50a5863645cc75016729f162ca993870038cc82 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 14 Sep 2023 23:08:03 +0000 Subject: [PATCH 38/45] chore: review commens --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index d08ce2fcec..73ea9e0cb0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,10 @@ - Fix: manual internal id insertion [#6232](https://github.com/appwrite/appwrite/pull/6232) - Fix: function timeout [#6235](https://github.com/appwrite/appwrite/pull/6235) - Fix: Missing keys when updating document via relationship [#320](https://github.com/utopia-php/database/pull/320) +- Ensure collections with datetime attributes are migrated [#17](https://github.com/utopia-php/migration/pull/17) +- Ensure all user data are migrated including status, preferences, and labels [#17](https://github.com/utopia-php/migration/pull/17) +- Fix team memberships migration [#16](https://github.com/utopia-php/migration/pull/16) +- Fix events validation on create/update webhooks [#6219](https://github.com/appwrite/appwrite/pull/6219) # Version 1.4.2 From bede0d43d4527cf82dbc89aaaa0b8c744994cb4a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 15 Sep 2023 05:24:00 +0000 Subject: [PATCH 39/45] fix: add try catch block in the schedules task --- src/Appwrite/Platform/Tasks/Schedule.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/Schedule.php b/src/Appwrite/Platform/Tasks/Schedule.php index 6883ee30da..a136ee62b1 100644 --- a/src/Appwrite/Platform/Tasks/Schedule.php +++ b/src/Appwrite/Platform/Tasks/Schedule.php @@ -89,7 +89,12 @@ class Schedule extends Action $sum = count($results); $total = $total + $sum; foreach ($results as $document) { - $schedules[$document['resourceId']] = $getSchedule($document); + try { + $schedules[$document['resourceId']] = $getSchedule($document); + } catch (\Throwable $th) { + Console::error("Failed to load schedule for project {$document['projectId']} and function {$document['resourceId']}"); + Console::error($th->getMessage()); + } } $latestDocument = !empty(array_key_last($results)) ? $results[array_key_last($results)] : null; From 341fdb37213f462debd8531348b4b4ac894e0b39 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 15 Sep 2023 05:50:16 +0000 Subject: [PATCH 40/45] chore: update changelog --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 73ea9e0cb0..a82f60b8d2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ - Ensure all user data are migrated including status, preferences, and labels [#17](https://github.com/utopia-php/migration/pull/17) - Fix team memberships migration [#16](https://github.com/utopia-php/migration/pull/16) - Fix events validation on create/update webhooks [#6219](https://github.com/appwrite/appwrite/pull/6219) +- Fix: add a try catch block in the schedules task [#6246](https://github.com/appwrite/appwrite/pull/6246) # Version 1.4.2 From 538c258117f01ae6485ee9643548b1407f2e4f6b Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 15 Sep 2023 06:01:17 +0000 Subject: [PATCH 41/45] chore: update ci --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4d7fbb7b7a..4d1bfda26e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: with: fetch-depth: 2 submodules: recursive - ref: feat-db-pools-master + ref: cl-1.4.x - name: Login to Docker Hub uses: docker/login-action@v2 From 5b23a1c086c63379d1ddcc3b050a7ae6f638a4cf Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 15 Sep 2023 12:04:19 -0400 Subject: [PATCH 42/45] Update console --- .gitmodules | 2 +- app/console | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 31a251570d..c3860453a8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "app/console"] path = app/console url = https://github.com/appwrite/console - branch = 3.0.4 + branch = 3.1.0 diff --git a/app/console b/app/console index 88b6d59051..1d604a0b0d 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 88b6d59051992ed86183ee83d77bf678d1cb73bf +Subproject commit 1d604a0b0d66846c9ff3f1496a5a8698c86ebb12 From e53c5771abc15edab467fa94616d499b02c953ef Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 15 Sep 2023 12:21:19 -0400 Subject: [PATCH 43/45] Update changelog for console --- CHANGES.md | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a82f60b8d2..8324f499f8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,20 +2,29 @@ ## Features - Support for the all new bun runtime [#6230](https://github.com/appwrite/appwrite/pull/6230) +- Stripe function templates [Console #540](https://github.com/appwrite/console/pull/540) ## Fixes -- Add _APP_OPENSSL_KEY_V1 to the compose file [#6199](https://github.com/appwrite/appwrite/pull/6199) -- Fix: V2 functions env vars [#6215](https://github.com/appwrite/appwrite/pull/6215) -- Fix: Don't update User Accessed At for Users and Teams APIs [#6222](https://github.com/appwrite/appwrite/pull/6222) -- Fix: Git deploys with S3 [#6227](https://github.com/appwrite/appwrite/pull/6227) -- Fix: manual internal id insertion [#6232](https://github.com/appwrite/appwrite/pull/6232) -- Fix: function timeout [#6235](https://github.com/appwrite/appwrite/pull/6235) -- Fix: Missing keys when updating document via relationship [#320](https://github.com/utopia-php/database/pull/320) -- Ensure collections with datetime attributes are migrated [#17](https://github.com/utopia-php/migration/pull/17) -- Ensure all user data are migrated including status, preferences, and labels [#17](https://github.com/utopia-php/migration/pull/17) +- Fix missing _APP_OPENSSL_KEY_V1 in the compose file [#6199](https://github.com/appwrite/appwrite/pull/6199) +- Fix V2 functions env vars [#6215](https://github.com/appwrite/appwrite/pull/6215) +- Fix Don't update User Accessed At for Users and Teams APIs [#6222](https://github.com/appwrite/appwrite/pull/6222) +- Fix Git deploys with S3 [#6227](https://github.com/appwrite/appwrite/pull/6227) +- Fix manual internal id insertion [#6232](https://github.com/appwrite/appwrite/pull/6232) +- Fix function timeout [#6235](https://github.com/appwrite/appwrite/pull/6235) +- Fix collections with datetime attributes migration [#17](https://github.com/utopia-php/migration/pull/17) +- Fix not all user data being migrated [#17](https://github.com/utopia-php/migration/pull/17) - Fix team memberships migration [#16](https://github.com/utopia-php/migration/pull/16) - Fix events validation on create/update webhooks [#6219](https://github.com/appwrite/appwrite/pull/6219) -- Fix: add a try catch block in the schedules task [#6246](https://github.com/appwrite/appwrite/pull/6246) +- Fix schedules task [#6246](https://github.com/appwrite/appwrite/pull/6246) +- Fix missing keys when updating document via relationship [Database #320](https://github.com/utopia-php/database/pull/320) +- Fix Discord template [Console #538](https://github.com/appwrite/console/pull/538) +- Fix form var is url not text [Console #539](https://github.com/appwrite/console/pull/539) +- Fix incorrect link to migration docs for self-hosted to cloud [Console #543](https://github.com/appwrite/console/pull/543) +- Fix can't disable smtp [Console #548](https://github.com/appwrite/console/pull/548) +- Fix create function cover for case where VCS is not enabled [Console #544](https://github.com/appwrite/console/pull/544) +- Fix users list not re-rendering [Console #537](https://github.com/appwrite/console/pull/537) +- Fix create attribute modal null when selecting same time twice [Console #549](https://github.com/appwrite/console/pull/549) +- Fix runtime versions in templates [Console #546](https://github.com/appwrite/console/pull/546) # Version 1.4.2 From 67ad6578023fc2766f333d300725f0e657452fba Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 15 Sep 2023 16:56:11 -0400 Subject: [PATCH 44/45] Update console --- .gitmodules | 2 +- app/console | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index c3860453a8..33e1bf0f0f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "app/console"] path = app/console url = https://github.com/appwrite/console - branch = 3.1.0 + branch = 3.1.1 diff --git a/app/console b/app/console index 1d604a0b0d..9b4bcb8140 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 1d604a0b0d66846c9ff3f1496a5a8698c86ebb12 +Subproject commit 9b4bcb8140484669421685b4ba89fa1c4d331360 From a19967910160619718ada8321a3e0787364b212d Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 18 Sep 2023 11:50:23 -0400 Subject: [PATCH 45/45] chore: update ci scripts --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4d1bfda26e..a87f1e574f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,9 +1,9 @@ -name: "Build and Publish" +name: "Build and Publish Appwrite Images for Cloud" on: push: tags: - - appwrite-* + - cl-* jobs: build-publish: @@ -16,7 +16,7 @@ jobs: with: fetch-depth: 2 submodules: recursive - ref: cl-1.4.x + ref: master - name: Login to Docker Hub uses: docker/login-action@v2