1
0
Fork 0
mirror of synced 2024-09-28 15:31:43 +12:00

Merge branch '1.4.x' of https://github.com/appwrite/appwrite into feat-bun-support

This commit is contained in:
Christy Jacob 2023-09-14 15:21:31 +00:00
commit 2ea8dbff29
8 changed files with 103 additions and 120 deletions

View file

@ -146,6 +146,7 @@ App::post('/v1/account')
'search' => implode(' ', [$userId, $email, $name]), 'search' => implode(' ', [$userId, $email, $name]),
'accessedAt' => DateTime::now(), 'accessedAt' => DateTime::now(),
]); ]);
$user->removeAttribute('$internalId');
Authorization::skip(fn() => $dbForProject->createDocument('users', $user)); Authorization::skip(fn() => $dbForProject->createDocument('users', $user));
} catch (Duplicate) { } catch (Duplicate) {
throw new Exception(Exception::USER_ALREADY_EXISTS); throw new Exception(Exception::USER_ALREADY_EXISTS);
@ -653,6 +654,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
'search' => implode(' ', [$userId, $email, $name]), 'search' => implode(' ', [$userId, $email, $name]),
'accessedAt' => DateTime::now(), 'accessedAt' => DateTime::now(),
]); ]);
$user->removeAttribute('$internalId');
Authorization::skip(fn() => $dbForProject->createDocument('users', $user)); Authorization::skip(fn() => $dbForProject->createDocument('users', $user));
} catch (Duplicate) { } catch (Duplicate) {
$failureRedirect(Exception::USER_ALREADY_EXISTS); $failureRedirect(Exception::USER_ALREADY_EXISTS);
@ -955,6 +957,7 @@ App::post('/v1/account/sessions/magic-url')
'accessedAt' => DateTime::now(), 'accessedAt' => DateTime::now(),
]); ]);
$user->removeAttribute('$internalId');
Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); Authorization::skip(fn () => $dbForProject->createDocument('users', $user));
} }
@ -1284,6 +1287,7 @@ App::post('/v1/account/sessions/phone')
'accessedAt' => DateTime::now(), 'accessedAt' => DateTime::now(),
]); ]);
$user->removeAttribute('$internalId');
Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); Authorization::skip(fn () => $dbForProject->createDocument('users', $user));
} }
@ -1534,6 +1538,7 @@ App::post('/v1/account/sessions/anonymous')
'search' => $userId, 'search' => $userId,
'accessedAt' => DateTime::now(), 'accessedAt' => DateTime::now(),
]); ]);
$user->removeAttribute('$internalId');
Authorization::skip(fn() => $dbForProject->createDocument('users', $user)); Authorization::skip(fn() => $dbForProject->createDocument('users', $user));
// Create session token // Create session token

View file

@ -1456,9 +1456,9 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
$deploymentId = ID::unique(); $deploymentId = ID::unique();
$deployment->removeAttribute('$internalId');
$deployment = $dbForProject->createDocument('deployments', $deployment->setAttributes([ $deployment = $dbForProject->createDocument('deployments', $deployment->setAttributes([
'$id' => $deploymentId, '$id' => $deploymentId,
'$internalId' => '',
'buildId' => '', 'buildId' => '',
'buildInternalId' => '', 'buildInternalId' => '',
'entrypoint' => $function->getAttribute('entrypoint'), 'entrypoint' => $function->getAttribute('entrypoint'),

View file

@ -383,6 +383,27 @@ services:
- _APP_FUNCTIONS_MEMORY - _APP_FUNCTIONS_MEMORY
- _APP_OPTIONS_FORCE_HTTPS - _APP_OPTIONS_FORCE_HTTPS
- _APP_DOMAIN - _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: appwrite-worker-certificates:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?> image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>

View file

@ -20,6 +20,7 @@ use Utopia\Database\Database;
use Utopia\Database\Query; use Utopia\Database\Query;
use Utopia\Storage\Storage; use Utopia\Storage\Storage;
use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Authorization;
use Utopia\Storage\Device\Local;
use Utopia\VCS\Adapter\Git\GitHub; use Utopia\VCS\Adapter\Git\GitHub;
require_once __DIR__ . '/../init.php'; 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()); $deviceFunctions = $this->getFunctionsDevice($project->getId());
$fileName = 'code.tar.gz'; $localDevice = new Local();
$fileTmpName = '/tmp/builds/' . $buildId . '/code.tar.gz'; $buffer = $localDevice->read($tmpPathFile);
$mimeType = $localDevice->getFileMimeType($tmpPathFile);
$path = $deviceFunctions->getPath($deployment->getId() . '.' . \pathinfo($fileName, PATHINFO_EXTENSION)); $path = $deviceFunctions->getPath($deployment->getId() . '.' . \pathinfo('code.tar.gz', PATHINFO_EXTENSION));
$result = $deviceFunctions->write($path, $buffer, $mimeType);
$result = $deviceFunctions->move($fileTmpName, $path);
if (!$result) { if (!$result) {
throw new \Exception("Unable to move file"); 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; $source = $path;

View file

@ -174,6 +174,7 @@ class CertificatesV1 extends Worker
$certificate = $this->dbForConsole->updateDocument('certificates', $certificate->getId(), $certificate); $certificate = $this->dbForConsole->updateDocument('certificates', $certificate->getId(), $certificate);
} else { } else {
$certificate->removeAttribute('$internalId');
$certificate = $this->dbForConsole->createDocument('certificates', $certificate); $certificate = $this->dbForConsole->createDocument('certificates', $certificate);
} }

View file

@ -49,7 +49,7 @@
"utopia-php/cache": "0.8.*", "utopia-php/cache": "0.8.*",
"utopia-php/cli": "0.15.*", "utopia-php/cli": "0.15.*",
"utopia-php/config": "0.2.*", "utopia-php/config": "0.2.*",
"utopia-php/database": "0.43.0", "utopia-php/database": "0.43.*",
"utopia-php/domains": "0.3.*", "utopia-php/domains": "0.3.*",
"utopia-php/dsn": "0.1.*", "utopia-php/dsn": "0.1.*",
"utopia-php/framework": "0.31.0", "utopia-php/framework": "0.31.0",

153
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "e6e65dc385ee20f37e53fa1116c6ba33", "content-hash": "ce37f32b5c3c12e85d8d67bad35f57d7",
"packages": [ "packages": [
{ {
"name": "adhocore/jwt", "name": "adhocore/jwt",
@ -386,79 +386,6 @@
}, },
"time": "2023-04-18T15:34:23+00:00" "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", "name": "dragonmantank/cron-expression",
"version": "v3.3.2", "version": "v3.3.2",
@ -914,24 +841,28 @@
}, },
{ {
"name": "jean85/pretty-package-versions", "name": "jean85/pretty-package-versions",
"version": "1.6.0", "version": "2.0.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Jean85/pretty-package-versions.git", "url": "https://github.com/Jean85/pretty-package-versions.git",
"reference": "1e0104b46f045868f11942aea058cd7186d6c303" "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/1e0104b46f045868f11942aea058cd7186d6c303", "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/ae547e455a3d8babd07b96966b17d7fd21d9c6af",
"reference": "1e0104b46f045868f11942aea058cd7186d6c303", "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer/package-versions-deprecated": "^1.8.0", "composer-runtime-api": "^2.0.0",
"php": "^7.0|^8.0" "php": "^7.1|^8.0"
}, },
"require-dev": { "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", "type": "library",
"extra": { "extra": {
@ -954,7 +885,7 @@
"email": "alessandro.lai85@gmail.com" "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": [ "keywords": [
"composer", "composer",
"package", "package",
@ -963,9 +894,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/Jean85/pretty-package-versions/issues", "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", "name": "laravel/pint",
@ -1188,34 +1119,35 @@
}, },
{ {
"name": "mongodb/mongodb", "name": "mongodb/mongodb",
"version": "1.8.0", "version": "1.10.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/mongodb/mongo-php-library.git", "url": "https://github.com/mongodb/mongo-php-library.git",
"reference": "953dbc19443aa9314c44b7217a16873347e6840d" "reference": "b0bbd657f84219212487d01a8ffe93a789e1e488"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/953dbc19443aa9314c44b7217a16873347e6840d", "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/b0bbd657f84219212487d01a8ffe93a789e1e488",
"reference": "953dbc19443aa9314c44b7217a16873347e6840d", "reference": "b0bbd657f84219212487d01a8ffe93a789e1e488",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-hash": "*", "ext-hash": "*",
"ext-json": "*", "ext-json": "*",
"ext-mongodb": "^1.8.1", "ext-mongodb": "^1.11.0",
"jean85/pretty-package-versions": "^1.2", "jean85/pretty-package-versions": "^1.2 || ^2.0.1",
"php": "^7.0 || ^8.0", "php": "^7.1 || ^8.0",
"symfony/polyfill-php80": "^1.19" "symfony/polyfill-php80": "^1.19"
}, },
"require-dev": { "require-dev": {
"squizlabs/php_codesniffer": "^3.5, <3.5.5", "doctrine/coding-standard": "^9.0",
"symfony/phpunit-bridge": "5.x-dev" "squizlabs/php_codesniffer": "^3.6",
"symfony/phpunit-bridge": "^5.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.8.x-dev" "dev-master": "1.10.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -1250,9 +1182,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/mongodb/mongo-php-library/issues", "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", "name": "mustangostang/spyc",
@ -2220,16 +2152,16 @@
}, },
{ {
"name": "utopia-php/database", "name": "utopia-php/database",
"version": "0.43.0", "version": "0.43.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/utopia-php/database.git", "url": "https://github.com/utopia-php/database.git",
"reference": "fb96fc6c94d5efcd43913c34bece62daba76a5e9" "reference": "f2626acd42665a9987c94af1c93bf20c28d55c9d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/fb96fc6c94d5efcd43913c34bece62daba76a5e9", "url": "https://api.github.com/repos/utopia-php/database/zipball/f2626acd42665a9987c94af1c93bf20c28d55c9d",
"reference": "fb96fc6c94d5efcd43913c34bece62daba76a5e9", "reference": "f2626acd42665a9987c94af1c93bf20c28d55c9d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2238,12 +2170,11 @@
"php": ">=8.0", "php": ">=8.0",
"utopia-php/cache": "0.8.*", "utopia-php/cache": "0.8.*",
"utopia-php/framework": "0.*.*", "utopia-php/framework": "0.*.*",
"utopia-php/mongo": "0.2.*" "utopia-php/mongo": "0.3.*"
}, },
"require-dev": { "require-dev": {
"fakerphp/faker": "^1.14", "fakerphp/faker": "^1.14",
"laravel/pint": "1.4.*", "laravel/pint": "1.4.*",
"mongodb/mongodb": "1.8.0",
"pcov/clobber": "^2.0", "pcov/clobber": "^2.0",
"phpstan/phpstan": "1.10.*", "phpstan/phpstan": "1.10.*",
"phpunit/phpunit": "^9.4", "phpunit/phpunit": "^9.4",
@ -2271,9 +2202,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/utopia-php/database/issues", "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", "name": "utopia-php/domains",
@ -2691,21 +2622,21 @@
}, },
{ {
"name": "utopia-php/mongo", "name": "utopia-php/mongo",
"version": "0.2.0", "version": "0.3.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/utopia-php/mongo.git", "url": "https://github.com/utopia-php/mongo.git",
"reference": "b6dfb31b93c07c59b8bbd62a3b52e3b97a407c09" "reference": "52326a9a43e2d27ff0c15c48ba746dacbe9a7aee"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/utopia-php/mongo/zipball/b6dfb31b93c07c59b8bbd62a3b52e3b97a407c09", "url": "https://api.github.com/repos/utopia-php/mongo/zipball/52326a9a43e2d27ff0c15c48ba746dacbe9a7aee",
"reference": "b6dfb31b93c07c59b8bbd62a3b52e3b97a407c09", "reference": "52326a9a43e2d27ff0c15c48ba746dacbe9a7aee",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-mongodb": "*", "ext-mongodb": "*",
"mongodb/mongodb": "1.8.0", "mongodb/mongodb": "1.10.0",
"php": ">=8.0" "php": ">=8.0"
}, },
"require-dev": { "require-dev": {
@ -2745,9 +2676,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/utopia-php/mongo/issues", "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", "name": "utopia-php/orchestration",

View file

@ -418,6 +418,27 @@ services:
- _APP_FUNCTIONS_MEMORY - _APP_FUNCTIONS_MEMORY
- _APP_OPTIONS_FORCE_HTTPS - _APP_OPTIONS_FORCE_HTTPS
- _APP_DOMAIN - _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: appwrite-worker-certificates:
entrypoint: worker-certificates entrypoint: worker-certificates