From 20c37db8fc5f285e30ed2dc8249e494683cbbc66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 19 Oct 2023 11:54:56 +0200 Subject: [PATCH 1/5] Upgrade executor --- app/views/install/compose.phtml | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index bc64effeec..898b46b3a5 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -667,7 +667,7 @@ services: <<: *x-logging restart: unless-stopped stop_signal: SIGINT - image: openruntimes/executor:0.4.4 + image: openruntimes/executor:0.4.5 networks: - appwrite - runtimes diff --git a/docker-compose.yml b/docker-compose.yml index 71d7365d14..42091e5e46 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -722,7 +722,7 @@ services: hostname: appwrite-executor <<: *x-logging stop_signal: SIGINT - image: openruntimes/executor:0.4.4 + image: openruntimes/executor:0.4.5 restart: unless-stopped networks: - appwrite From 23926e9530d39c308a6927b89e9a56541b7effb7 Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 19 Oct 2023 14:01:06 +0300 Subject: [PATCH 2/5] hard coding utopia logger to 0.3.1 --- composer.json | 2 +- composer.lock | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index f73fc02584..365e816b56 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,7 @@ "utopia-php/framework": "0.31.0", "utopia-php/image": "0.5.*", "utopia-php/locale": "0.4.*", - "utopia-php/logger": "0.3.*", + "utopia-php/logger": "0.3.1", "utopia-php/messaging": "0.1.*", "utopia-php/migration": "0.3.*", "utopia-php/orchestration": "0.9.*", diff --git a/composer.lock b/composer.lock index e0ab2c6aae..c6a13910ca 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6ff937a260c3e0c09de9eb5e073d830d", + "content-hash": "5f1e302b57b85e03be0b3983dc638486", "packages": [ { "name": "adhocore/jwt", @@ -2283,23 +2283,22 @@ }, { "name": "utopia-php/logger", - "version": "0.3.2", + "version": "0.3.1", "source": { "type": "git", "url": "https://github.com/utopia-php/logger.git", - "reference": "9151b7d16eab18d4c37c34643041cc0f33ca4a6c" + "reference": "de623f1ec1c672c795d113dd25c5bf212f7ef4fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/logger/zipball/9151b7d16eab18d4c37c34643041cc0f33ca4a6c", - "reference": "9151b7d16eab18d4c37c34643041cc0f33ca4a6c", + "url": "https://api.github.com/repos/utopia-php/logger/zipball/de623f1ec1c672c795d113dd25c5bf212f7ef4fc", + "reference": "de623f1ec1c672c795d113dd25c5bf212f7ef4fc", "shasum": "" }, "require": { "php": ">=8.0" }, "require-dev": { - "laravel/pint": "1.2.*", "phpstan/phpstan": "1.9.x-dev", "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.0.1" @@ -2331,9 +2330,9 @@ ], "support": { "issues": "https://github.com/utopia-php/logger/issues", - "source": "https://github.com/utopia-php/logger/tree/0.3.2" + "source": "https://github.com/utopia-php/logger/tree/0.3.1" }, - "time": "2023-10-16T08:16:19+00:00" + "time": "2023-02-10T15:52:50+00:00" }, { "name": "utopia-php/messaging", From c89bace5e46b1a1382dc09de7c76a7ecb5648d57 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 19 Oct 2023 12:25:10 +0000 Subject: [PATCH 3/5] chore: revert logger version --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 365e816b56..f73fc02584 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,7 @@ "utopia-php/framework": "0.31.0", "utopia-php/image": "0.5.*", "utopia-php/locale": "0.4.*", - "utopia-php/logger": "0.3.1", + "utopia-php/logger": "0.3.*", "utopia-php/messaging": "0.1.*", "utopia-php/migration": "0.3.*", "utopia-php/orchestration": "0.9.*", diff --git a/composer.lock b/composer.lock index c6a13910ca..288558bff6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5f1e302b57b85e03be0b3983dc638486", + "content-hash": "6ff937a260c3e0c09de9eb5e073d830d", "packages": [ { "name": "adhocore/jwt", From 8048766d28fdba15c818f5a247c0b85da4c582cb Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 19 Oct 2023 18:28:01 +0300 Subject: [PATCH 4/5] queues fixes --- app/controllers/api/proxy.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 1c0c929024..f9621fb05a 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -37,10 +37,11 @@ App::post('/v1/proxy/rules') ->param('resourceId', '', new UID(), 'ID of resource for the action type. If resourceType is "api", leave empty. If resourceType is "function", provide ID of the function.', true) ->inject('response') ->inject('project') - ->inject('events') + ->inject('queueForCertificates') + ->inject('queueForEvents') ->inject('dbForConsole') ->inject('dbForProject') - ->action(function (string $domain, string $resourceType, string $resourceId, Response $response, Document $project, Event $events, Database $dbForConsole, Database $dbForProject) { + ->action(function (string $domain, string $resourceType, string $resourceId, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForConsole, Database $dbForProject) { $mainDomain = App::getEnv('_APP_DOMAIN', ''); if ($domain === $mainDomain) { throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'You cannot assign your main domain to specific resource. Please use subdomain or a different domain.'); @@ -113,8 +114,7 @@ App::post('/v1/proxy/rules') if ($validator->isValid($domain->get())) { $status = 'verifying'; - $event = new Certificate(); - $event + $queueForCertificates ->setDomain(new Document([ 'domain' => $rule->getAttribute('domain') ])) @@ -125,7 +125,7 @@ App::post('/v1/proxy/rules') $rule->setAttribute('status', $status); $rule = $dbForConsole->createDocument('rules', $rule); - $events->setParam('ruleId', $rule->getId()); + $queueForEvents->setParam('ruleId', $rule->getId()); $rule->setAttribute('logs', ''); @@ -235,9 +235,9 @@ App::delete('/v1/proxy/rules/:ruleId') ->inject('response') ->inject('project') ->inject('dbForConsole') - ->inject('deletes') - ->inject('events') - ->action(function (string $ruleId, Response $response, Document $project, Database $dbForConsole, Delete $deletes, Event $events) { + ->inject('queueForDeletes') + ->inject('queueForEvents') + ->action(function (string $ruleId, Response $response, Document $project, Database $dbForConsole, Delete $queueForDeletes, Event $queueForEvents) { $rule = $dbForConsole->getDocument('rules', $ruleId); if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getInternalId()) { @@ -246,11 +246,11 @@ App::delete('/v1/proxy/rules/:ruleId') $dbForConsole->deleteDocument('rules', $rule->getId()); - $deletes + $queueForDeletes ->setType(DELETE_TYPE_DOCUMENT) ->setDocument($rule); - $events->setParam('ruleId', $rule->getId()); + $queueForEvents->setParam('ruleId', $rule->getId()); $response->noContent(); }); @@ -270,10 +270,11 @@ App::patch('/v1/proxy/rules/:ruleId/verification') ->label('sdk.response.model', Response::MODEL_PROXY_RULE) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') - ->inject('events') + ->inject('queueForCertificates') + ->inject('queueForEvents') ->inject('project') ->inject('dbForConsole') - ->action(function (string $ruleId, Response $response, Event $events, Document $project, Database $dbForConsole) { + ->action(function (string $ruleId, Response $response, Certificate $queueForCertificates, Event $queueForEvents, Document $project, Database $dbForConsole) { $rule = $dbForConsole->getDocument('rules', $ruleId); if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getInternalId()) { @@ -300,14 +301,13 @@ App::patch('/v1/proxy/rules/:ruleId/verification') $dbForConsole->updateDocument('rules', $rule->getId(), $rule->setAttribute('status', 'verifying')); // Issue a TLS certificate when domain is verified - $event = new Certificate(); - $event + $queueForCertificates ->setDomain(new Document([ 'domain' => $rule->getAttribute('domain') ])) ->trigger(); - $events->setParam('ruleId', $rule->getId()); + $queueForEvents->setParam('ruleId', $rule->getId()); $certificate = $dbForConsole->getDocument('certificates', $rule->getAttribute('certificateId', '')); $rule->setAttribute('logs', $certificate->getAttribute('logs', '')); From de8b9638d5ee0aa087cdffe4ac0afd15d0e74d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=B7=E5=8D=8E=20=E5=88=98?= Date: Thu, 19 Oct 2023 16:07:54 +0000 Subject: [PATCH 5/5] chore: update backup timings --- app/controllers/api/projects.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 16f2653178..ebeceee135 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -92,12 +92,12 @@ App::post('/v1/projects') $projectId = ($projectId == 'unique()') ? ID::unique() : $projectId; - $backups['database_db_fra1_v14x_02'] = ['from' => '7:30', 'to' => '8:15']; - $backups['database_db_fra1_v14x_03'] = ['from' => '10:30', 'to' => '11:15']; - $backups['database_db_fra1_v14x_04'] = ['from' => '13:30', 'to' => '14:15']; - $backups['database_db_fra1_v14x_05'] = ['from' => '4:30', 'to' => '5:15']; - $backups['database_db_fra1_v14x_06'] = ['from' => '16:30', 'to' => '17:15']; - $backups['database_db_fra1_v14x_07'] = ['from' => '19:30', 'to' => '20:15']; + $backups['database_db_fra1_v14x_02'] = ['from' => '03:00', 'to' => '04:00']; + $backups['database_db_fra1_v14x_03'] = ['from' => '00:00', 'to' => '01:00']; + $backups['database_db_fra1_v14x_04'] = ['from' => '00:00', 'to' => '01:00']; + $backups['database_db_fra1_v14x_05'] = ['from' => '00:00', 'to' => '01:00']; + $backups['database_db_fra1_v14x_06'] = ['from' => '00:00', 'to' => '01:00']; + $backups['database_db_fra1_v14x_07'] = ['from' => '00:00', 'to' => '01:00']; $databases = Config::getParam('pools-database', []);