diff --git a/app/http.php b/app/http.php index f8cf9f9e64..5e514f23e1 100644 --- a/app/http.php +++ b/app/http.php @@ -163,7 +163,7 @@ $http->on('start', function (Server $http) use ($payloadSize, $register) { } } - if ($dbForConsole->getDocument('buckets', 'default')->isEmpty()) { + if ($dbForConsole->getDocument('buckets', 'default')->isEmpty() && !$dbForConsole->exists(App::getEnv('_APP_DB_SCHEMA', 'appwrite'), 'bucket_1')) { Console::success('[Setup] - Creating default bucket...'); $dbForConsole->createDocument('buckets', new Document([ '$id' => ID::custom('default'), diff --git a/app/init.php b/app/init.php index 89d33616f8..5cf24de1c2 100644 --- a/app/init.php +++ b/app/init.php @@ -434,7 +434,7 @@ Database::addFilter( } $value = json_decode($value, true); $key = App::getEnv('_APP_OPENSSL_KEY_V' . $value['version']); - + var_dump(OpenSSL::decrypt($value['data'], $value['method'], $key, 0, hex2bin($value['iv']), hex2bin($value['tag']))); return OpenSSL::decrypt($value['data'], $value['method'], $key, 0, hex2bin($value['iv']), hex2bin($value['tag'])); } ); diff --git a/src/Appwrite/Migration/Version/V15.php b/src/Appwrite/Migration/Version/V15.php index 2876093c18..e90cd12b79 100644 --- a/src/Appwrite/Migration/Version/V15.php +++ b/src/Appwrite/Migration/Version/V15.php @@ -965,7 +965,7 @@ class V15 extends Migration break; default: - continue; + break; } usleep(50000); @@ -1000,6 +1000,15 @@ class V15 extends Migration * Populate permissions attribute. */ $this->populatePermissionsAttribute($document, addCreatePermission: false); + $document->setAttribute('$permissions', Permission::read(Role::any()), Document::SET_TYPE_APPEND); + break; + + case 'sessions': + $userId = $document->getAttribute('userId'); + $document + ->setAttribute('$permissions', Permission::read(Role::user($userId)), Document::SET_TYPE_APPEND) + ->setAttribute('$permissions', Permission::update(Role::user($userId)), Document::SET_TYPE_APPEND) + ->setAttribute('$permissions', Permission::delete(Role::user($userId)), Document::SET_TYPE_APPEND); break; }