Compare commits

..
Author SHA1 Message Date
Khushboo VermaandGitHub 3fa04727c7 Merge branch '1.7.x' into fix-push-to-existing-repo 2025-07-01 14:47:52 +05:30
Jake BarnbyandGitHub e561a38524 Merge pull request #10051 from appwrite/chore-upgrade-utopia-queue
chore: update composer.json and composer.lock to include appwrite-lab…
2025-07-01 02:51:31 +00:00
Jake Barnby a1af742c4b Update lock 2025-06-30 22:28:09 -04:00
Jake Barnby 98dccf6d15 Map null on missing default 2025-06-30 22:27:29 -04:00
Jake Barnby 609e1adcf0 Catch 2025-06-30 22:27:18 -04:00
Jake Barnby 72cd501f21 Merge remote-tracking branch 'origin/1.7.x' into chore-upgrade-utopia-queue 2025-06-30 21:01:47 -04:00
Khushboo Verma 5959457211 Merge branch '1.7.x' into fix-push-to-existing-repo 2025-07-01 01:24:45 +05:30
Steven NguyenandGitHub beb8e17013 Merge pull request #10079 from appwrite/chore-patch-cache-miss
patch: increase cache ttl to ensure hits
2025-06-30 12:04:45 -07:00
Christy JacobandGitHub 448a8df1a2 Merge branch '1.7.x' into chore-patch-cache-miss 2025-06-30 21:12:46 +04:00
Christy Jacob fd7628efe8 refactor: streamline cache handling in App::shutdown() and ensure file modification time updates 2025-06-30 21:03:30 +04:00
Christy Jacob d6326758a8 patch: increase cache ttl to ensure hits 2025-06-30 20:58:00 +04:00
Matej BačoandGitHub 36aa22793f Merge pull request #10043 from appwrite/fix-rules-platform-check
Fix: Platform check for Sites with automatic rule
2025-06-30 14:10:14 +02:00
Khushboo Verma ae72688c8e Merge branch '1.7.x' into fix-push-to-existing-repo 2025-06-30 15:45:54 +05:30
Christy Jacob 63a02e11ac Fix default value assignment in Mapper class to handle null cases 2025-06-27 18:42:02 +04:00
Matej Bačo ba7903af55 Merge branch '1.7.x' into fix-rules-platform-check 2025-06-27 12:46:06 +02:00
Christy JacobandGitHub cb19798284 Merge pull request #10070 from appwrite/update-cli-8.1.0
chore: update cli to 8.1.0 and add changelog
2025-06-27 14:26:32 +04:00
Chirag Aggarwal 156daca044 fix: composer 2025-06-27 15:50:32 +05:30
Chirag Aggarwal f056a8ba2f fix: composer 2025-06-27 15:49:08 +05:30
Chirag Aggarwal 151711aba9 Merge branch '1.7.x' into update-cli-8.1.0 2025-06-27 15:48:33 +05:30
Christy Jacob 14a4bb8828 Merge branch 'chore-upgrade-utopia-queue' of github.com:appwrite/appwrite into chore-upgrade-utopia-queue 2025-06-27 13:42:17 +04:00
Christy Jacob a36525373d Merge branch '1.7.x' of github.com:appwrite/appwrite into chore-upgrade-utopia-queue 2025-06-27 13:37:33 +04:00
Chirag Aggarwal 5a48fd6300 chore: update cli to 8.1.0 and add changelog 2025-06-27 11:43:56 +05:30
Matej BačoandGitHub 718cefdd94 Merge pull request #10066 from appwrite/fix-account-test-flakyness
Fix: flakyness of account tests
2025-06-26 22:18:00 +02:00
Matej Bačo ee225834d9 Fix default param syntax 2025-06-26 21:39:00 +02:00
Matej Bačo 23f350c7d1 Merge branch '1.7.x' into fix-account-test-flakyness 2025-06-26 21:33:09 +02:00
Matej Bačo b12ea0b3b1 Fix merge conflict bug 2025-06-26 21:22:38 +02:00
Matej BačoandGitHub 3a8dafe763 Merge branch '1.7.x' into fix-account-test-flakyness 2025-06-26 21:21:52 +02:00
Matej BačoandGitHub 42a0d64137 Merge pull request #10068 from appwrite/chore-preview-logging
Chore: Preview endpoint logging
2025-06-26 20:53:30 +02:00
Matej Bačo df902d2624 Fix account tests using old token 2025-06-26 20:47:59 +02:00
Matej Bačo a356e86ced Add previe wendpoint logging 2025-06-26 20:17:26 +02:00
Matej Bačo bda9adc52e Fix sms mock endpoint 2025-06-26 20:04:56 +02:00
Matej Bačo 8dcc3c4981 Merge branch '1.7.x' into fix-account-test-flakyness 2025-06-26 19:26:23 +02:00
Christy JacobandGitHub 368f928fa9 Merge pull request #10067 from appwrite/fix-parameter-order
fix: correct parameter order in action function for robots.txt route
2025-06-26 21:05:12 +04:00
Christy Jacob ee2796f870 fix: correct parameter order in action function for robots.txt route 2025-06-26 20:49:52 +04:00
Matej BačoandGitHub d4b53175dc Update tests/e2e/Scopes/Scope.php 2025-06-26 18:33:22 +02:00
Matej Bačo 572ff06f53 Fix robots.txt 5xx error 2025-06-26 18:32:03 +02:00
Matej Bačo 87c100db28 Improve General tests logging 2025-06-26 18:09:07 +02:00
Matej Bačo 918ad8979d Fix flakyness of account tests 2025-06-26 18:07:59 +02:00
Matej BačoandGitHub 2fa3ca27af Merge pull request #10052 from appwrite/fix-logs-order
Fix: logs order
2025-06-26 16:32:35 +02:00
Christy JacobandGitHub 1dfba85bcc Merge pull request #10054 from appwrite/chore-fix-tasks
refactor: replace Console loop with Swoole Timer for stats resource m…
2025-06-26 15:12:05 +04:00
Christy Jacob 204b00850d Refactor log message documentation in Action class to improve clarity and formatting 2025-06-26 15:09:57 +04:00
Christy JacobGitHubcoderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
5761320bfb Update src/Appwrite/Platform/Action.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-06-26 15:05:55 +04:00
Christy Jacob dbc7e5b42d Fix output format flag in benchmark workflow for consistency 2025-06-26 15:05:10 +04:00
Christy JacobandGitHub 22900e3de8 Merge pull request #10061 from appwrite/fix-missing-injections
Add: missing injections
2025-06-26 13:24:08 +04:00
Matej BačoandGitHub e5621f3218 Merge pull request #10062 from appwrite/add-runtimeEntrypoint
chore: add runtimeEntrypoint param
2025-06-26 10:29:21 +02:00
Chirag Aggarwal 276a294391 chore: update createExecution 2025-06-26 13:37:43 +05:30
Chirag Aggarwal 8bf3a8bf5d chore: add runtimeEntrypoint param 2025-06-26 13:29:06 +05:30
Darshan 72956d1995 fix: misaligned param order. 2025-06-26 13:07:11 +05:30
Darshan 038b5d7418 fix: lint. 2025-06-26 12:40:56 +05:30
Darshan 8f5b53d16c revert: composer.lock. 2025-06-26 12:36:37 +05:30
Darshan d2753bd491 add: missing injections. 2025-06-26 12:34:38 +05:30
Jake Barnby 921b2bcc5d Merge remote-tracking branch 'origin/1.7.x' into chore-upgrade-utopia-queue 2025-06-25 18:58:08 -04:00
Jake BarnbyandGitHub e8982e6b11 Merge pull request #10056 from appwrite/feat-update-logging
Add database worker job logging
2025-06-25 17:59:59 -04:00
Jake Barnby 7508a22ddf Lint 2025-06-25 16:49:12 -04:00
Jake Barnby 620266d9d6 Remove heartbeat 2025-06-25 16:40:02 -04:00
Jake Barnby f0ea206f29 Fix bench 2025-06-25 15:56:07 -04:00
Jake Barnby d52d8f7697 Fix API dump 2025-06-25 15:47:57 -04:00
Jake Barnby 255be3babf Ensure heartbeat is cleared on destruct 2025-06-25 14:52:14 -04:00
Jake Barnby e37cea5146 Add more trigger logging 2025-06-25 14:50:29 -04:00
Jake Barnby d7d7fa3096 Add trigger logging 2025-06-25 14:47:23 -04:00
Jake Barnby 92a04535ac Add database worker job logging 2025-06-25 14:35:17 -04:00
Christy Jacob c479a11850 Add logging functionality to Action class with dump method and refactor disableSubqueries to use class filters 2025-06-25 21:56:30 +04:00
Christy Jacob 3cd31e2c06 Add disableSubqueries method to Action class and integrate it into StatsResources initialization 2025-06-25 21:46:15 +04:00
Christy Jacob 5173e03636 Merge branch '1.7.x' of github.com:appwrite/appwrite into chore-fix-tasks 2025-06-25 21:33:30 +04:00
Christy JacobandGitHub 3fae6ae91c Merge pull request #10011 from appwrite/PLA-3018
Override project via custom domains log
2025-06-25 19:49:26 +04:00
shimon 19152f50dc Merge branch '1.7.x' of github.com:appwrite/appwrite into PLA-3018
# Conflicts:
#	.github/workflows/benchmark.yml
2025-06-25 18:48:53 +03:00
Matej BačoandGitHub bfbcd648f1 Merge pull request #9967 from appwrite/feat-use-first-class-callable-syntax
Use ->action(...)) instead of ->callback([$this, 'action']);
2025-06-25 17:13:50 +02:00
Matej BačoandGitHub f07abce6f8 Merge branch '1.7.x' into feat-use-first-class-callable-syntax 2025-06-25 16:46:30 +02:00
Matej BačoandGitHub 975f653e3e Merge pull request #9969 from appwrite/feat-add-branch-url-for-first-git-deployment
Create commit & branch url for first git deployment when site is linked to repo
2025-06-25 16:45:41 +02:00
Matej Bačo c85cfe132e Improve flaky tests logging 2025-06-25 15:53:59 +02:00
Matej Bačo 4fff9b94f8 Fix benchmark param name 2025-06-25 14:45:58 +02:00
Matej Bačo 4b5fa0652a Merge branch '1.7.x' into fix-rules-platform-check 2025-06-25 14:44:52 +02:00
Matej Bačo f1590652cb Improve benchmark logging 2025-06-25 14:30:50 +02:00
Matej Bačo df82340dae Improve code quality 2025-06-25 14:22:55 +02:00
Christy Jacob c268b632fb chore: update benchmark command to use JSON output format and adjust timer interval in StatsResources 2025-06-25 14:52:13 +04:00
Christy Jacob 17428ef433 refactor: replace Console loop with Swoole Timer for stats resource management 2025-06-25 14:18:22 +04:00
shimon e712ba5763 Merge branch '1.7.x' of github.com:appwrite/appwrite into PLA-3018 2025-06-25 10:18:07 +03:00
Christy Jacob b646eb7758 chore: update composer.json and composer.lock to upgrade utopia-php/queue to version 0.12.0 and appwrite-labs/php-amqplib to version 0.1.1 2025-06-25 00:23:21 +04:00
Christy Jacob fe080153e6 chore: update benchmark workflow to use JSON output format 2025-06-24 15:28:07 +04:00
Christy Jacob 4759407696 chore: update composer.json and composer.lock to include appwrite-labs/php-amqplib and adjust utopia-php/queue version 2025-06-24 14:57:30 +04:00
shimon 213b1ae20e benchmark cli 2025-06-23 20:57:39 +03:00
shimon 4e0faf67f7 benchmark cli 2025-06-23 20:39:52 +03:00
shimon 3059eecbeb benchmark cli 2025-06-23 20:27:12 +03:00
shimon dd8894ad1e Merge remote-tracking branch 'origin/PLA-3018' into PLA-3018 2025-06-23 20:21:25 +03:00
shimon 28f420f10c Merge branch '1.7.x' of github.com:appwrite/appwrite into PLA-3018 2025-06-23 20:20:43 +03:00
54748b7d32 Update app/controllers/general.php
Co-authored-by: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com>
2025-06-23 20:50:59 +04:00
Matej Bačo b69ff36ddb Manual QA fixes 2025-06-23 11:57:06 +02:00
Matej Bačo c1bd493fbe Move refferer to resource; re-use in OPTIONS; re-use in platform check 2025-06-23 11:28:18 +02:00
Khushboo Verma 1319bf7ec1 Fix connect to existing repo flow 2025-06-21 01:41:41 +04:00
shimon d8c88fb420 composer 2025-06-19 19:44:33 +03:00
shimon 68fc0f898f set log projectId on the router method 2025-06-19 17:15:43 +03:00
shimon 0f8c5fe292 Merge branch '1.7.x', commit 'c0c30fe767f8c197b8793bf562f57146e5ba15a8' of github.com:appwrite/appwrite into PLA-3018 2025-06-19 12:46:34 +03:00
shimon c0c30fe767 remove duplicate use 2025-06-15 12:40:22 +03:00
shimon d7e2552999 Merge branch '1.7.x' of github.com:appwrite/appwrite into PLA-3018 2025-06-15 12:38:50 +03:00
shimon 7d54a6191d remove duplicate use 2025-06-15 12:13:15 +03:00
shimon 4d41c90367 remove duplicate use 2025-06-15 12:00:39 +03:00
shimon 96c035401b Override project resource to update hooks, since x-appwrite-project is not available when executing custom domain function 2025-06-15 11:30:57 +03:00
Khushboo VermaandGitHub 28db9a289b Merge branch '1.7.x' into feat-add-branch-url-for-first-git-deployment 2025-06-13 19:08:14 +05:30
Khushboo Verma fc656167d5 Composer update 2025-06-13 18:11:51 +05:30
Khushboo Verma 37388fcf1b Change php version in composer.lock 2025-06-13 18:08:19 +05:30
Khushboo Verma 55be41f633 Resolve merge conflicts 2025-06-13 18:06:47 +05:30
Khushboo VermaandGitHub ef12f49277 Merge branch '1.7.x' into feat-add-branch-url-for-first-git-deployment 2025-06-10 13:08:34 +05:30
Khushboo Verma fa8e5b5b8e Add commit url 2025-06-04 19:11:07 +05:30
Khushboo Verma 54552bf1b4 Create branch url for first git deployment 2025-06-04 18:34:01 +05:30
Khushboo Verma 6530d31e7a Use ->action(...)) 2025-06-04 14:07:43 +05:30
115 changed files with 679 additions and 348 deletions
+3 -2
View File
@@ -64,8 +64,9 @@ jobs:
sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg
sudo apt update
sudo apt install oha
oha --version
- name: Benchmark PR
run: 'oha -z 180s http://localhost/v1/health/version --output_format json > benchmark.json'
run: 'oha -z 180s http://localhost/v1/health/version --output-format json > benchmark.json'
- name: Cleaning
run: docker compose down -v
- name: Installing latest version
@@ -78,7 +79,7 @@ jobs:
docker compose up -d
sleep 10
- name: Benchmark Latest
run: oha -z 180s http://localhost/v1/health/version --output_format json > benchmark-latest.json
run: oha -z 180s http://localhost/v1/health/version --output-format json > benchmark-latest.json
- name: Prepare comment
run: |
echo '## :sparkles: Benchmark results' > benchmark.txt
+1 -1
View File
@@ -217,7 +217,7 @@ return [
[
'key' => 'cli',
'name' => 'Command Line',
'version' => '8.0.2',
'version' => '8.1.0',
'url' => 'https://github.com/appwrite/sdk-for-cli',
'package' => 'https://www.npmjs.com/package/appwrite-cli',
'enabled' => true,
+18 -1
View File
@@ -18,6 +18,7 @@ use Appwrite\Utopia\Database\Validator\Queries\Buckets;
use Appwrite\Utopia\Database\Validator\Queries\Files;
use Appwrite\Utopia\Response;
use Utopia\App;
use Utopia\CLI\Console;
use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Database\DateTime;
@@ -953,12 +954,14 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
->param('output', '', new WhiteList(\array_keys(Config::getParam('storage-outputs')), true), 'Output format type (jpeg, jpg, png, gif and webp).', true)
// NOTE: this is only for the sdk generator and is not used in the action below and is utilised in `resources.php` for `resourceToken`.
->param('token', '', new Text(512), 'File token for accessing this file.', true)
->inject('request')
->inject('response')
->inject('dbForProject')
->inject('resourceToken')
->inject('deviceForFiles')
->inject('deviceForLocal')
->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, ?string $token, Response $response, Database $dbForProject, Document $resourceToken, Device $deviceForFiles, Device $deviceForLocal) {
->inject('project')
->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, ?string $token, Request $request, Response $response, Database $dbForProject, Document $resourceToken, Device $deviceForFiles, Device $deviceForLocal, Document $project) {
if (!\extension_loaded('imagick')) {
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Imagick extension is missing');
@@ -1035,8 +1038,12 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
$output = empty($type) ? (array_search($mime, $outputs) ?? 'jpg') : $type;
}
$startTime = \microtime(true);
$source = $deviceForFiles->read($path);
$downloadTime = \microtime(true) - $startTime;
if (!empty($cipher)) { // Decrypt
$source = OpenSSL::decrypt(
$source,
@@ -1048,6 +1055,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
);
}
$decryptionTime = \microtime(true) - $startTime - $downloadTime;
switch ($algorithm) {
case Compression::ZSTD:
$compressor = new Zstd();
@@ -1059,6 +1068,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
break;
}
$decompressionTime = \microtime(true) - $startTime - $downloadTime - $decryptionTime;
try {
$image = new Image($source);
} catch (ImagickException $e) {
@@ -1089,6 +1100,12 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
$data = $image->output($output, $quality);
$renderingTime = \microtime(true) - $startTime - $downloadTime - $decryptionTime - $decompressionTime;
$totalTime = \microtime(true) - $startTime;
Console::info("File preview rendered,project=" . $project->getId() . ",bucket=" . $bucketId . ",file=" . $file->getId() . ",uri=" . $request->getURI() . ",total=" . $totalTime . ",rendering=" . $renderingTime . ",decryption=" . $decryptionTime . ",decompression=" . $decompressionTime . ",download=" . $downloadTime);
$contentType = (\array_key_exists($output, $outputs)) ? $outputs[$output] : $outputs['jpg'];
//Do not update transformedAt if it's a console user
+2
View File
@@ -649,6 +649,8 @@ App::get('/v1/users')
$total = $dbForProject->count('users', $filterQueries, APP_LIMIT_COUNT);
} catch (OrderException $e) {
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
} catch (QueryException $e) {
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
}
$response->dynamic(new Document([
'users' => $users,
+29 -46
View File
@@ -56,7 +56,7 @@ Config::setParam('domainVerification', false);
Config::setParam('cookieDomain', 'localhost');
Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE);
function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey)
function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey)
{
$host = $request->getHostname() ?? '';
if (!empty($previewHostname)) {
@@ -118,6 +118,11 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw
$project->setAttribute('accessedAt', DateTime::now());
Authorization::skip(fn () => $dbForPlatform->updateDocument('projects', $project->getId(), $project));
}
/**
* Set projectId to update the Error hook logger, since x-appwrite-project is not available when executing custom domain function
*/
$log->addTag('projectId', $project->getId());
}
if (array_key_exists('proxy', $project->getAttribute('services', []))) {
@@ -787,13 +792,13 @@ App::init()
->inject('swooleRequest')
->inject('request')
->inject('response')
->inject('log')
->inject('console')
->inject('project')
->inject('dbForPlatform')
->inject('getProjectDB')
->inject('locale')
->inject('localeCodes')
->inject('clients')
->inject('geodb')
->inject('queueForStatsUsage')
->inject('queueForEvents')
@@ -804,7 +809,9 @@ App::init()
->inject('previewHostname')
->inject('devKey')
->inject('apiKey')
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Document $console, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, array $clients, Reader $geodb, StatsUsage $queueForStatsUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, Executor $executor, callable $isResourceBlocked, string $previewHostname, Document $devKey, ?Key $apiKey) {
->inject('httpReferrer')
->inject('httpReferrerSafe')
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Document $console, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, Reader $geodb, StatsUsage $queueForStatsUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, Executor $executor, callable $isResourceBlocked, string $previewHostname, Document $devKey, ?Key $apiKey, string $httpReferrer, string $httpReferrerSafe) {
/*
* Appwrite Router
*/
@@ -812,7 +819,7 @@ App::init()
$mainDomain = System::getEnv('_APP_DOMAIN', '');
// Only run Router when external domain
if ($host !== $mainDomain || !empty($previewHostname)) {
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) {
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) {
$utopia->getRoute()?->label('router', true);
}
}
@@ -936,42 +943,9 @@ App::init()
$locale->setDefault($localeParam);
}
$referrer = $request->getReferer();
$origin = \parse_url($request->getOrigin($referrer), PHP_URL_HOST);
$protocol = \parse_url($request->getOrigin($referrer), PHP_URL_SCHEME);
$port = \parse_url($request->getOrigin($referrer), PHP_URL_PORT);
$refDomainOrigin = 'localhost';
$validator = new Hostname($clients);
if ($validator->isValid($origin)) {
$refDomainOrigin = $origin;
} elseif (!empty($origin)) {
// Auto-allow domains with linked rule
if (System::getEnv('_APP_RULES_FORMAT') === 'md5') {
$rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', md5($origin ?? '')));
} else {
$rule = Authorization::skip(
fn () => $dbForPlatform->find('rules', [
Query::equal('domain', [$origin]),
Query::limit(1)
])
)[0] ?? new Document();
}
if (!$rule->isEmpty() && $rule->getAttribute('projectInternalId') === $project->getSequence()) {
$refDomainOrigin = $origin;
}
}
$refDomain = (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $refDomainOrigin . (!empty($port) ? ':' . $port : '');
$refDomain = (!$route->getLabel('origin', false)) // This route is publicly accessible
? $refDomain
: (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $origin . (!empty($port) ? ':' . $port : '');
$origin = \parse_url($request->getOrigin($httpReferrer), PHP_URL_HOST);
$selfDomain = new Domain($request->getHostname());
$endDomain = new Domain((string)$origin);
Config::setParam(
'domainVerification',
($selfDomain->getRegisterable() === $endDomain->getRegisterable()) &&
@@ -1043,7 +1017,7 @@ App::init()
->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE')
->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Dev-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-Appwrite-Timeout, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-SDK-GraphQL, X-Appwrite-ID, X-Appwrite-Timestamp, Content-Range, Range, Cache-Control, Expires, Pragma, X-Forwarded-For, X-Forwarded-User-Agent')
->addHeader('Access-Control-Expose-Headers', 'X-Appwrite-Session, X-Fallback-Cookies')
->addHeader('Access-Control-Allow-Origin', $refDomain)
->addHeader('Access-Control-Allow-Origin', $httpReferrerSafe)
->addHeader('Access-Control-Allow-Credentials', 'true');
if (!$devKey->isEmpty()) {
@@ -1064,6 +1038,7 @@ App::init()
&& \in_array($request->getMethod(), [Request::METHOD_POST, Request::METHOD_PUT, Request::METHOD_PATCH, Request::METHOD_DELETE])
&& $route->getLabel('origin', false) !== '*'
&& empty($request->getHeader('x-appwrite-key', ''))
&& \parse_url($httpReferrerSafe, PHP_URL_HOST) === 'localhost'
) {
throw new AppwriteException(AppwriteException::GENERAL_UNKNOWN_ORIGIN, $originValidator->getDescription());
}
@@ -1074,6 +1049,7 @@ App::options()
->inject('swooleRequest')
->inject('request')
->inject('response')
->inject('log')
->inject('dbForPlatform')
->inject('getProjectDB')
->inject('queueForEvents')
@@ -1086,7 +1062,7 @@ App::options()
->inject('project')
->inject('devKey')
->inject('apiKey')
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, Document $project, Document $devKey, ?Key $apiKey) {
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, Document $project, Document $devKey, ?Key $apiKey) {
/*
* Appwrite Router
*/
@@ -1094,7 +1070,7 @@ App::options()
$mainDomain = System::getEnv('_APP_DOMAIN', '');
// Only run Router when external domain
if ($host !== $mainDomain || !empty($previewHostname)) {
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) {
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) {
$utopia->getRoute()?->label('router', true);
}
}
@@ -1267,7 +1243,12 @@ App::error()
$log->addTag('url', $request->getURI());
$log->addTag('verboseType', get_class($error));
$log->addTag('code', $error->getCode());
$log->addTag('projectId', $project->getId());
$tags = $log->getTags();
if (!isset($tags['projectId'])) {
$log->addTag('projectId', $project->getId());
}
$log->addTag('hostname', $request->getHostname());
$log->addTag('locale', (string)$request->getParam('locale', $request->getHeader('x-appwrite-locale', '')));
@@ -1385,6 +1366,7 @@ App::get('/robots.txt')
->inject('swooleRequest')
->inject('request')
->inject('response')
->inject('log')
->inject('dbForPlatform')
->inject('getProjectDB')
->inject('queueForEvents')
@@ -1395,7 +1377,7 @@ App::get('/robots.txt')
->inject('isResourceBlocked')
->inject('previewHostname')
->inject('apiKey')
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) {
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) {
$host = $request->getHostname() ?? '';
$mainDomain = System::getEnv('_APP_DOMAIN', '');
@@ -1403,7 +1385,7 @@ App::get('/robots.txt')
$template = new View(__DIR__ . '/../views/general/robots.phtml');
$response->text($template->render(false));
} else {
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) {
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) {
$utopia->getRoute()?->label('router', true);
}
}
@@ -1417,6 +1399,7 @@ App::get('/humans.txt')
->inject('swooleRequest')
->inject('request')
->inject('response')
->inject('log')
->inject('dbForPlatform')
->inject('getProjectDB')
->inject('queueForEvents')
@@ -1427,7 +1410,7 @@ App::get('/humans.txt')
->inject('isResourceBlocked')
->inject('previewHostname')
->inject('apiKey')
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) {
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) {
$host = $request->getHostname() ?? '';
$mainDomain = System::getEnv('_APP_DOMAIN', '');
@@ -1435,7 +1418,7 @@ App::get('/humans.txt')
$template = new View(__DIR__ . '/../views/general/humans.phtml');
$response->text($template->render(false));
} else {
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) {
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) {
$utopia->getRoute()?->label('router', true);
}
}
+14 -4
View File
@@ -22,6 +22,7 @@ use Utopia\Abuse\Abuse;
use Utopia\App;
use Utopia\Cache\Adapter\Filesystem;
use Utopia\Cache\Cache;
use Utopia\CLI\Console;
use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Database\DateTime;
@@ -563,7 +564,7 @@ App::init()
$cache = new Cache(
new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId())
);
$timestamp = 60 * 60 * 24 * 30;
$timestamp = 60 * 60 * 24 * 180; // Temporarily increase the TTL to 180 day to ensure files in the cache are still fetched.
$data = $cache->load($key, $timestamp);
if (!empty($data) && !$cacheLog->isEmpty()) {
@@ -797,6 +798,12 @@ App::shutdown()
}
if (!empty($queueForDatabase->getType())) {
Console::info("Triggering database event: \n" . \json_encode([
'projectId' => $project->getId(),
'databaseId' => $queueForDatabase->getDatabase()?->getId(),
'collectionId' => $queueForDatabase->getCollection()?->getId(),
'documentId' => $queueForDatabase->getDocument()?->getId(),
]));
$queueForDatabase->trigger();
}
@@ -824,6 +831,10 @@ App::shutdown()
$resourceType = $parseLabel($pattern, $responsePayload, $requestParams, $user);
}
$cache = new Cache(
new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId())
);
$key = $request->cacheIdentifier();
$signature = md5($data['payload']);
$cacheLog = Authorization::skip(fn () => $dbForProject->getDocument('cache', $key));
@@ -841,12 +852,11 @@ App::shutdown()
} elseif (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_CACHE_UPDATE)) > $accessedAt) {
$cacheLog->setAttribute('accessedAt', $now);
Authorization::skip(fn () => $dbForProject->updateDocument('cache', $cacheLog->getId(), $cacheLog));
// Overwrite the file every APP_CACHE_UPDATE seconds to update the file modified time that is used in the TTL checks in cache->load()
$cache->save($key, $data['payload']);
}
if ($signature !== $cacheLog->getAttribute('signature')) {
$cache = new Cache(
new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId())
);
$cache->save($key, $data['payload']);
}
}
+2 -1
View File
@@ -36,7 +36,8 @@ App::setMode(System::getEnv('_APP_ENV', App::MODE_TYPE_PRODUCTION));
if (!App::isProduction()) {
// Allow specific domains to skip public domain validation in dev environment
// Useful for existing tests involving webhooks
PublicDomain::allow(['request-catcher']);
PublicDomain::allow(['request-catcher-sms']);
PublicDomain::allow(['request-catcher-webhook']);
}
$register->set('logger', function () {
// Register error logger
+49
View File
@@ -944,3 +944,52 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) {
}
return new Document([]);
}, ['project', 'dbForProject', 'request']);
App::setResource('httpReferrer', function (Request $request): string {
$referrer = $request->getReferer();
return $referrer;
}, ['request']);
App::setResource('httpReferrerSafe', function (Request $request, string $httpReferrer, array $clients, Database $dbForPlatform, Document $project, App $utopia): string {
$origin = \parse_url($request->getOrigin($httpReferrer), PHP_URL_HOST);
$protocol = \parse_url($request->getOrigin($httpReferrer), PHP_URL_SCHEME);
$port = \parse_url($request->getOrigin($httpReferrer), PHP_URL_PORT);
$referrer = (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $origin . (!empty($port) ? ':' . $port : '');
// Safe if route is publicly accessible
$route = $utopia->getRoute();
if ($route->getLabel('origin', false)) {
return $referrer;
}
// Safe if added as web platform
$validator = new Hostname($clients);
if ($validator->isValid($origin)) {
return $referrer;
}
// Safe if rule with same project ID exists
if (!empty($origin)) {
if (System::getEnv('_APP_RULES_FORMAT') === 'md5') {
$rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', md5($origin ?? '')));
} else {
$rule = Authorization::skip(
fn () => $dbForPlatform->find('rules', [
Query::equal('domain', [$origin]),
Query::limit(1)
])
)[0] ?? new Document();
}
if (!$rule->isEmpty() && $rule->getAttribute('projectInternalId') === $project->getSequence()) {
return $referrer;
}
}
// Unsafe; Localhost is always safe for ease of local development
$origin = 'localhost';
$protocol = \parse_url($request->getOrigin($httpReferrer), PHP_URL_SCHEME);
$port = \parse_url($request->getOrigin($httpReferrer), PHP_URL_PORT);
$referrer = (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $origin . (!empty($port) ? ':' . $port : '');
return $referrer;
}, ['request', 'httpReferrer', 'clients', 'dbForPlatform', 'project', 'utopia']);
+1 -1
View File
@@ -67,7 +67,7 @@
"utopia-php/platform": "0.7.*",
"utopia-php/pools": "0.8.*",
"utopia-php/preloader": "0.2.*",
"utopia-php/queue": "0.11.0",
"utopia-php/queue": "0.12.*",
"utopia-php/registry": "0.5.*",
"utopia-php/storage": "0.18.*",
"utopia-php/swoole": "0.8.*",
Generated
+190 -175
View File
@@ -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": "55bc52686a08d64930e6af7411ac0654",
"content-hash": "beacba1fc087db3ab9f9d718b28c5876",
"packages": [
{
"name": "adhocore/jwt",
@@ -67,6 +67,99 @@
],
"time": "2025-02-18T01:00:50+00:00"
},
{
"name": "appwrite-labs/php-amqplib",
"version": "0.1.1",
"source": {
"type": "git",
"url": "https://github.com/appwrite-labs/php-amqplib.git",
"reference": "bd380cbd63c8c0f063a3893b7a0b889d40876861"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/appwrite-labs/php-amqplib/zipball/bd380cbd63c8c0f063a3893b7a0b889d40876861",
"reference": "bd380cbd63c8c0f063a3893b7a0b889d40876861",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-sockets": "*",
"php": "^7.2||^8.0",
"phpseclib/phpseclib": "^2.0|^3.0"
},
"conflict": {
"php": "7.4.0 - 7.4.1"
},
"replace": {
"php-amqplib/php-amqplib": "self.version",
"videlalvaro/php-amqplib": "self.version"
},
"require-dev": {
"ext-curl": "*",
"nategood/httpful": "^0.2.20",
"phpunit/phpunit": "^7.5|^9.5",
"squizlabs/php_codesniffer": "^3.6",
"swoole/ide-helper": "^5.0"
},
"suggest": {
"ext-swoole": "For Swoole coroutine support"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-4": {
"PhpAmqpLib\\": "PhpAmqpLib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Appwrite Labs",
"email": "team@appwrite.io",
"role": "Fork Maintainer"
},
{
"name": "Alvaro Videla",
"role": "Original Maintainer"
},
{
"name": "Raúl Araya",
"email": "nubeiro@gmail.com",
"role": "Maintainer"
},
{
"name": "Luke Bakken",
"email": "luke@bakken.io",
"role": "Maintainer"
},
{
"name": "Ramūnas Dronga",
"email": "github@ramuno.lt",
"role": "Maintainer"
}
],
"description": "Fork of php-amqplib with Swoole coroutine support. A pure PHP implementation of the AMQP protocol tested against RabbitMQ.",
"homepage": "https://github.com/appwrite-labs/php-amqplib/",
"keywords": [
"async",
"coroutine",
"message",
"queue",
"rabbitmq",
"swoole"
],
"support": {
"source": "https://github.com/appwrite-labs/php-amqplib/tree/0.1.1"
},
"time": "2025-06-24T18:12:57+00:00"
},
{
"name": "appwrite/appwrite",
"version": "11.1.0",
@@ -1113,16 +1206,16 @@
},
{
"name": "open-telemetry/api",
"version": "1.3.0",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/opentelemetry-php/api.git",
"reference": "4e3bb38e069876fb73c2ce85c89583bf2b28cd86"
"reference": "b3a9286f9c1c8247c83493c5b1fa475cd0cec7f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opentelemetry-php/api/zipball/4e3bb38e069876fb73c2ce85c89583bf2b28cd86",
"reference": "4e3bb38e069876fb73c2ce85c89583bf2b28cd86",
"url": "https://api.github.com/repos/opentelemetry-php/api/zipball/b3a9286f9c1c8247c83493c5b1fa475cd0cec7f7",
"reference": "b3a9286f9c1c8247c83493c5b1fa475cd0cec7f7",
"shasum": ""
},
"require": {
@@ -1142,7 +1235,7 @@
]
},
"branch-alias": {
"dev-main": "1.1.x-dev"
"dev-main": "1.4.x-dev"
}
},
"autoload": {
@@ -1179,7 +1272,7 @@
"issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
"source": "https://github.com/open-telemetry/opentelemetry-php"
},
"time": "2025-05-07T12:32:21+00:00"
"time": "2025-06-19T23:36:51+00:00"
},
{
"name": "open-telemetry/context",
@@ -1242,16 +1335,16 @@
},
{
"name": "open-telemetry/exporter-otlp",
"version": "1.3.1",
"version": "1.3.2",
"source": {
"type": "git",
"url": "https://github.com/opentelemetry-php/exporter-otlp.git",
"reference": "8b3ca1f86d01429c73b407bf1a2075d9c187001e"
"reference": "196f3a1dbce3b2c0f8110d164232c11ac00ddbb2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/8b3ca1f86d01429c73b407bf1a2075d9c187001e",
"reference": "8b3ca1f86d01429c73b407bf1a2075d9c187001e",
"url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/196f3a1dbce3b2c0f8110d164232c11ac00ddbb2",
"reference": "196f3a1dbce3b2c0f8110d164232c11ac00ddbb2",
"shasum": ""
},
"require": {
@@ -1302,7 +1395,7 @@
"issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
"source": "https://github.com/open-telemetry/opentelemetry-php"
},
"time": "2025-05-21T12:02:20+00:00"
"time": "2025-06-16T00:24:51+00:00"
},
{
"name": "open-telemetry/gen-otlp-protobuf",
@@ -1369,22 +1462,22 @@
},
{
"name": "open-telemetry/sdk",
"version": "1.5.0",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/opentelemetry-php/sdk.git",
"reference": "cd0d7367599717fc29e04eb8838ec061e6c2c657"
"reference": "1c0371794e4c0700afd4a9d4d8511cb5e3f78e6a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/cd0d7367599717fc29e04eb8838ec061e6c2c657",
"reference": "cd0d7367599717fc29e04eb8838ec061e6c2c657",
"url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/1c0371794e4c0700afd4a9d4d8511cb5e3f78e6a",
"reference": "1c0371794e4c0700afd4a9d4d8511cb5e3f78e6a",
"shasum": ""
},
"require": {
"ext-json": "*",
"nyholm/psr7-server": "^1.1",
"open-telemetry/api": "~1.0 || ~1.1",
"open-telemetry/api": "~1.4.0",
"open-telemetry/context": "^1.0",
"open-telemetry/sem-conv": "^1.0",
"php": "^8.1",
@@ -1407,6 +1500,10 @@
"type": "library",
"extra": {
"spi": {
"OpenTelemetry\\API\\Configuration\\ConfigEnv\\EnvComponentLoader": [
"OpenTelemetry\\API\\Instrumentation\\Configuration\\General\\ConfigEnv\\EnvComponentLoaderHttpConfig",
"OpenTelemetry\\API\\Instrumentation\\Configuration\\General\\ConfigEnv\\EnvComponentLoaderPeerConfig"
],
"OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [
"OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager"
]
@@ -1455,20 +1552,20 @@
"issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
"source": "https://github.com/open-telemetry/opentelemetry-php"
},
"time": "2025-05-22T02:33:34+00:00"
"time": "2025-06-19T23:36:51+00:00"
},
{
"name": "open-telemetry/sem-conv",
"version": "1.32.0",
"version": "1.32.1",
"source": {
"type": "git",
"url": "https://github.com/opentelemetry-php/sem-conv.git",
"reference": "16585cc0dbc3032a318e274043454679430d2ebf"
"reference": "94daa85ea61a8e2b7e1b0af6be0e875bedda7c22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/16585cc0dbc3032a318e274043454679430d2ebf",
"reference": "16585cc0dbc3032a318e274043454679430d2ebf",
"url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/94daa85ea61a8e2b7e1b0af6be0e875bedda7c22",
"reference": "94daa85ea61a8e2b7e1b0af6be0e875bedda7c22",
"shasum": ""
},
"require": {
@@ -1512,7 +1609,7 @@
"issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
"source": "https://github.com/open-telemetry/opentelemetry-php"
},
"time": "2025-05-05T03:58:53+00:00"
"time": "2025-06-24T02:32:27+00:00"
},
{
"name": "paragonie/constant_time_encoding",
@@ -1631,87 +1728,6 @@
},
"time": "2020-10-15T08:29:30+00:00"
},
{
"name": "php-amqplib/php-amqplib",
"version": "v3.7.3",
"source": {
"type": "git",
"url": "https://github.com/php-amqplib/php-amqplib.git",
"reference": "9f50fe69a9f1a19e2cb25596a354d705de36fe59"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/9f50fe69a9f1a19e2cb25596a354d705de36fe59",
"reference": "9f50fe69a9f1a19e2cb25596a354d705de36fe59",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-sockets": "*",
"php": "^7.2||^8.0",
"phpseclib/phpseclib": "^2.0|^3.0"
},
"conflict": {
"php": "7.4.0 - 7.4.1"
},
"replace": {
"videlalvaro/php-amqplib": "self.version"
},
"require-dev": {
"ext-curl": "*",
"nategood/httpful": "^0.2.20",
"phpunit/phpunit": "^7.5|^9.5",
"squizlabs/php_codesniffer": "^3.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-4": {
"PhpAmqpLib\\": "PhpAmqpLib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Alvaro Videla",
"role": "Original Maintainer"
},
{
"name": "Raúl Araya",
"email": "nubeiro@gmail.com",
"role": "Maintainer"
},
{
"name": "Luke Bakken",
"email": "luke@bakken.io",
"role": "Maintainer"
},
{
"name": "Ramūnas Dronga",
"email": "github@ramuno.lt",
"role": "Maintainer"
}
],
"description": "Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.",
"homepage": "https://github.com/php-amqplib/php-amqplib/",
"keywords": [
"message",
"queue",
"rabbitmq"
],
"support": {
"issues": "https://github.com/php-amqplib/php-amqplib/issues",
"source": "https://github.com/php-amqplib/php-amqplib/tree/v3.7.3"
},
"time": "2025-02-18T20:11:13+00:00"
},
{
"name": "php-http/discovery",
"version": "1.20.0",
@@ -1874,16 +1890,16 @@
},
{
"name": "phpseclib/phpseclib",
"version": "3.0.44",
"version": "3.0.46",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "1d0b5e7e1434678411787c5a0535e68907cf82d9"
"reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/1d0b5e7e1434678411787c5a0535e68907cf82d9",
"reference": "1d0b5e7e1434678411787c5a0535e68907cf82d9",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6",
"reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6",
"shasum": ""
},
"require": {
@@ -1964,7 +1980,7 @@
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.44"
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.46"
},
"funding": [
{
@@ -1980,7 +1996,7 @@
"type": "tidelift"
}
],
"time": "2025-06-15T09:59:26+00:00"
"time": "2025-06-26T16:29:55+00:00"
},
{
"name": "psr/container",
@@ -2323,21 +2339,20 @@
},
{
"name": "ramsey/uuid",
"version": "4.8.1",
"version": "4.9.0",
"source": {
"type": "git",
"url": "https://github.com/ramsey/uuid.git",
"reference": "fdf4dd4e2ff1813111bd0ad58d7a1ddbb5b56c28"
"reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/fdf4dd4e2ff1813111bd0ad58d7a1ddbb5b56c28",
"reference": "fdf4dd4e2ff1813111bd0ad58d7a1ddbb5b56c28",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/4e0e23cc785f0724a0e838279a9eb03f28b092a0",
"reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0",
"shasum": ""
},
"require": {
"brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13",
"ext-json": "*",
"php": "^8.0",
"ramsey/collection": "^1.2 || ^2.0"
},
@@ -2396,9 +2411,9 @@
],
"support": {
"issues": "https://github.com/ramsey/uuid/issues",
"source": "https://github.com/ramsey/uuid/tree/4.8.1"
"source": "https://github.com/ramsey/uuid/tree/4.9.0"
},
"time": "2025-06-01T06:28:46+00:00"
"time": "2025-06-25T14:20:11+00:00"
},
{
"name": "spomky-labs/otphp",
@@ -2544,16 +2559,16 @@
},
{
"name": "symfony/http-client",
"version": "v7.3.0",
"version": "v7.3.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-client.git",
"reference": "57e4fb86314015a695a750ace358d07a7e37b8a9"
"reference": "4403d87a2c16f33345dca93407a8714ee8c05a64"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-client/zipball/57e4fb86314015a695a750ace358d07a7e37b8a9",
"reference": "57e4fb86314015a695a750ace358d07a7e37b8a9",
"url": "https://api.github.com/repos/symfony/http-client/zipball/4403d87a2c16f33345dca93407a8714ee8c05a64",
"reference": "4403d87a2c16f33345dca93407a8714ee8c05a64",
"shasum": ""
},
"require": {
@@ -2565,6 +2580,7 @@
},
"conflict": {
"amphp/amp": "<2.5",
"amphp/socket": "<1.1",
"php-http/discovery": "<1.15",
"symfony/http-foundation": "<6.4"
},
@@ -2577,7 +2593,6 @@
"require-dev": {
"amphp/http-client": "^4.2.1|^5.0",
"amphp/http-tunnel": "^1.0|^2.0",
"amphp/socket": "^1.1",
"guzzlehttp/promises": "^1.4|^2.0",
"nyholm/psr7": "^1.0",
"php-http/httplug": "^1.0|^2.0",
@@ -2619,7 +2634,7 @@
"http"
],
"support": {
"source": "https://github.com/symfony/http-client/tree/v7.3.0"
"source": "https://github.com/symfony/http-client/tree/v7.3.1"
},
"funding": [
{
@@ -2635,7 +2650,7 @@
"type": "tidelift"
}
],
"time": "2025-05-02T08:23:16+00:00"
"time": "2025-06-28T07:58:39+00:00"
},
{
"name": "symfony/http-client-contracts",
@@ -2957,16 +2972,16 @@
},
{
"name": "tbachert/spi",
"version": "v1.0.3",
"version": "v1.0.5",
"source": {
"type": "git",
"url": "https://github.com/Nevay/spi.git",
"reference": "506a79c98e1a51522e76ee921ccb6c62d52faf3a"
"reference": "e7078767866d0a9e0f91d3f9d42a832df5e39002"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Nevay/spi/zipball/506a79c98e1a51522e76ee921ccb6c62d52faf3a",
"reference": "506a79c98e1a51522e76ee921ccb6c62d52faf3a",
"url": "https://api.github.com/repos/Nevay/spi/zipball/e7078767866d0a9e0f91d3f9d42a832df5e39002",
"reference": "e7078767866d0a9e0f91d3f9d42a832df5e39002",
"shasum": ""
},
"require": {
@@ -2984,7 +2999,7 @@
"extra": {
"class": "Nevay\\SPI\\Composer\\Plugin",
"branch-alias": {
"dev-main": "0.2.x-dev"
"dev-main": "1.0.x-dev"
},
"plugin-optional": true
},
@@ -3003,9 +3018,9 @@
],
"support": {
"issues": "https://github.com/Nevay/spi/issues",
"source": "https://github.com/Nevay/spi/tree/v1.0.3"
"source": "https://github.com/Nevay/spi/tree/v1.0.5"
},
"time": "2025-04-02T19:38:14+00:00"
"time": "2025-06-29T15:42:06+00:00"
},
{
"name": "thecodingmachine/safe",
@@ -3490,16 +3505,16 @@
},
{
"name": "utopia-php/database",
"version": "0.71.7",
"version": "0.71.8",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "aa0116b2380125907fc18c82662be8e74c54091f"
"reference": "7dff6b67a54f1a7f9d3f210db4c6e40d7052b79e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/aa0116b2380125907fc18c82662be8e74c54091f",
"reference": "aa0116b2380125907fc18c82662be8e74c54091f",
"url": "https://api.github.com/repos/utopia-php/database/zipball/7dff6b67a54f1a7f9d3f210db4c6e40d7052b79e",
"reference": "7dff6b67a54f1a7f9d3f210db4c6e40d7052b79e",
"shasum": ""
},
"require": {
@@ -3540,9 +3555,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/0.71.7"
"source": "https://github.com/utopia-php/database/tree/0.71.8"
},
"time": "2025-06-17T23:59:10+00:00"
"time": "2025-06-26T14:48:17+00:00"
},
{
"name": "utopia-php/detector",
@@ -3939,16 +3954,16 @@
},
{
"name": "utopia-php/messaging",
"version": "0.18.0",
"version": "0.18.1",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/messaging.git",
"reference": "c151aa5d4d475c788ca15c210b5b2017e21c41d6"
"reference": "5d1245207a61d7ca065daddad7ac5f1d5640152f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/messaging/zipball/c151aa5d4d475c788ca15c210b5b2017e21c41d6",
"reference": "c151aa5d4d475c788ca15c210b5b2017e21c41d6",
"url": "https://api.github.com/repos/utopia-php/messaging/zipball/5d1245207a61d7ca065daddad7ac5f1d5640152f",
"reference": "5d1245207a61d7ca065daddad7ac5f1d5640152f",
"shasum": ""
},
"require": {
@@ -3984,9 +3999,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/messaging/issues",
"source": "https://github.com/utopia-php/messaging/tree/0.18.0"
"source": "https://github.com/utopia-php/messaging/tree/0.18.1"
},
"time": "2025-05-15T05:00:03+00:00"
"time": "2025-06-26T18:26:07+00:00"
},
{
"name": "utopia-php/migration",
@@ -4096,16 +4111,16 @@
},
{
"name": "utopia-php/platform",
"version": "0.7.8",
"version": "0.7.9",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/platform.git",
"reference": "e3a4536c46f10988b1a446ec6b8dd8a9914be854"
"reference": "b061f523513b071ef7168e6dc1441364eb73f308"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/platform/zipball/e3a4536c46f10988b1a446ec6b8dd8a9914be854",
"reference": "e3a4536c46f10988b1a446ec6b8dd8a9914be854",
"url": "https://api.github.com/repos/utopia-php/platform/zipball/b061f523513b071ef7168e6dc1441364eb73f308",
"reference": "b061f523513b071ef7168e6dc1441364eb73f308",
"shasum": ""
},
"require": {
@@ -4114,7 +4129,7 @@
"php": ">=8.0",
"utopia-php/cli": "0.15.*",
"utopia-php/framework": "0.33.*",
"utopia-php/queue": "0.11.*"
"utopia-php/queue": "^0.12.0"
},
"require-dev": {
"laravel/pint": "1.*",
@@ -4140,9 +4155,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/platform/issues",
"source": "https://github.com/utopia-php/platform/tree/0.7.8"
"source": "https://github.com/utopia-php/platform/tree/0.7.9"
},
"time": "2025-05-30T10:05:43+00:00"
"time": "2025-06-24T20:21:05+00:00"
},
{
"name": "utopia-php/pools",
@@ -4251,21 +4266,21 @@
},
{
"name": "utopia-php/queue",
"version": "0.11.0",
"version": "0.12.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/queue.git",
"reference": "06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5"
"reference": "3a7603ee712c592bfc54af4a76f0426c428b5574"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/queue/zipball/06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5",
"reference": "06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5",
"url": "https://api.github.com/repos/utopia-php/queue/zipball/3a7603ee712c592bfc54af4a76f0426c428b5574",
"reference": "3a7603ee712c592bfc54af4a76f0426c428b5574",
"shasum": ""
},
"require": {
"appwrite-labs/php-amqplib": "^0.1",
"php": ">=8.3",
"php-amqplib/php-amqplib": "^3.7",
"utopia-php/cli": "0.15.*",
"utopia-php/fetch": "0.4.*",
"utopia-php/framework": "0.33.*",
@@ -4311,9 +4326,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/queue/issues",
"source": "https://github.com/utopia-php/queue/tree/0.11.0"
"source": "https://github.com/utopia-php/queue/tree/0.12.0"
},
"time": "2025-05-30T09:52:38+00:00"
"time": "2025-06-24T18:58:38+00:00"
},
{
"name": "utopia-php/registry",
@@ -4807,16 +4822,16 @@
"packages-dev": [
{
"name": "appwrite/sdk-generator",
"version": "0.41.8",
"version": "0.41.9",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator.git",
"reference": "93ffb24b25b376ca4423e3a5caf6f916673af4b2"
"reference": "61037c1ed9262308cab49c1d760f3278036ab694"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/93ffb24b25b376ca4423e3a5caf6f916673af4b2",
"reference": "93ffb24b25b376ca4423e3a5caf6f916673af4b2",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/61037c1ed9262308cab49c1d760f3278036ab694",
"reference": "61037c1ed9262308cab49c1d760f3278036ab694",
"shasum": ""
},
"require": {
@@ -4852,9 +4867,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.41.8"
"source": "https://github.com/appwrite/sdk-generator/tree/0.41.9"
},
"time": "2025-06-18T13:20:45+00:00"
"time": "2025-06-27T10:16:17+00:00"
},
{
"name": "doctrine/annotations",
@@ -5147,16 +5162,16 @@
},
{
"name": "matthiasmullie/minify",
"version": "1.3.74",
"version": "1.3.75",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/minify.git",
"reference": "a2593286a4135d03c6a6a9e9aeded5d41e931ce4"
"reference": "76ba4a5f555fd7bf4aa408af608e991569076671"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/a2593286a4135d03c6a6a9e9aeded5d41e931ce4",
"reference": "a2593286a4135d03c6a6a9e9aeded5d41e931ce4",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/76ba4a5f555fd7bf4aa408af608e991569076671",
"reference": "76ba4a5f555fd7bf4aa408af608e991569076671",
"shasum": ""
},
"require": {
@@ -5205,7 +5220,7 @@
],
"support": {
"issues": "https://github.com/matthiasmullie/minify/issues",
"source": "https://github.com/matthiasmullie/minify/tree/1.3.74"
"source": "https://github.com/matthiasmullie/minify/tree/1.3.75"
},
"funding": [
{
@@ -5213,7 +5228,7 @@
"type": "github"
}
],
"time": "2025-06-12T08:06:04+00:00"
"time": "2025-06-25T09:56:19+00:00"
},
{
"name": "matthiasmullie/path-converter",
@@ -7252,16 +7267,16 @@
},
{
"name": "symfony/console",
"version": "v7.3.0",
"version": "v7.3.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "66c1440edf6f339fd82ed6c7caa76cb006211b44"
"reference": "9e27aecde8f506ba0fd1d9989620c04a87697101"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/66c1440edf6f339fd82ed6c7caa76cb006211b44",
"reference": "66c1440edf6f339fd82ed6c7caa76cb006211b44",
"url": "https://api.github.com/repos/symfony/console/zipball/9e27aecde8f506ba0fd1d9989620c04a87697101",
"reference": "9e27aecde8f506ba0fd1d9989620c04a87697101",
"shasum": ""
},
"require": {
@@ -7326,7 +7341,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v7.3.0"
"source": "https://github.com/symfony/console/tree/v7.3.1"
},
"funding": [
{
@@ -7342,7 +7357,7 @@
"type": "tidelift"
}
],
"time": "2025-05-24T10:34:04+00:00"
"time": "2025-06-27T19:55:54+00:00"
},
{
"name": "symfony/filesystem",
+14 -4
View File
@@ -213,7 +213,7 @@ services:
appwrite-console:
<<: *x-logging
container_name: appwrite-console
image: appwrite/console:6.0.41
image: appwrite/console:6.1.2
restart: unless-stopped
networks:
- appwrite
@@ -323,7 +323,8 @@ services:
depends_on:
- redis
- mariadb
- request-catcher
- request-catcher-sms
- request-catcher-webhook
environment:
- _APP_ENV
- _APP_WORKER_PER_CORE
@@ -1075,15 +1076,24 @@ services:
networks:
- appwrite
request-catcher: # used mainly for dev tests
request-catcher-webhook: # used mainly for dev tests (mock HTTP webhook)
image: appwrite/requestcatcher:1.0.0
container_name: appwrite-requestcatcher
container_name: appwrite-requestcatcher-webhook
<<: *x-logging
ports:
- "9504:5000"
networks:
- appwrite
request-catcher-sms: # used mainly for dev tests (mock SMS auth secret)
image: appwrite/requestcatcher:1.0.0
container_name: appwrite-requestcatcher-sms
<<: *x-logging
ports:
- "9507:5000"
networks:
- appwrite
adminer:
image: adminer
container_name: appwrite-adminer
+61 -1
View File
@@ -1 +1,61 @@
# Change Log
# Change Log
## 8.1.0
* Add multi-region support to `init` command
* Update `init` command to clear previous configuration in `appwrite.json`
* Update localConfig to store multi-region endpoint
* Fix throw error when creating unknown attribute instead of timing out
* Fix equal comparison of large numbers and BigNumber instances using proper equality checks
* Fix duplication of reasons when comparing localConfig with remoteConfig
* Fix `firstOrNull()` to `firstOrNull` in types generation for dart
* Refactor to use `isCloud()` method consistently
## 8.0.2
* Add Type generation fixes:
* Properly handle enum attributes in dart, java and kotlin
* Fix initialisation of null attributes in dart's fromMap method
* Fix relationships and enums in swift
## 8.0.1
* Add `resourceId` and `resourceType` attributes to `createRedirectRule`
* Add `providerReference` to vcs command for getting repository contents
* Add warning comment to `bulk updateDocuments` method
* Fix type generation for enums in Typescript and PHP language
## 8.0.0
* Add `types` command to generate language specific typings for collections. Currently supports - `php`, `swift`, `dart`, `js`, `ts`, `kotlin` and `java`
* Update bulk operation docs to include experiment feature warnings
* Remove assistant service and commands
## 7.0.0
* Add `sites` command
* Add `tokens` command
* Add `devKeys` support to `projects` command
* Add `init site`, `pull site` and `push site` commands
* Add bulk operation methods like `createDocuments`, `deleteDocuments` etc.
* Add new upsert methods: `upsertDocument` and `upsertDocuments`
* Update GET requests to not include content-type header
## 6.2.3
* Fix hot swapping error in `python-ml` function
## 6.2.2
* Fix GitHub builds by adding `qemu-system` package
* Fix attribute creation timed out
## 6.2.1
* Add `listOrganizations` method to `organizations` service and fix init project command
## 6.2.0
* Add specifications support to CLI
* Update package version
* Fix: Missed specifications param when updating a function
+10
View File
@@ -54,6 +54,16 @@ class Database extends Event
return $this;
}
/**
* Returns set database for this event.
*
* @return null|Document
*/
public function getDatabase(): ?Document
{
return $this->database;
}
/**
* Set the collection for this database event.
*
+1 -1
View File
@@ -226,7 +226,7 @@ class Mapper
];
if (!$rule['required']) {
$fields[$escapedKey]['defaultValue'] = $rule['default'];
$fields[$escapedKey]['defaultValue'] = $rule['default'] ?? null;
}
}
+62
View File
@@ -3,7 +3,10 @@
namespace Appwrite\Platform;
use Swoole\Coroutine as Co;
use Utopia\CLI\Console;
use Utopia\Database\Database;
use Utopia\Database\DateTime;
use Utopia\Database\Document;
use Utopia\Database\Query;
use Utopia\Platform\Action as UtopiaAction;
@@ -16,6 +19,12 @@ class Action extends UtopiaAction
*/
protected mixed $logError;
protected array $filters = [
'subQueryKeys', 'subQueryWebhooks', 'subQueryPlatforms', 'subQueryProjectVariables', 'subQueryBlocks', 'subQueryDevKeys', // Project
'subQueryAuthenticators', 'subQuerySessions', 'subQueryTokens', 'subQueryChallenges', 'subQueryMemberships', 'subQueryTargets', 'subQueryTopicTargets',// Users
'subQueryVariables', // Sites
];
/**
* Foreach Document
* Call provided callback for each document in the collection
@@ -87,4 +96,57 @@ class Action extends UtopiaAction
$latestDocument = $results[array_key_last($results)];
}
}
public function disableSubqueries()
{
$filters = $this->filters;
foreach ($filters as $filter) {
Database::addFilter(
$filter,
function (mixed $value) {
return;
},
function (mixed $value, Document $document, Database $database) {
return [];
}
);
}
}
/**
* Dump Log Message
*
* Logs messages to console with timestamp, method context, and project details.
* Supports multiple log types: success, error, log, warning, and info (default).
*
* @param string $method The calling method name
* @param string $log The log message
* @param string $type The log type (success, error, log, warning, info)
* @param Document|null $project The project document for context
* @param string $collectionId The collection identifier
* @return void
*/
public function dump(string $method, string $log, string $type = 'info', ?Document $project = null, string $collectionId = ''): void
{
if (empty($project)) {
$project = new Document([]);
}
switch ($type) {
case 'success':
Console::success("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log);
break;
case 'error':
Console::error("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log);
break;
case 'log':
Console::log("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log);
break;
case 'warning':
Console::warning("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log);
break;
default:
Console::info("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log);
}
}
}
@@ -6,6 +6,7 @@ use Appwrite\Event\Build;
use Appwrite\Extend\Exception;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Exception\Duplicate;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
@@ -226,6 +227,73 @@ class Base extends Action
]))
);
if (!empty($commitDetails['commitHash'])) {
$domain = "commit-" . substr($commitDetails['commitHash'], 0, 16) . ".{$sitesDomain}";
$ruleId = md5($domain);
try {
Authorization::skip(
fn () => $dbForPlatform->createDocument('rules', new Document([
'$id' => $ruleId,
'projectId' => $project->getId(),
'projectInternalId' => $project->getSequence(),
'domain' => $domain,
'type' => 'deployment',
'trigger' => 'deployment',
'deploymentId' => $deployment->getId(),
'deploymentInternalId' => $deployment->getSequence(),
'deploymentResourceType' => 'site',
'deploymentResourceId' => $site->getId(),
'deploymentResourceInternalId' => $site->getSequence(),
'deploymentVcsProviderBranch' => $providerBranch,
'status' => 'verified',
'certificateId' => '',
'search' => implode(' ', [$ruleId, $domain]),
'owner' => 'Appwrite',
'region' => $project->getAttribute('region')
]))
);
} catch (Duplicate $err) {
// Ignore, rule already exists; will be updated by builds worker
}
}
// VCS branch preview
if (!empty($providerBranch)) {
$branchPrefix = substr($providerBranch, 0, 16);
if (strlen($providerBranch) > 16) {
$remainingChars = substr($providerBranch, 16);
$branchPrefix .= '-' . substr(hash('sha256', $remainingChars), 0, 7);
}
$resourceProjectHash = substr(hash('sha256', $site->getId() . $project->getId()), 0, 7);
$domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}";
$ruleId = md5($domain);
try {
Authorization::skip(
fn () => $dbForPlatform->createDocument('rules', new Document([
'$id' => $ruleId,
'projectId' => $project->getId(),
'projectInternalId' => $project->getSequence(),
'domain' => $domain,
'type' => 'deployment',
'trigger' => 'deployment',
'deploymentId' => $deployment->getId(),
'deploymentInternalId' => $deployment->getSequence(),
'deploymentResourceType' => 'site',
'deploymentResourceId' => $site->getId(),
'deploymentResourceInternalId' => $site->getSequence(),
'deploymentVcsProviderBranch' => $providerBranch,
'status' => 'verified',
'certificateId' => '',
'search' => implode(' ', [$ruleId, $domain]),
'owner' => 'Appwrite',
'region' => $project->getAttribute('region')
]))
);
} catch (Duplicate $err) {
// Ignore, rule already exists; will be updated by builds worker
}
}
$queueForBuilds
->setType(BUILD_TYPE_DEPLOYMENT)
->setResource($site)
@@ -57,7 +57,7 @@ class Get extends Action
->param('type', '', new WhiteList(['rules']), 'Resource type.')
->inject('response')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -87,7 +87,7 @@ class Create extends Action
->inject('deviceForLocal')
->inject('queueForBuilds')
->inject('plan')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -62,7 +62,7 @@ class Delete extends Action
->inject('queueForDeletes')
->inject('queueForEvents')
->inject('deviceForFunctions')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -61,7 +61,7 @@ class Get extends Action
->inject('dbForProject')
->inject('deviceForFunctions')
->inject('deviceForBuilds')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -62,7 +62,7 @@ class Create extends Action
->inject('queueForEvents')
->inject('queueForBuilds')
->inject('deviceForFunctions')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -49,7 +49,7 @@ class Get extends Action
->param('deploymentId', '', new UID(), 'Deployment ID.')
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -59,7 +59,7 @@ class Update extends Action
->inject('project')
->inject('queueForEvents')
->inject('executor')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -75,7 +75,7 @@ class Create extends Base
->inject('project')
->inject('queueForBuilds')
->inject('gitHub')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -72,7 +72,7 @@ class Create extends Base
->inject('queueForEvents')
->inject('queueForBuilds')
->inject('gitHub')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -57,7 +57,7 @@ class XList extends Action
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -94,7 +94,7 @@ class Create extends Base
->inject('queueForFunctions')
->inject('geodb')
->inject('executor')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -62,7 +62,7 @@ class Delete extends Base
->inject('dbForProject')
->inject('dbForPlatform')
->inject('queueForEvents')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -52,7 +52,7 @@ class Get extends Base
->param('executionId', '', new UID(), 'Execution ID.')
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -58,7 +58,7 @@ class XList extends Base
->param('queries', [], new Executions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -114,7 +114,7 @@ class Create extends Base
->inject('dbForPlatform')
->inject('request')
->inject('gitHub')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -61,7 +61,7 @@ class Delete extends Base
->inject('queueForDeletes')
->inject('queueForEvents')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -62,7 +62,7 @@ class Update extends Base
->inject('dbForProject')
->inject('queueForEvents')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -49,7 +49,7 @@ class Get extends Base
->param('functionId', '', new UID(), 'Function ID.')
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -104,7 +104,7 @@ class Update extends Base
->inject('dbForPlatform')
->inject('gitHub')
->inject('executor')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -56,7 +56,7 @@ class XList extends Base
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -47,7 +47,7 @@ class XList extends Base
]
))
->inject('response')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(Response $response)
@@ -48,7 +48,7 @@ class XList extends Base
))
->inject('response')
->inject('plan')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(Response $response, array $plan)
@@ -49,7 +49,7 @@ class Get extends Base
))
->param('templateId', '', new Text(128), 'Template ID.')
->inject('response')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $templateId, Response $response)
@@ -53,7 +53,7 @@ class XList extends Base
->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true)
->param('offset', 0, new Range(0, 5000), 'Offset the list of returned templates. Maximum offset is 5000.', true)
->inject('response')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(array $runtimes, array $usecases, int $limit, int $offset, Response $response)
@@ -55,7 +55,7 @@ class Get extends Base
->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $functionId, string $range, Response $response, Database $dbForProject)
@@ -52,7 +52,7 @@ class XList extends Base
->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $range, Response $response, Database $dbForProject)
@@ -65,7 +65,7 @@ class Create extends Base
->inject('dbForProject')
->inject('dbForPlatform')
->inject('project')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -57,7 +57,7 @@ class Delete extends Base
->inject('response')
->inject('dbForProject')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -53,7 +53,7 @@ class Get extends Base
->param('variableId', '', new UID(), 'Variable unique ID.', false)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $functionId, string $variableId, Response $response, Database $dbForProject)
@@ -61,7 +61,7 @@ class Update extends Base
->inject('response')
->inject('dbForProject')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -53,7 +53,7 @@ class XList extends Base
->param('functionId', '', new UID(), 'Function unique ID.', false)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $functionId, Response $response, Database $dbForProject)
@@ -75,7 +75,7 @@ class Builds extends Action
->inject('log')
->inject('executor')
->inject('plan')
->callback([$this, 'action']);
->callback($this->action(...));
}
/**
@@ -445,7 +445,7 @@ class Builds extends Action
Console::execute('rsync -av --exclude \'.git\' ' . \escapeshellarg($tmpTemplateDirectory . '/' . $templateRootDirectory . '/') . ' ' . \escapeshellarg($tmpDirectory . '/' . $rootDirectory), '', $stdout, $stderr);
// Commit and push
$exit = Console::execute('git config --global user.email "team@appwrite.io" && git config --global user.name "Appwrite" && cd ' . \escapeshellarg($tmpDirectory) . ' && git add . && git commit -m "Create ' . \escapeshellarg($resource->getAttribute('name', '')) . ' function" && git push origin ' . \escapeshellarg($branchName), '', $stdout, $stderr);
$exit = Console::execute('git config --global user.email "team@appwrite.io" && git config --global user.name "Appwrite" && cd ' . \escapeshellarg($tmpDirectory) . ' && git checkout -b ' . \escapeshellarg($branchName) . ' && git add . && git commit -m "Create ' . \escapeshellarg($resource->getAttribute('name', '')) . ' function" && git push origin ' . \escapeshellarg($branchName), '', $stdout, $stderr);
if ($exit !== 0) {
throw new \Exception('Unable to push code repository: ' . $stderr);
@@ -57,7 +57,7 @@ class Create extends Action
->inject('user')
->inject('response')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $projectId, string $name, ?string $expire, Document $user, Response $response, Database $dbForPlatform)
@@ -49,7 +49,7 @@ class Delete extends Action
->param('keyId', '', new UID(), 'Key unique ID.')
->inject('response')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform)
@@ -49,7 +49,7 @@ class Get extends Action
->param('keyId', '', new UID(), 'Key unique ID.')
->inject('response')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform)
@@ -52,7 +52,7 @@ class Update extends Action
->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.')
->inject('response')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $projectId, string $keyId, string $name, ?string $expire, Response $response, Database $dbForPlatform)
{
@@ -53,7 +53,7 @@ class XList extends Action
->param('queries', [], new DevKeys(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', DevKeys::ALLOWED_ATTRIBUTES), true)
->inject('response')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $projectId, ?array $queries, Response $response, Database $dbForPlatform)
@@ -66,7 +66,7 @@ class Create extends Action
->inject('queueForCertificates')
->inject('queueForEvents')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $domain, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform)
@@ -71,7 +71,7 @@ class Create extends Action
->inject('queueForEvents')
->inject('dbForPlatform')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $domain, string $functionId, string $branch, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform, Database $dbForProject)
@@ -74,7 +74,7 @@ class Create extends Action
->inject('queueForEvents')
->inject('dbForPlatform')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $domain, string $url, int $statusCode, string $resourceId, string $resourceType, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform, Database $dbForProject)
@@ -71,7 +71,7 @@ class Create extends Action
->inject('queueForEvents')
->inject('dbForPlatform')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $domain, string $siteId, string $branch, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform, Database $dbForProject)
@@ -86,7 +86,7 @@ class Create extends Action
->inject('deviceForLocal')
->inject('queueForBuilds')
->inject('plan')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -62,7 +62,7 @@ class Delete extends Action
->inject('queueForDeletes')
->inject('queueForEvents')
->inject('deviceForSites')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -60,7 +60,7 @@ class Get extends Action
->inject('dbForProject')
->inject('deviceForSites')
->inject('deviceForBuilds')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -65,7 +65,7 @@ class Create extends Action
->inject('queueForEvents')
->inject('queueForBuilds')
->inject('deviceForSites')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -49,7 +49,7 @@ class Get extends Action
->param('deploymentId', '', new UID(), 'Deployment ID.')
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $siteId, string $deploymentId, Response $response, Database $dbForProject)
@@ -57,7 +57,7 @@ class Update extends Action
->inject('project')
->inject('queueForEvents')
->inject('executor')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -77,7 +77,7 @@ class Create extends Base
->inject('queueForEvents')
->inject('queueForBuilds')
->inject('gitHub')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -72,7 +72,7 @@ class Create extends Base
->inject('queueForEvents')
->inject('queueForBuilds')
->inject('gitHub')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -57,7 +57,7 @@ class XList extends Action
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $siteId, array $queries, string $search, Response $response, Database $dbForProject)
@@ -46,7 +46,7 @@ class XList extends Base
]
))
->inject('response')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(Response $response)
@@ -55,7 +55,7 @@ class Delete extends Base
->inject('response')
->inject('dbForProject')
->inject('queueForEvents')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $siteId, string $logId, Response $response, Database $dbForProject, Event $queueForEvents)
@@ -50,7 +50,7 @@ class Get extends Base
->param('logId', '', new UID(), 'Log ID.')
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $siteId, string $logId, Response $response, Database $dbForProject)
@@ -57,7 +57,7 @@ class XList extends Base
->param('queries', [], new Logs(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $siteId, array $queries, Response $response, Database $dbForProject)
@@ -89,7 +89,7 @@ class Create extends Base
->inject('project')
->inject('queueForEvents')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -58,7 +58,7 @@ class Delete extends Base
->inject('dbForProject')
->inject('queueForDeletes')
->inject('queueForEvents')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -60,7 +60,7 @@ class Update extends Base
->inject('dbForProject')
->inject('queueForEvents')
->inject('dbForPlatform')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -49,7 +49,7 @@ class Get extends Base
->param('siteId', '', new UID(), 'Site ID.')
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $siteId, Response $response, Database $dbForProject)
@@ -97,7 +97,7 @@ class Update extends Base
->inject('dbForPlatform')
->inject('gitHub')
->inject('executor')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -56,7 +56,7 @@ class XList extends Base
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(array $queries, string $search, Response $response, Database $dbForProject)
@@ -48,7 +48,7 @@ class XList extends Base
))
->inject('response')
->inject('plan')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(Response $response, array $plan)
@@ -49,7 +49,7 @@ class Get extends Base
))
->param('templateId', '', new Text(128), 'Template ID.')
->inject('response')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $templateId, Response $response)
@@ -53,7 +53,7 @@ class XList extends Base
->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true)
->param('offset', 0, new Range(0, 5000), 'Offset the list of returned templates. Maximum offset is 5000.', true)
->inject('response')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -55,7 +55,7 @@ class Get extends Base
->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -52,7 +52,7 @@ class XList extends Base
->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $range, Response $response, Database $dbForProject)
@@ -62,7 +62,7 @@ class Create extends Base
->inject('response')
->inject('dbForProject')
->inject('project')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $siteId, string $key, string $value, bool $secret, Response $response, Database $dbForProject, Document $project)
@@ -54,7 +54,7 @@ class Delete extends Base
->param('variableId', '', new UID(), 'Variable unique ID.', false)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $siteId, string $variableId, Response $response, Database $dbForProject)
@@ -53,7 +53,7 @@ class Get extends Base
->param('variableId', '', new UID(), 'Variable unique ID.', false)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $siteId, string $variableId, Response $response, Database $dbForProject)
@@ -58,7 +58,7 @@ class Update extends Base
->param('secret', null, new Boolean(), 'Secret variables can be updated or deleted, but only sites can read them during build and runtime.', true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -53,7 +53,7 @@ class XList extends Base
->param('siteId', '', new UID(), 'Site unique ID.', false)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(
@@ -65,7 +65,7 @@ class Create extends Action
->inject('response')
->inject('dbForProject')
->inject('queueForEvents')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $bucketId, string $fileId, ?string $expire, Response $response, Database $dbForProject, Event $queueForEvents): void
@@ -55,7 +55,7 @@ class XList extends Action
->param('queries', [], new FileTokens(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', FileTokens::ALLOWED_ATTRIBUTES), true)
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $bucketId, string $fileId, array $queries, Response $response, Database $dbForProject)
@@ -58,7 +58,7 @@ class Delete extends Action
->inject('response')
->inject('dbForProject')
->inject('queueForEvents')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $tokenId, Response $response, Database $dbForProject, Event $queueForEvents)
@@ -50,7 +50,7 @@ class Get extends Action
->param('tokenId', '', new UID(), 'Token ID.')
->inject('response')
->inject('dbForProject')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $tokenId, Response $response, Database $dbForProject)
@@ -61,7 +61,7 @@ class Update extends Action
->inject('response')
->inject('dbForProject')
->inject('queueForEvents')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $tokenId, ?string $expire, Response $response, Database $dbForProject, Event $queueForEvents)
+1 -1
View File
@@ -34,7 +34,7 @@ class Doctor extends Action
$this
->desc('Validate server health')
->inject('register')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(Registry $register): void
+1 -1
View File
@@ -31,7 +31,7 @@ class Install extends Action
->param('image', 'appwrite', new Text(0), 'Main appwrite docker image', true)
->param('interactive', 'Y', new Text(1), 'Run an interactive session', true)
->param('no-start', false, new Boolean(true), 'Run an interactive session', true)
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $httpPort, string $httpsPort, string $organization, string $image, string $interactive, bool $noStart): void
+1 -1
View File
@@ -29,7 +29,7 @@ class Maintenance extends Action
->inject('console')
->inject('queueForCertificates')
->inject('queueForDeletes')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(Database $dbForPlatform, Document $console, Certificate $queueForCertificates, Delete $queueForDeletes): void
+1 -1
View File
@@ -24,7 +24,7 @@ class QueueRetry extends Action
->param('name', '', new Text(100), 'Queue name')
->param('limit', 0, new Wildcard(), 'jobs limit', true)
->inject('publisher')
->callback([$this, 'action']);
->callback($this->action(...));
}
/**
+1 -1
View File
@@ -46,7 +46,7 @@ class SDKs extends Action
->param('git', null, new Nullable(new WhiteList(['yes', 'no'])), 'Should we use git push?', optional: true)
->param('production', null, new Nullable(new WhiteList(['yes', 'no'])), 'Should we push to production?', optional: true)
->param('message', null, new Nullable(new Text(256)), 'Commit Message', optional: true)
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(?string $selectedPlatform, ?string $selectedSDK, ?string $version, ?string $git, ?string $production, ?string $message): void
+1 -1
View File
@@ -24,7 +24,7 @@ class SSL extends Action
->param('domain', System::getEnv('_APP_DOMAIN', ''), new Hostname(), 'Domain to generate certificate for. If empty, main domain will be used.', true)
->param('skip-check', true, new Boolean(true), 'If DNS and renew check should be skipped. Defaults to true, and when true, all jobs will result in certificate generation attempt.', true)
->inject('queueForCertificates')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $domain, bool|string $skipCheck, Certificate $queueForCertificates): void
+1 -1
View File
@@ -21,7 +21,7 @@ class Screenshot extends Action
$this
->desc('Create Site template screenshot')
->param('templateId', '', new Text(128), 'Template ID.')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $templateId): void
@@ -45,7 +45,7 @@ class StatsResources extends Action
->inject('dbForPlatform')
->inject('logError')
->inject('queueForStatsResources')
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(Database $dbForPlatform, callable $logError, EventStatsResources $queue): void
@@ -53,11 +53,14 @@ class StatsResources extends Action
$this->logError = $logError;
$this->dbForPlatform = $dbForPlatform;
$this->disableSubqueries();
Console::title("Stats resources V1");
Console::success('Stats resources: started');
$interval = (int) System::getEnv('_APP_STATS_RESOURCES_INTERVAL', '3600');
Console::loop(function () use ($queue) {
Authorization::disable();
Authorization::setDefaultStatus(false);
+1 -1
View File
@@ -23,7 +23,7 @@ class Upgrade extends Install
->param('image', 'appwrite', new Text(0), 'Main appwrite docker image', true)
->param('interactive', 'Y', new Text(1), 'Run an interactive session', true)
->param('no-start', false, new Boolean(true), 'Run an interactive session', true)
->callback([$this, 'action']);
->callback($this->action(...));
}
public function action(string $httpPort, string $httpsPort, string $organization, string $image, string $interactive, bool $noStart): void

Some files were not shown because too many files have changed in this diff Show More