diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 385016db91..0fc3fc2df3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,6 @@ jobs: with: fetch-depth: 2 submodules: recursive - ref: cl-1.4.x - name: Login to Docker Hub uses: docker/login-action@v2 diff --git a/CHANGES.md b/CHANGES.md index 33b41d35fa..ac405184df 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +# Version 1.4.7 + +## Fixes +- Fix missing body in async function execution in [#6988](https://github.com/appwrite/appwrite/pull/6988) + # Version 1.4.6 ## Changes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 145ace7876..ccd61e742b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -89,7 +89,7 @@ $ git push origin [name_of_your_new_branch] To set up a working **development environment**, just fork the project git repository and install the backend and frontend dependencies using the proper package manager and create run the docker-compose stack. -> If you just want to install Appwrite for day-to-day use and not as a contributor, you can reference the [installation guide](https://github.com/appwrite/appwrite#installation), the [getting started guide](https://appwrite.io/docs/getting-started-for-web), or the main [README](README.md) file. +> If you just want to install Appwrite for day-to-day use and not as a contributor, you can reference the [installation guide](https://github.com/appwrite/appwrite#installation), the [getting started guide](https://appwrite.io/docs/quick-starts), or the main [README](README.md) file. ```bash git clone git@github.com:[YOUR_FORK_HERE]/appwrite.git @@ -454,7 +454,7 @@ From time to time, our team will add tutorials that will help contributors find - [Adding Support for a New OAuth2 Provider](./docs/tutorials/add-oauth2-provider.md) - [Appwrite Environment Variables](./docs/tutorials/add-environment-variable.md) -- [Running in Production](https://appwrite.io/docs/production) +- [Running in Production](https://appwrite.io/docs/advanced/self-hosting/production) - [Adding Storage Adapter](./docs/tutorials/add-storage-adapter.md) ## Other Ways to Help diff --git a/README-CN.md b/README-CN.md index 1328ef5cf4..1df799f7ef 100644 --- a/README-CN.md +++ b/README-CN.md @@ -66,7 +66,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.4.6 + appwrite/appwrite:1.4.7 ``` ### Windows @@ -78,7 +78,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.4.6 + appwrite/appwrite:1.4.7 ``` #### PowerShell @@ -88,7 +88,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.4.6 + appwrite/appwrite:1.4.7 ``` 运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。 diff --git a/README.md b/README.md index 40a4248d59..b4980d0e61 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.4.6 + appwrite/appwrite:1.4.7 ``` ### Windows @@ -88,7 +88,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.4.6 + appwrite/appwrite:1.4.7 ``` #### PowerShell @@ -98,7 +98,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.4.6 + appwrite/appwrite:1.4.7 ``` Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation. diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index ffecb2cdc6..a5f3b76608 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -92,14 +92,19 @@ App::post('/v1/projects') $projectId = ($projectId == 'unique()') ? ID::unique() : $projectId; - $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']; + $backups['database_db_fra1_v14x_02'] = ['from' => '03:00', 'to' => '05:00']; + $backups['database_db_fra1_v14x_03'] = ['from' => '00:00', 'to' => '02:00']; + $backups['database_db_fra1_v14x_04'] = ['from' => '00:00', 'to' => '02:00']; + $backups['database_db_fra1_v14x_05'] = ['from' => '00:00', 'to' => '02:00']; + $backups['database_db_fra1_v14x_06'] = ['from' => '00:00', 'to' => '02:00']; + $backups['database_db_fra1_v14x_07'] = ['from' => '00:00', 'to' => '02:00']; $databases = Config::getParam('pools-database', []); + $databaseSelfHosted = 'database_db_fra1_self_hosted_0_0'; + $selfHostedIndex = array_search($databaseSelfHosted, $databases); + if ($selfHostedIndex !== false) { + unset($databases[$selfHostedIndex]); + } /** * Remove databases from the list that are currently undergoing an backup @@ -123,7 +128,7 @@ App::post('/v1/projects') $databaseOverride = App::getEnv('_APP_DATABASE_OVERRIDE', null); $index = array_search($databaseOverride, $databases); - if ($index) { + if ($index !== false) { $database = $databases[$index]; } else { $database = $databases[array_rand($databases)]; @@ -170,6 +175,16 @@ App::post('/v1/projects') throw new Exception(Exception::PROJECT_ALREADY_EXISTS); } + /** + * Update database with self-managed db every $mod projects + */ + $mod = 20; + if ($project->getInternalId() % $mod === 0 && $selfHostedIndex !== false) { + $database = $databaseSelfHosted; + $project->setAttribute('database', $database); + $dbForConsole->updateDocument('projects', $project->getId(), $project); + } + $dbForProject = new Database($pools->get($database)->pop()->getResource(), $cache); $dbForProject->setNamespace("_{$project->getInternalId()}"); $dbForProject->create(); diff --git a/app/init.php b/app/init.php index cfbbe6f43f..2513d713f5 100644 --- a/app/init.php +++ b/app/init.php @@ -105,7 +105,7 @@ const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours const APP_CACHE_BUSTER = 514; -const APP_VERSION_STABLE = '1.4.6'; +const APP_VERSION_STABLE = '1.4.7'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; const APP_DATABASE_ATTRIBUTE_IP = 'ip'; diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index 15098793a9..964aef66e5 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -71,6 +71,7 @@ abstract class Migration '1.4.4' => 'V19', '1.4.5' => 'V19', '1.4.6' => 'V19', + '1.4.7' => 'V19', ]; /** diff --git a/src/Appwrite/Platform/Workers/Functions.php b/src/Appwrite/Platform/Workers/Functions.php index 6b7b5efe03..7a6cfe115f 100644 --- a/src/Appwrite/Platform/Workers/Functions.php +++ b/src/Appwrite/Platform/Workers/Functions.php @@ -77,7 +77,7 @@ class Functions extends Action $type = $payload['type'] ?? ''; $events = $payload['events'] ?? []; - $data = $payload['data'] ?? ''; + $data = $payload['body'] ?? ''; $eventData = $payload['payload'] ?? ''; $project = new Document($payload['project'] ?? []); $function = new Document($payload['function'] ?? []); diff --git a/src/Appwrite/Platform/Workers/Mails.php b/src/Appwrite/Platform/Workers/Mails.php index b0cf28caeb..7a20212c9c 100644 --- a/src/Appwrite/Platform/Workers/Mails.php +++ b/src/Appwrite/Platform/Workers/Mails.php @@ -5,6 +5,7 @@ namespace Appwrite\Platform\Workers; use Appwrite\Template\Template; use Exception; use PHPMailer\PHPMailer\PHPMailer; +use Swoole\Runtime; use Utopia\App; use Utopia\CLI\Console; use Utopia\Platform\Action; @@ -39,7 +40,7 @@ class Mails extends Action */ public function action(Message $message, Registry $register): void { - + Runtime::setHookFlags(SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_TCP); $payload = $message->getPayload() ?? []; if (empty($payload)) {