From efe24db5a1dfb96fd42ba4ce70ecec7bc51e8751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 10 Jan 2025 15:28:09 +0100 Subject: [PATCH] Fix site starting crashes --- app/config/frameworks.php | 12 ++++++++++ composer.json | 2 +- composer.lock | 23 +++++++------------ docker-compose.yml | 2 +- .../Modules/Functions/Workers/Builds.php | 3 +++ 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/app/config/frameworks.php b/app/config/frameworks.php index ff54c0aacb..d19262ff57 100644 --- a/app/config/frameworks.php +++ b/app/config/frameworks.php @@ -31,6 +31,7 @@ return [ 'outputDirectory' => './.next', 'startCommand' => 'sh helpers/next-js/server.sh', 'bundleCommand' => 'sh /usr/local/server/helpers/next-js/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/next-js/env.sh', ], 'static' => [ 'key' => 'static', @@ -39,6 +40,7 @@ return [ 'outputDirectory' => './out', 'startCommand' => 'sh helpers/server.sh', 'bundleCommand' => '', + 'envCommand' => '', ] ] ], @@ -55,6 +57,7 @@ return [ 'outputDirectory' => './.output', 'startCommand' => 'sh helpers/nuxt/server.sh', 'bundleCommand' => 'sh /usr/local/server/helpers/nuxt/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/nuxt/env.sh', ], 'static' => [ 'key' => 'static', @@ -63,6 +66,7 @@ return [ 'outputDirectory' => './dist', 'startCommand' => 'sh helpers/server.sh', 'bundleCommand' => '', + 'envCommand' => '', ] ] ], @@ -79,6 +83,7 @@ return [ 'outputDirectory' => './build', 'startCommand' => 'sh helpers/sveltekit/server.sh', 'bundleCommand' => 'sh /usr/local/server/helpers/sveltekit/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/sveltekit/env.sh', ], 'static' => [ 'key' => 'static', @@ -87,6 +92,7 @@ return [ 'outputDirectory' => './build', 'startCommand' => 'sh helpers/server.sh', 'bundleCommand' => '', + 'envCommand' => '', ] ] ], @@ -103,6 +109,7 @@ return [ 'outputDirectory' => './dist', 'startCommand' => 'sh helpers/astro/server.sh', 'bundleCommand' => 'sh /usr/local/server/helpers/astro/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/astro/env.sh', ], 'static' => [ 'key' => 'static', @@ -111,6 +118,7 @@ return [ 'outputDirectory' => './dist', 'startCommand' => 'sh helpers/server.sh', 'bundleCommand' => '', + 'envCommand' => '', ] ] ], @@ -127,6 +135,7 @@ return [ 'outputDirectory' => './build', 'startCommand' => 'sh helpers/remix/server.sh', 'bundleCommand' => 'sh /usr/local/server/helpers/remix/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/remix/env.sh', ], 'static' => [ 'key' => 'static', @@ -135,6 +144,7 @@ return [ 'outputDirectory' => './build/client', 'startCommand' => 'sh helpers/server.sh', 'bundleCommand' => '', + 'envCommand' => '', ] ] ], @@ -151,6 +161,7 @@ return [ 'outputDirectory' => './build/web', 'startCommand' => 'sh helpers/server.sh', 'bundleCommand' => '', + 'envCommand' => '', ], ], ], @@ -167,6 +178,7 @@ return [ 'outputDirectory' => './', 'startCommand' => 'sh helpers/server.sh', 'bundleCommand' => '', + 'envCommand' => '', ], ] ], diff --git a/composer.json b/composer.json index 54440debe5..4569c84354 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "ext-openssl": "*", "ext-zlib": "*", "ext-sockets": "*", - "appwrite/php-runtimes": "dev-feat-add-ssr-runtime as 0.16.99", + "appwrite/php-runtimes": "0.17.*", "appwrite/php-clamav": "2.0.*", "utopia-php/abuse": "0.43.0", "utopia-php/analytics": "0.10.*", diff --git a/composer.lock b/composer.lock index 0cf7746c41..2098b9db8c 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": "2a57d56106703cb729370214435feb98", + "content-hash": "20874601c6797a65c01000471bd74645", "packages": [ { "name": "adhocore/jwt", @@ -157,16 +157,16 @@ }, { "name": "appwrite/php-runtimes", - "version": "dev-feat-add-ssr-runtime", + "version": "0.17.0", "source": { "type": "git", "url": "https://github.com/appwrite/runtimes.git", - "reference": "a021a2b09b045375979f8e7bc2e7aa520fc94847" + "reference": "9a9e20d1f5c28caf539ad4cb52164dc283f99797" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/runtimes/zipball/a021a2b09b045375979f8e7bc2e7aa520fc94847", - "reference": "a021a2b09b045375979f8e7bc2e7aa520fc94847", + "url": "https://api.github.com/repos/appwrite/runtimes/zipball/9a9e20d1f5c28caf539ad4cb52164dc283f99797", + "reference": "9a9e20d1f5c28caf539ad4cb52164dc283f99797", "shasum": "" }, "require": { @@ -206,9 +206,9 @@ ], "support": { "issues": "https://github.com/appwrite/runtimes/issues", - "source": "https://github.com/appwrite/runtimes/tree/feat-add-ssr-runtime" + "source": "https://github.com/appwrite/runtimes/tree/0.17.0" }, - "time": "2025-01-07T12:14:14+00:00" + "time": "2025-01-10T13:36:30+00:00" }, { "name": "beberlei/assert", @@ -8555,12 +8555,6 @@ } ], "aliases": [ - { - "package": "appwrite/php-runtimes", - "version": "dev-feat-add-ssr-runtime", - "alias": "0.16.99", - "alias_normalized": "0.16.99.0" - }, { "package": "utopia-php/framework", "version": "dev-fix-prevent-duplicate-compression", @@ -8570,7 +8564,6 @@ ], "minimum-stability": "stable", "stability-flags": { - "appwrite/php-runtimes": 20, "utopia-php/framework": 20 }, "prefer-stable": false, @@ -8596,5 +8589,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/docker-compose.yml b/docker-compose.yml index 148ffe51f5..35bdf30256 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -880,7 +880,7 @@ services: hostname: exc1 <<: *x-logging stop_signal: SIGINT - image: openruntimes/executor:0.7.2 + image: openruntimes/executor:0.7.3 restart: unless-stopped networks: - appwrite diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 047038e99b..d4e1820f0f 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -881,6 +881,9 @@ class Builds extends Action if (!is_null($adapter) && isset($adapter['bundleCommand'])) { $commands[] = $adapter['bundleCommand']; } + if (!is_null($adapter) && isset($adapter['envCommand'])) { + $commands[] = $adapter['envCommand']; + } } $commands = array_filter($commands, fn ($command) => !empty($command));