From af998ef868da3a38ab8a662cdaa23dea4ad3b8d5 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Thu, 18 Jul 2024 17:29:15 +0200 Subject: [PATCH 1/4] chore: update console --- 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 a8de452b85..0481a9e2f0 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -166,7 +166,7 @@ $image = $this->getParam('image', ''); appwrite-console: <<: *x-logging container_name: appwrite-console - image: /console:appwrite/console:5.0.0-rc.5 + image: /console:appwrite/console:5.0.0-rc.6 restart: unless-stopped networks: - appwrite diff --git a/docker-compose.yml b/docker-compose.yml index fc8581c80a..ac4abd6f5a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -195,7 +195,7 @@ services: appwrite-console: <<: *x-logging container_name: appwrite-console - image: appwrite/console:5.0.0-rc.5 + image: appwrite/console:5.0.0-rc.6 restart: unless-stopped networks: - appwrite From 0661291d4c11ee45259c272880ee5ecdbe753f43 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Thu, 18 Jul 2024 20:59:55 +0200 Subject: [PATCH 2/4] chore: upgrade console --- 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 0481a9e2f0..d3aa90593a 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -166,7 +166,7 @@ $image = $this->getParam('image', ''); appwrite-console: <<: *x-logging container_name: appwrite-console - image: /console:appwrite/console:5.0.0-rc.6 + image: /console:appwrite/console:5.0.0-rc.7 restart: unless-stopped networks: - appwrite diff --git a/docker-compose.yml b/docker-compose.yml index ac4abd6f5a..553f44ee9f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -195,7 +195,7 @@ services: appwrite-console: <<: *x-logging container_name: appwrite-console - image: appwrite/console:5.0.0-rc.6 + image: appwrite/console:5.0.0-rc.7 restart: unless-stopped networks: - appwrite From 8ad15b2df19f48f405b10683c739bf6b03465df8 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 19 Jul 2024 13:53:42 +0200 Subject: [PATCH 3/4] feat: base migration for 1.6.x --- .env | 2 +- app/init.php | 2 +- app/views/install/compose.phtml | 2 +- docker-compose.yml | 2 +- src/Appwrite/Migration/Migration.php | 1 + src/Appwrite/Migration/Version/V21.php | 72 ++++++++++++++++++++++++++ 6 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 src/Appwrite/Migration/Version/V21.php diff --git a/.env b/.env index 9cccf5ee7e..4062bde932 100644 --- a/.env +++ b/.env @@ -7,7 +7,7 @@ _APP_CONSOLE_WHITELIST_EMAILS= _APP_CONSOLE_SESSION_ALERTS=enabled _APP_CONSOLE_WHITELIST_IPS= _APP_CONSOLE_COUNTRIES_DENYLIST=AQ -_APP_CONSOLE_HOSTNAMES=localhost,appwrite.io,*.appwrite.io +_APP_CONSOLE_HOSTNAMES=localhost,appwrite.io,*.appwrite.io,* _APP_SYSTEM_EMAIL_NAME=Appwrite _APP_SYSTEM_EMAIL_ADDRESS=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io diff --git a/app/init.php b/app/init.php index a0e71f041b..ef7742956f 100644 --- a/app/init.php +++ b/app/init.php @@ -118,7 +118,7 @@ const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours const APP_CACHE_BUSTER = 4314; -const APP_VERSION_STABLE = '1.5.7'; +const APP_VERSION_STABLE = '1.6.0'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; const APP_DATABASE_ATTRIBUTE_IP = 'ip'; diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index d3aa90593a..70c6fbdebd 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -166,7 +166,7 @@ $image = $this->getParam('image', ''); appwrite-console: <<: *x-logging container_name: appwrite-console - image: /console:appwrite/console:5.0.0-rc.7 + image: /console:appwrite/console:5.0.0-rc.11 restart: unless-stopped networks: - appwrite diff --git a/docker-compose.yml b/docker-compose.yml index 553f44ee9f..d28586bf7b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -195,7 +195,7 @@ services: appwrite-console: <<: *x-logging container_name: appwrite-console - image: appwrite/console:5.0.0-rc.7 + image: appwrite/console:5.0.0-rc.11 restart: unless-stopped networks: - appwrite diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index e3a2021c1a..597943f842 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -86,6 +86,7 @@ abstract class Migration '1.5.5' => 'V20', '1.5.6' => 'V20', '1.5.7' => 'V20', + '1.6.0' => 'V21', ]; /** diff --git a/src/Appwrite/Migration/Version/V21.php b/src/Appwrite/Migration/Version/V21.php new file mode 100644 index 0000000000..75d083d87d --- /dev/null +++ b/src/Appwrite/Migration/Version/V21.php @@ -0,0 +1,72 @@ + null, + fn () => [] + ); + } + + Console::log('Migrating Project: ' . $this->project->getAttribute('name') . ' (' . $this->project->getId() . ')'); + $this->projectDB->setNamespace("_{$this->project->getInternalId()}"); + + Console::info('Migrating Collections'); + $this->migrateCollections(); + } + + /** + * Migrate Collections. + * + * @return void + * @throws Exception|Throwable + */ + private function migrateCollections(): void + { + $internalProjectId = $this->project->getInternalId(); + $collectionType = match ($internalProjectId) { + 'console' => 'console', + default => 'projects', + }; + + $collections = $this->collections[$collectionType]; + foreach ($collections as $collection) { + $id = $collection['$id']; + + Console::log("Migrating Collection \"{$id}\""); + + $this->projectDB->setNamespace("_$internalProjectId"); + + switch ($id) { + case 'projects': + + // Create accessedAt attribute + try { + $this->createAttributeFromCollection($this->projectDB, $id, 'accessedAt'); + } catch (Throwable $th) { + Console::warning("'accessedAt' from {$id}: {$th->getMessage()}"); + } + + break; + } + } + } +} From 2d195fb74e894aef2cc85cf27e16efc7b44b9f45 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 19 Jul 2024 13:54:52 +0200 Subject: [PATCH 4/4] revert: wildcard hostname in .env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 4062bde932..9cccf5ee7e 100644 --- a/.env +++ b/.env @@ -7,7 +7,7 @@ _APP_CONSOLE_WHITELIST_EMAILS= _APP_CONSOLE_SESSION_ALERTS=enabled _APP_CONSOLE_WHITELIST_IPS= _APP_CONSOLE_COUNTRIES_DENYLIST=AQ -_APP_CONSOLE_HOSTNAMES=localhost,appwrite.io,*.appwrite.io,* +_APP_CONSOLE_HOSTNAMES=localhost,appwrite.io,*.appwrite.io _APP_SYSTEM_EMAIL_NAME=Appwrite _APP_SYSTEM_EMAIL_ADDRESS=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io