From 9fd8c5ab9d70f28d70331b5db4363a5db816e9e2 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Mon, 24 Mar 2025 20:04:02 +0530 Subject: [PATCH 1/6] Add fallbackfile and adapter to deployments collection --- app/config/collections/projects.php | 22 +++ app/config/templates/site.php | 134 +++++++++--------- app/controllers/api/vcs.php | 2 + app/controllers/general.php | 10 +- .../Platform/Modules/Compute/Base.php | 2 + .../Modules/Functions/Workers/Builds.php | 4 + .../Modules/Sites/Http/Deployments/Create.php | 8 +- .../Http/Deployments/Duplicate/Create.php | 2 + .../Http/Deployments/Template/Create.php | 2 + .../Services/Sites/SitesCustomServerTest.php | 69 +++++++++ 10 files changed, 181 insertions(+), 74 deletions(-) diff --git a/app/config/collections/projects.php b/app/config/collections/projects.php index b209a7ec32..8966a5abda 100644 --- a/app/config/collections/projects.php +++ b/app/config/collections/projects.php @@ -1725,6 +1725,28 @@ return [ 'default' => '', 'array' => false, 'filters' => [], + ], + [ + '$id' => ID::custom('adapter'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('fallbackFile'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], ] ], 'indexes' => [ diff --git a/app/config/templates/site.php b/app/config/templates/site.php index d21a7bc34f..1130d55fcf 100644 --- a/app/config/templates/site.php +++ b/app/config/templates/site.php @@ -143,80 +143,80 @@ function getFramework(string $frameworkEnum, array $overrides) } return [ -[ - 'key' => 'nxt-lnk', - 'name' => 'Nxt Lnk', - 'useCases' => ['portfolio'], - 'screenshotDark' => $url . '/images/sites/templates/nxt-lnk-dark.png', - 'screenshotLight' => $url . '/images/sites/templates/nxt-lnk-light.png', - 'frameworks' => [ - getFramework('NEXTJS', [ - 'providerRootDirectory' => './nextjs/nxtlnk', - ]), + [ + 'key' => 'nxt-lnk', + 'name' => 'Nxt Lnk', + 'useCases' => ['portfolio'], + 'screenshotDark' => $url . '/images/sites/templates/nxt-lnk-dark.png', + 'screenshotLight' => $url . '/images/sites/templates/nxt-lnk-light.png', + 'frameworks' => [ + getFramework('NEXTJS', [ + 'providerRootDirectory' => './nextjs/nxtlnk', + ]), + ], + 'vcsProvider' => 'github', + 'providerRepositoryId' => 'templates-for-sites', + 'providerOwner' => 'appwrite', + 'providerVersion' => '0.3.*', + 'variables' => [] ], - 'vcsProvider' => 'github', - 'providerRepositoryId' => 'templates-for-sites', - 'providerOwner' => 'appwrite', - 'providerVersion' => '0.3.*', - 'variables' => [] -], -[ - 'key' => 'magic-portfolio', - 'name' => 'Magic Portfolio', - 'useCases' => ['portfolio'], - 'screenshotDark' => $url . '/images/sites/templates/magic-portfolio-dark.png', - 'screenshotLight' => $url . '/images/sites/templates/magic-portfolio-light.png', - 'frameworks' => [ - getFramework('NEXTJS', [ - 'providerRootDirectory' => './nextjs/magic-portfolio', - ]), + [ + 'key' => 'magic-portfolio', + 'name' => 'Magic Portfolio', + 'useCases' => ['portfolio'], + 'screenshotDark' => $url . '/images/sites/templates/magic-portfolio-dark.png', + 'screenshotLight' => $url . '/images/sites/templates/magic-portfolio-light.png', + 'frameworks' => [ + getFramework('NEXTJS', [ + 'providerRootDirectory' => './nextjs/magic-portfolio', + ]), + ], + 'vcsProvider' => 'github', + 'providerRepositoryId' => 'templates-for-sites', + 'providerOwner' => 'appwrite', + 'providerVersion' => '0.3.*', + 'variables' => [] ], - 'vcsProvider' => 'github', - 'providerRepositoryId' => 'templates-for-sites', - 'providerOwner' => 'appwrite', - 'providerVersion' => '0.3.*', - 'variables' => [] -], -[ - 'key' => 'littlelink', - 'name' => 'LittleLink', - 'useCases' => ['portfolio'], - 'screenshotDark' => $url . '/images/sites/templates/littlelink-dark.png', - 'screenshotLight' => $url . '/images/sites/templates/littlelink-light.png', - 'frameworks' => [ - getFramework('OTHER', [ - 'providerRootDirectory' => './other/littlelink', - ]), + [ + 'key' => 'littlelink', + 'name' => 'LittleLink', + 'useCases' => ['portfolio'], + 'screenshotDark' => $url . '/images/sites/templates/littlelink-dark.png', + 'screenshotLight' => $url . '/images/sites/templates/littlelink-light.png', + 'frameworks' => [ + getFramework('OTHER', [ + 'providerRootDirectory' => './other/littlelink', + ]), + ], + 'vcsProvider' => 'github', + 'providerRepositoryId' => 'templates-for-sites', + 'providerOwner' => 'appwrite', + 'providerVersion' => '0.3.*', + 'variables' => [] ], - 'vcsProvider' => 'github', - 'providerRepositoryId' => 'templates-for-sites', - 'providerOwner' => 'appwrite', - 'providerVersion' => '0.3.*', - 'variables' => [] -], -[ - 'key' => 'logspot', - 'name' => 'Logspot', - 'useCases' => ['blog'], - 'screenshotDark' => $url . '/images/sites/templates/logspot-dark.png', - 'screenshotLight' => $url . '/images/sites/templates/logspot-light.png', - 'frameworks' => [ - getFramework('NUXT', [ - 'providerRootDirectory' => './nuxt/logspot', - 'buildCommand' => 'npm run generate', - 'outputDirectory' => './dist', - 'adapter' => 'static', - ]), + [ + 'key' => 'logspot', + 'name' => 'Logspot', + 'useCases' => ['blog'], + 'screenshotDark' => $url . '/images/sites/templates/logspot-dark.png', + 'screenshotLight' => $url . '/images/sites/templates/logspot-light.png', + 'frameworks' => [ + getFramework('NUXT', [ + 'providerRootDirectory' => './nuxt/logspot', + 'buildCommand' => 'npm run generate', + 'outputDirectory' => './dist', + 'adapter' => 'static', + ]), + ], + 'vcsProvider' => 'github', + 'providerRepositoryId' => 'templates-for-sites', + 'providerOwner' => 'appwrite', + 'providerVersion' => '0.3.*', + 'variables' => [] ], - 'vcsProvider' => 'github', - 'providerRepositoryId' => 'templates-for-sites', - 'providerOwner' => 'appwrite', - 'providerVersion' => '0.3.*', - 'variables' => [] -], [ 'key' => 'astro-nano', 'name' => 'Astro Nano', diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 107be3d888..5b2cabdab2 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -232,6 +232,8 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId 'entrypoint' => $resource->getAttribute('entrypoint', ''), 'buildCommands' => \implode(' && ', $commands), 'buildOutput' => $resource->getAttribute('outputDirectory', ''), + 'adapter' => $resource->getAttribute('adapter', ''), + 'fallbackFile' => $resource->getAttribute('fallbackFile', ''), 'type' => 'vcs', 'installationId' => $installationId, 'installationInternalId' => $installationInternalId, diff --git a/app/controllers/general.php b/app/controllers/general.php index 3afe1d8a3d..3f105484e1 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -261,7 +261,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw }; // Static site enforced runtime - if ($resource->getAttribute('adapter', '') === 'static') { + if ($deployment->getAttribute('adapter', '') === 'static') { $runtime = $runtimes['static-1'] ?? null; } @@ -410,8 +410,8 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw ]); // SPA fallbackFile override - if ($resource->getAttribute('adapter', '') === 'static' && $resource->getAttribute('fallbackFile', '') !== '') { - $vars['OPEN_RUNTIMES_STATIC_FALLBACK'] = $resource->getAttribute('fallbackFile', ''); + if ($deployment->getAttribute('adapter', '') === 'static' && $deployment->getAttribute('fallbackFile', '') !== '') { + $vars['OPEN_RUNTIMES_STATIC_FALLBACK'] = $deployment->getAttribute('fallbackFile', ''); } /** Execute function */ @@ -438,7 +438,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $startCommand = $runtime['startCommand']; if (!is_null($framework)) { - $adapter = ($framework['adapters'] ?? [])[$resource->getAttribute('adapter', '')] ?? null; + $adapter = ($framework['adapters'] ?? [])[$deployment->getAttribute('adapter', '')] ?? null; if (!is_null($adapter) && isset($adapter['startCommand'])) { $startCommand = $adapter['startCommand']; } @@ -473,7 +473,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw ); // Branded 404 override - if ($executionResponse['statusCode'] === 404 && $resource->getAttribute('adapter', '') === 'static') { + if ($executionResponse['statusCode'] === 404 && $deployment->getAttribute('adapter', '') === 'static') { $layout = new View(__DIR__ . '/../views/general/404.phtml'); $executionResponse['body'] = $layout->render(); $executionResponse['headers']['content-length'] = \strlen($executionResponse['body']); diff --git a/src/Appwrite/Platform/Modules/Compute/Base.php b/src/Appwrite/Platform/Modules/Compute/Base.php index 6d44be239d..542b29bcd5 100644 --- a/src/Appwrite/Platform/Modules/Compute/Base.php +++ b/src/Appwrite/Platform/Modules/Compute/Base.php @@ -171,6 +171,8 @@ class Base extends Action 'resourceType' => 'sites', 'buildCommands' => implode(' && ', $commands), 'buildOutput' => $site->getAttribute('outputDirectory', ''), + 'adapter' => $site->getAttribute('adapter', ''), + 'fallbackFile' => $site->getAttribute('fallbackFile', ''), 'type' => 'vcs', 'installationId' => $installation->getId(), 'installationInternalId' => $installation->getInternalId(), diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 9ea5638ac3..3f28e7a7ce 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -768,6 +768,10 @@ class Builds extends Action $resource->setAttribute('adapter', $detection->getName()); $resource->setAttribute('fallbackFile', $detection->getFallbackFile() ?? ''); $resource = $dbForProject->updateDocument('sites', $resource->getId(), $resource); + + $deployment->setAttribute('adapter', $detection->getName()); + $deployment->setAttribute('fallbackFile', $detection->getFallbackFile() ?? ''); + $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); } elseif ($adapter === 'ssr' && $detection->getName() === 'static') { throw new \Exception('Adapter mismatch. Detected: ' . $detection->getName() . ' does not match with the set adapter: ' . $adapter); } diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php index ab2d9282ac..0b45c42e4b 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php @@ -241,13 +241,15 @@ class Create extends Action 'resourceType' => 'sites', 'buildCommands' => \implode(' && ', $commands), 'buildOutput' => $outputDirectory, + 'adapter' => $site->getAttribute('adapter', ''), + 'fallbackFile' => $site->getAttribute('fallbackFile', ''), 'sourcePath' => $path, 'sourceSize' => $fileSize, 'totalSize' => $fileSize, 'search' => implode(' ', [$deploymentId]), 'activate' => $activate, 'sourceMetadata' => $metadata, - 'type' => $type + 'type' => $type, ])); $site = $site @@ -306,6 +308,8 @@ class Create extends Action 'resourceType' => 'sites', 'buildCommands' => \implode(' && ', $commands), 'buildOutput' => $outputDirectory, + 'adapter' => $site->getAttribute('adapter', ''), + 'fallbackFile' => $site->getAttribute('fallbackFile', ''), 'sourcePath' => $path, 'sourceSize' => $fileSize, 'totalSize' => $fileSize, @@ -314,7 +318,7 @@ class Create extends Action 'search' => implode(' ', [$deploymentId]), 'activate' => $activate, 'sourceMetadata' => $metadata, - 'type' => $type + 'type' => $type, ])); $site = $site diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php index 9e33a6b839..1b3b08b7e3 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php @@ -114,6 +114,8 @@ class Create extends Action 'totalSize' => $deployment->getAttribute('sourceSize', 0), 'buildCommands' => \implode(' && ', $commands), 'buildOutput' => $site->getAttribute('outputDirectory', ''), + 'adapter' => $site->getAttribute('adapter', ''), + 'fallbackFile' => $site->getAttribute('fallbackFile', ''), 'search' => implode(' ', [$deploymentId]), 'screenshotLight' => '', 'screenshotDark' => '', diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php index c3a4b3ca96..a27ce4b2ba 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php @@ -156,6 +156,8 @@ class Create extends Base 'resourceType' => 'sites', 'buildCommands' => \implode(' && ', $commands), 'buildOutput' => $site->getAttribute('outputDirectory', ''), + 'adapter' => $site->getAttribute('adapter', ''), + 'fallbackFile' => $site->getAttribute('fallbackFile', ''), 'type' => 'manual', 'search' => implode(' ', [$deploymentId]), 'activate' => $activate, diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index a95568c7ce..5ce4ab350b 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -539,6 +539,75 @@ class SitesCustomServerTest extends Scope $this->cleanupSite($siteId); } + public function testSettingsForRollback(): void + { + $siteId = $this->setupSite([ + 'siteId' => ID::unique(), + 'name' => 'Static site', + 'framework' => 'other', + 'buildRuntime' => 'node-22', + 'outputDirectory' => '', + 'buildCommand' => '', + 'installCommand' => '', + ]); + $this->assertNotEmpty($siteId); + + $site = $this->getSite($siteId); + $this->assertEquals('200', $site['headers']['status-code']); + $this->assertArrayHasKey('adapter', $site['body']); + $this->assertArrayHasKey('fallbackFile', $site['body']); + $this->assertEmpty($site['body']['adapter']); + $this->assertEmpty($site['body']['fallbackFile']); + + $domain = $this->setupSiteDomain($siteId); + $this->assertNotEmpty($domain); + + $deploymentId1 = $this->setupDeployment($siteId, [ + 'code' => $this->packageSite('static-single-file'), + 'activate' => 'true' + ]); + $this->assertNotEmpty($deploymentId1); + + $site = $this->getSite($siteId); + $this->assertEquals('200', $site['headers']['status-code']); + $this->assertEquals('static', $site['body']['adapter']); + $this->assertEquals('main.html', $site['body']['fallbackFile']); + + $site = $this->updateSite([ + 'fallbackFile' => 'hello.html', + 'adapter' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + '$id' => $siteId + ]); + + $deploymentId2 = $this->setupDeployment($siteId, [ + 'code' => $this->packageSite('astro'), + 'activate' => 'true' + ]); + $this->assertNotEmpty($deploymentId2); + + $proxyClient = new Client(); + $proxyClient->setEndpoint('http://' . $domain); + $response = $proxyClient->call(Client::METHOD_GET, '/'); + $this->assertEquals(404, $response['headers']['status-code']); + + $response = $this->updateSiteDeployment($siteId, $deploymentId1); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + + $proxyClient = new Client(); + $proxyClient->setEndpoint('http://' . $domain); + $response = $proxyClient->call(Client::METHOD_GET, '/'); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertStringContainsString('Main page', $response['body']); + $response = $proxyClient->call(Client::METHOD_GET, '/something'); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertStringContainsString('Main page', $response['body']); + + $this->cleanupSite($siteId); + } + public function testListSites(): void { /** From fe94717196ac8d2c1805992b482c8ce4ca4587bf Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Tue, 25 Mar 2025 18:31:14 +0530 Subject: [PATCH 2/6] Update tests --- .../Services/Sites/SitesCustomServerTest.php | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index 5ce4ab350b..ce37d61474 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -544,18 +544,16 @@ class SitesCustomServerTest extends Scope $siteId = $this->setupSite([ 'siteId' => ID::unique(), 'name' => 'Static site', - 'framework' => 'other', + 'framework' => 'astro', 'buildRuntime' => 'node-22', - 'outputDirectory' => '', - 'buildCommand' => '', - 'installCommand' => '', + 'outputDirectory' => './dist', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', ]); $this->assertNotEmpty($siteId); $site = $this->getSite($siteId); $this->assertEquals('200', $site['headers']['status-code']); - $this->assertArrayHasKey('adapter', $site['body']); - $this->assertArrayHasKey('fallbackFile', $site['body']); $this->assertEmpty($site['body']['adapter']); $this->assertEmpty($site['body']['fallbackFile']); @@ -563,7 +561,7 @@ class SitesCustomServerTest extends Scope $this->assertNotEmpty($domain); $deploymentId1 = $this->setupDeployment($siteId, [ - 'code' => $this->packageSite('static-single-file'), + 'code' => $this->packageSite('astro-static'), 'activate' => 'true' ]); $this->assertNotEmpty($deploymentId1); @@ -571,25 +569,40 @@ class SitesCustomServerTest extends Scope $site = $this->getSite($siteId); $this->assertEquals('200', $site['headers']['status-code']); $this->assertEquals('static', $site['body']['adapter']); - $this->assertEquals('main.html', $site['body']['fallbackFile']); + $this->assertEquals('index.html', $site['body']['fallbackFile']); $site = $this->updateSite([ - 'fallbackFile' => 'hello.html', - 'adapter' => 'ssr', + 'name' => 'SSR site', + 'framework' => 'astro', + 'buildRuntime' => 'node-22', + 'outputDirectory' => './dist', 'buildCommand' => 'npm run build', 'installCommand' => 'npm install', - '$id' => $siteId + 'adapter' => 'ssr', + 'fallbackFile' => '', + '$id' => $siteId, ]); + $this->assertEquals('200', $site['headers']['status-code']); + $this->assertEquals('ssr', $site['body']['adapter']); + $this->assertEmpty($site['body']['fallbackFile']); + $deploymentId2 = $this->setupDeployment($siteId, [ 'code' => $this->packageSite('astro'), 'activate' => 'true' ]); $this->assertNotEmpty($deploymentId2); + $site = $this->getSite($siteId); + $this->assertEquals('200', $site['headers']['status-code']); + $this->assertEquals('ssr', $site['body']['adapter']); + $proxyClient = new Client(); $proxyClient->setEndpoint('http://' . $domain); $response = $proxyClient->call(Client::METHOD_GET, '/'); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertStringContainsString("Astro SSR", $response['body']); + $response = $proxyClient->call(Client::METHOD_GET, '/not-found'); $this->assertEquals(404, $response['headers']['status-code']); $response = $this->updateSiteDeployment($siteId, $deploymentId1); @@ -600,10 +613,10 @@ class SitesCustomServerTest extends Scope $proxyClient->setEndpoint('http://' . $domain); $response = $proxyClient->call(Client::METHOD_GET, '/'); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertStringContainsString('Main page', $response['body']); - $response = $proxyClient->call(Client::METHOD_GET, '/something'); + $this->assertStringContainsString("Astro static", $response['body']); + $response = $proxyClient->call(Client::METHOD_GET, '/not-found'); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertStringContainsString('Main page', $response['body']); + $this->assertStringContainsString("Astro static", $response['body']); $this->cleanupSite($siteId); } From bf2b3b68e3666014f478e5b3b151bb936bd25651 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Tue, 25 Mar 2025 19:14:14 +0530 Subject: [PATCH 3/6] Add logging param to sites --- app/config/collections/projects.php | 20 ++++---- .../Modules/Sites/Http/Sites/Create.php | 5 +- .../Modules/Sites/Http/Sites/Update.php | 5 +- src/Appwrite/Utopia/Response/Model/Site.php | 6 +++ .../Services/Sites/SitesCustomServerTest.php | 51 +++++++++++++++++++ 5 files changed, 75 insertions(+), 12 deletions(-) diff --git a/app/config/collections/projects.php b/app/config/collections/projects.php index b209a7ec32..5c5f02daee 100644 --- a/app/config/collections/projects.php +++ b/app/config/collections/projects.php @@ -971,16 +971,16 @@ return [ 'default' => false, 'array' => false, ], - // [ - // '$id' => ID::custom('logging'), - // 'type' => Database::VAR_BOOLEAN, - // 'signed' => true, - // 'size' => 0, - // 'format' => '', - // 'filters' => [], - // 'required' => true, - // 'array' => false, - // ], + [ + '$id' => ID::custom('logging'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], [ '$id' => ID::custom('framework'), 'type' => Database::VAR_STRING, diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php index ada665267a..bd76e19e3f 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php @@ -64,7 +64,8 @@ class Create extends Base ->param('siteId', '', new CustomId(), 'Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Site name. Max length: 128 chars.') ->param('framework', '', new WhiteList(\array_keys(Config::getParam('frameworks')), true), 'Sites framework.') - ->param('enabled', true, new Boolean(), 'Is site enabled? When set to \'disabled\', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.', true) // TODO: Add logging param later + ->param('enabled', true, new Boolean(), 'Is site enabled? When set to \'disabled\', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.', true) + ->param('logging', true, new Boolean(), 'Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.', true) ->param('timeout', 15, new Range(1, (int) System::getEnv('_APP_COMPUTE_TIMEOUT', 900)), 'Maximum request time in seconds.', true) ->param('installCommand', '', new Text(8192, 0), 'Install Command.', true) ->param('buildCommand', '', new Text(8192, 0), 'Build Command.', true) @@ -96,6 +97,7 @@ class Create extends Base string $name, string $framework, bool $enabled, + bool $logging, int $timeout, string $installCommand, string $buildCommand, @@ -140,6 +142,7 @@ class Create extends Base '$id' => $siteId, 'enabled' => $enabled, 'live' => true, + 'logging' => $logging, 'name' => $name, 'framework' => $framework, 'deploymentInternalId' => '', diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php index b971c4c4f3..1e82e83881 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php @@ -68,7 +68,8 @@ class Update extends Base ->param('siteId', '', new UID(), 'Site ID.') ->param('name', '', new Text(128), 'Site name. Max length: 128 chars.') ->param('framework', '', new WhiteList(\array_keys(Config::getParam('frameworks')), true), 'Sites framework.') - ->param('enabled', true, new Boolean(), 'Is site enabled? When set to \'disabled\', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.', true) // TODO: Add logging param later + ->param('enabled', true, new Boolean(), 'Is site enabled? When set to \'disabled\', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.', true) + ->param('logging', true, new Boolean(), 'Whether logs and errors will be logged. When set to false, logs and errors will not be logged, but will reduce resource used by your Appwrite project.', true) ->param('timeout', 15, new Range(1, (int) System::getEnv('_APP_COMPUTE_TIMEOUT', 900)), 'Maximum request time in seconds.', true) ->param('installCommand', '', new Text(8192, 0), 'Install Command.', true) ->param('buildCommand', '', new Text(8192, 0), 'Build Command.', true) @@ -103,6 +104,7 @@ class Update extends Base string $name, string $framework, bool $enabled, + bool $logging, int $timeout, string $installCommand, string $buildCommand, @@ -246,6 +248,7 @@ class Update extends Base 'name' => $name, 'framework' => $framework, 'enabled' => $enabled, + 'logging' => $logging, 'live' => $live, 'timeout' => $timeout, 'installCommand' => $installCommand, diff --git a/src/Appwrite/Utopia/Response/Model/Site.php b/src/Appwrite/Utopia/Response/Model/Site.php index 478b7881b3..8b28200de1 100644 --- a/src/Appwrite/Utopia/Response/Model/Site.php +++ b/src/Appwrite/Utopia/Response/Model/Site.php @@ -46,6 +46,12 @@ class Site extends Model 'default' => true, 'example' => false, ]) + ->addRule('logging', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Whether logs and errors will be logged. When set to false, logs and errors will not be logged, but will reduce resource used by your Appwrite project.', + 'default' => true, + 'example' => false, + ]) ->addRule('framework', [ 'type' => self::TYPE_STRING, 'description' => 'Site framework.', diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index a0880b0a4e..2cabaf88df 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -1905,6 +1905,57 @@ class SitesCustomServerTest extends Scope $this->assertNotEquals($log1Id, $log2Id); + $site = $this->updateSite( + [ + '$id' => $siteId, + 'name' => 'SSR site', + 'framework' => 'astro', + 'adapter' => 'ssr', + 'buildRuntime' => 'node-22', + 'outputDirectory' => './dist', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'fallbackFile' => '', + 'logging' => false // set logging to false + ] + ); + $this->assertEquals(200, $site['headers']['status-code']); + $response = $proxyClient->call(Client::METHOD_GET, '/logs-inline'); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertStringContainsString("Inline logs printed.", $response['body']); + + $logs = $this->listLogs($siteId, [ + Query::orderDesc('$createdAt')->toString(), + Query::limit(1)->toString(), + ]); + $this->assertEquals(200, $logs['headers']['status-code']); + $this->assertStringContainsString("GET", $logs['body']['executions'][0]['requestMethod']); + $this->assertStringContainsString("/logs-inline", $logs['body']['executions'][0]['requestPath']); + $this->assertStringContainsString("", $logs['body']['executions'][0]['logs']); + $this->assertStringContainsString("", $logs['body']['executions'][0]['logs']); + $this->assertStringContainsString("", $logs['body']['executions'][0]['errors']); + $this->assertStringContainsString("", $logs['body']['executions'][0]['errors']); + $log1Id = $logs['body']['executions'][0]['$id']; + $this->assertNotEmpty($log1Id); + + $response = $proxyClient->call(Client::METHOD_GET, '/logs-action'); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertStringContainsString("Action logs printed.", $response['body']); + + $logs = $this->listLogs($siteId, [ + Query::orderDesc('$createdAt')->toString(), + Query::limit(1)->toString(), + ]); + $this->assertEquals(200, $logs['headers']['status-code']); + $this->assertStringContainsString("GET", $logs['body']['executions'][0]['requestMethod']); + $this->assertStringContainsString("/logs-action", $logs['body']['executions'][0]['requestPath']); + $this->assertStringContainsString("", $logs['body']['executions'][0]['logs']); + $this->assertStringContainsString("", $logs['body']['executions'][0]['logs']); + $this->assertStringContainsString("", $logs['body']['executions'][0]['errors']); + $this->assertStringContainsString("", $logs['body']['executions'][0]['errors']); + $log2Id = $logs['body']['executions'][0]['$id']; + $this->assertNotEmpty($log2Id); + $this->cleanupSite($siteId); } From abae54f72c8038ccc03f21879a127bbe9efcb8ed Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Tue, 25 Mar 2025 19:49:57 +0530 Subject: [PATCH 4/6] Update copy for logging --- .../Platform/Modules/Functions/Http/Functions/Create.php | 2 +- .../Platform/Modules/Functions/Http/Functions/Update.php | 2 +- src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php | 2 +- src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php | 2 +- src/Appwrite/Utopia/Response/Model/Func.php | 2 +- src/Appwrite/Utopia/Response/Model/Site.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php index 28f2c3cd1f..cf31d3d7d2 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php @@ -76,7 +76,7 @@ class Create extends Base ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true) ->param('timeout', 15, new Range(1, (int) System::getEnv('_APP_COMPUTE_TIMEOUT', 900)), 'Function maximum execution time in seconds.', true) ->param('enabled', true, new Boolean(), 'Is function enabled? When set to \'disabled\', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.', true) - ->param('logging', true, new Boolean(), 'Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.', true) + ->param('logging', true, new Boolean(), 'When disabled, executions will exclude logs and errors, and will be slightly faster.', true) ->param('entrypoint', '', new Text(1028, 0), 'Entrypoint File. This path is relative to the "providerRootDirectory".', true) ->param('commands', '', new Text(8192, 0), 'Build Commands.', true) ->param('scopes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of scopes allowed for API key auto-generated for every execution. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.', true) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php index d1714685d8..3c876ed91e 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php @@ -80,7 +80,7 @@ class Update extends Base ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true) ->param('timeout', 15, new Range(1, (int) System::getEnv('_APP_COMPUTE_TIMEOUT', 900)), 'Maximum execution time in seconds.', true) ->param('enabled', true, new Boolean(), 'Is function enabled? When set to \'disabled\', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.', true) - ->param('logging', true, new Boolean(), 'Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.', true) + ->param('logging', true, new Boolean(), 'When disabled, executions will exclude logs and errors, and will be slightly faster.', true) ->param('entrypoint', '', new Text(1028, 0), 'Entrypoint File. This path is relative to the "providerRootDirectory".', true) ->param('commands', '', new Text(8192, 0), 'Build Commands.', true) ->param('scopes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of scopes allowed for API Key auto-generated for every execution. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.', true) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php index bd76e19e3f..1a39edea46 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php @@ -65,7 +65,7 @@ class Create extends Base ->param('name', '', new Text(128), 'Site name. Max length: 128 chars.') ->param('framework', '', new WhiteList(\array_keys(Config::getParam('frameworks')), true), 'Sites framework.') ->param('enabled', true, new Boolean(), 'Is site enabled? When set to \'disabled\', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.', true) - ->param('logging', true, new Boolean(), 'Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.', true) + ->param('logging', true, new Boolean(), 'When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.', true) ->param('timeout', 15, new Range(1, (int) System::getEnv('_APP_COMPUTE_TIMEOUT', 900)), 'Maximum request time in seconds.', true) ->param('installCommand', '', new Text(8192, 0), 'Install Command.', true) ->param('buildCommand', '', new Text(8192, 0), 'Build Command.', true) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php index 1e82e83881..416062862a 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php @@ -69,7 +69,7 @@ class Update extends Base ->param('name', '', new Text(128), 'Site name. Max length: 128 chars.') ->param('framework', '', new WhiteList(\array_keys(Config::getParam('frameworks')), true), 'Sites framework.') ->param('enabled', true, new Boolean(), 'Is site enabled? When set to \'disabled\', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.', true) - ->param('logging', true, new Boolean(), 'Whether logs and errors will be logged. When set to false, logs and errors will not be logged, but will reduce resource used by your Appwrite project.', true) + ->param('logging', true, new Boolean(), 'When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.', true) ->param('timeout', 15, new Range(1, (int) System::getEnv('_APP_COMPUTE_TIMEOUT', 900)), 'Maximum request time in seconds.', true) ->param('installCommand', '', new Text(8192, 0), 'Install Command.', true) ->param('buildCommand', '', new Text(8192, 0), 'Build Command.', true) diff --git a/src/Appwrite/Utopia/Response/Model/Func.php b/src/Appwrite/Utopia/Response/Model/Func.php index e0929684fb..e33d7663fd 100644 --- a/src/Appwrite/Utopia/Response/Model/Func.php +++ b/src/Appwrite/Utopia/Response/Model/Func.php @@ -55,7 +55,7 @@ class Func extends Model ]) ->addRule('logging', [ 'type' => self::TYPE_BOOLEAN, - 'description' => 'Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.', + 'description' => 'When disabled, executions will exclude logs and errors, and will be slightly faster.', 'default' => true, 'example' => false, ]) diff --git a/src/Appwrite/Utopia/Response/Model/Site.php b/src/Appwrite/Utopia/Response/Model/Site.php index 8b28200de1..e6e205909b 100644 --- a/src/Appwrite/Utopia/Response/Model/Site.php +++ b/src/Appwrite/Utopia/Response/Model/Site.php @@ -48,7 +48,7 @@ class Site extends Model ]) ->addRule('logging', [ 'type' => self::TYPE_BOOLEAN, - 'description' => 'Whether logs and errors will be logged. When set to false, logs and errors will not be logged, but will reduce resource used by your Appwrite project.', + 'description' => 'When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.', 'default' => true, 'example' => false, ]) From c38a5177dd29fbdd464f9c5b13e4045b812b1f4b Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Tue, 25 Mar 2025 20:02:29 +0530 Subject: [PATCH 5/6] Address PR comments --- .../Services/Sites/SitesCustomServerTest.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index 2cabaf88df..87e21e403d 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -1929,12 +1929,12 @@ class SitesCustomServerTest extends Scope Query::limit(1)->toString(), ]); $this->assertEquals(200, $logs['headers']['status-code']); - $this->assertStringContainsString("GET", $logs['body']['executions'][0]['requestMethod']); - $this->assertStringContainsString("/logs-inline", $logs['body']['executions'][0]['requestPath']); - $this->assertStringContainsString("", $logs['body']['executions'][0]['logs']); - $this->assertStringContainsString("", $logs['body']['executions'][0]['logs']); - $this->assertStringContainsString("", $logs['body']['executions'][0]['errors']); - $this->assertStringContainsString("", $logs['body']['executions'][0]['errors']); + $this->assertEquals("GET", $logs['body']['executions'][0]['requestMethod']); + $this->assertEquals("/logs-inline", $logs['body']['executions'][0]['requestPath']); + $this->assertEmpty($logs['body']['executions'][0]['logs']); + $this->assertEmpty($logs['body']['executions'][0]['logs']); + $this->assertEmpty($logs['body']['executions'][0]['errors']); + $this->assertEmpty($logs['body']['executions'][0]['errors']); $log1Id = $logs['body']['executions'][0]['$id']; $this->assertNotEmpty($log1Id); @@ -1947,12 +1947,12 @@ class SitesCustomServerTest extends Scope Query::limit(1)->toString(), ]); $this->assertEquals(200, $logs['headers']['status-code']); - $this->assertStringContainsString("GET", $logs['body']['executions'][0]['requestMethod']); - $this->assertStringContainsString("/logs-action", $logs['body']['executions'][0]['requestPath']); - $this->assertStringContainsString("", $logs['body']['executions'][0]['logs']); - $this->assertStringContainsString("", $logs['body']['executions'][0]['logs']); - $this->assertStringContainsString("", $logs['body']['executions'][0]['errors']); - $this->assertStringContainsString("", $logs['body']['executions'][0]['errors']); + $this->assertEquals("GET", $logs['body']['executions'][0]['requestMethod']); + $this->assertEquals("/logs-action", $logs['body']['executions'][0]['requestPath']); + $this->assertEmpty($logs['body']['executions'][0]['logs']); + $this->assertEmpty($logs['body']['executions'][0]['logs']); + $this->assertEmpty($logs['body']['executions'][0]['errors']); + $this->assertEmpty($logs['body']['executions'][0]['errors']); $log2Id = $logs['body']['executions'][0]['$id']; $this->assertNotEmpty($log2Id); From 8db247c8404a3d0b9bbef28592cd95d6a038ca9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 25 Mar 2025 15:57:38 +0100 Subject: [PATCH 6/6] Update SDKs --- .../specs/open-api3-latest-console.json | 22 ++++++++++++++--- app/config/specs/open-api3-latest-server.json | 22 ++++++++++++++--- app/config/specs/swagger2-latest-console.json | 24 ++++++++++++++++--- app/config/specs/swagger2-latest-server.json | 24 ++++++++++++++++--- 4 files changed, 80 insertions(+), 12 deletions(-) diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 9e9f99db63..cc8a611416 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -9268,7 +9268,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "x-example": false }, "entrypoint": { @@ -9889,7 +9889,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "x-example": false }, "entrypoint": { @@ -24730,6 +24730,11 @@ "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, "timeout": { "type": "integer", "description": "Maximum request time in seconds.", @@ -25360,6 +25365,11 @@ "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, "timeout": { "type": "integer", "description": "Maximum request time in seconds.", @@ -36864,6 +36874,11 @@ "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, "framework": { "type": "string", "description": "Site framework.", @@ -36986,6 +37001,7 @@ "name", "enabled", "live", + "logging", "framework", "deploymentId", "deploymentCreatedAt", @@ -37205,7 +37221,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "x-example": false }, "runtime": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 287ce791c3..ecda53b77b 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -8355,7 +8355,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "x-example": false }, "entrypoint": { @@ -8751,7 +8751,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "x-example": false }, "entrypoint": { @@ -16828,6 +16828,11 @@ "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, "timeout": { "type": "integer", "description": "Maximum request time in seconds.", @@ -17233,6 +17238,11 @@ "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, "timeout": { "type": "integer", "description": "Maximum request time in seconds.", @@ -27413,6 +27423,11 @@ "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, "framework": { "type": "string", "description": "Site framework.", @@ -27535,6 +27550,7 @@ "name", "enabled", "live", + "logging", "framework", "deploymentId", "deploymentCreatedAt", @@ -27603,7 +27619,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "x-example": false }, "runtime": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 05acf4a551..4d3ab5bce8 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -9425,7 +9425,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "default": true, "x-example": false }, @@ -10061,7 +10061,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "default": true, "x-example": false }, @@ -25234,6 +25234,12 @@ "default": true, "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, "timeout": { "type": "integer", "description": "Maximum request time in seconds.", @@ -25878,6 +25884,12 @@ "default": true, "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, "timeout": { "type": "integer", "description": "Maximum request time in seconds.", @@ -37444,6 +37456,11 @@ "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, "framework": { "type": "string", "description": "Site framework.", @@ -37567,6 +37584,7 @@ "name", "enabled", "live", + "logging", "framework", "deploymentId", "deploymentCreatedAt", @@ -37788,7 +37806,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "x-example": false }, "runtime": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index b7371b1bbd..c2d3b06ebc 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -8509,7 +8509,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "default": true, "x-example": false }, @@ -8924,7 +8924,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "default": true, "x-example": false }, @@ -17298,6 +17298,12 @@ "default": true, "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, "timeout": { "type": "integer", "description": "Maximum request time in seconds.", @@ -17721,6 +17727,12 @@ "default": true, "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, "timeout": { "type": "integer", "description": "Maximum request time in seconds.", @@ -27964,6 +27976,11 @@ "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", "x-example": false }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, "framework": { "type": "string", "description": "Site framework.", @@ -28087,6 +28104,7 @@ "name", "enabled", "live", + "logging", "framework", "deploymentId", "deploymentCreatedAt", @@ -28155,7 +28173,7 @@ }, "logging": { "type": "boolean", - "description": "Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", "x-example": false }, "runtime": {