diff --git a/README.md b/README.md index 3d1a0db74f..05a2133466 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,10 @@

+ [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github) [![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite) -[![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite) +[![Build Status](https://img.shields.io/github/checks-status/appwrite/appwrite/master?label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md) [![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io) @@ -171,4 +172,4 @@ Join our growing community around the world! See our official [Blog](https://med ## License -This repository is available under the [BSD 3-Clause License](./LICENSE). \ No newline at end of file +This repository is available under the [BSD 3-Clause License](./LICENSE). diff --git a/app/config/collections.php b/app/config/collections.php index abcdec9c1d..daccd9258d 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -99,8 +99,8 @@ $collections = [ '$id' => '_fulltext_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [1024], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -574,8 +574,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -1106,8 +1106,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], [ '$id' => '_key_deleted_email', @@ -1422,8 +1422,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -1720,8 +1720,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -1892,8 +1892,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -1983,8 +1983,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -2118,8 +2118,8 @@ $collections = [ '$id' => '_fulltext_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [16384], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], diff --git a/app/config/providers.php b/app/config/providers.php index 3aabbf60c2..9940c185a3 100644 --- a/app/config/providers.php +++ b/app/config/providers.php @@ -127,7 +127,7 @@ return [ // Ordered by ABC. 'icon' => 'icon-windows', 'enabled' => true, 'sandbox' => false, - 'form' => false, + 'form' => 'microsoft.phtml', 'beta' => false, 'mock' => false, ], @@ -287,6 +287,16 @@ return [ // Ordered by ABC. 'beta' => false, 'mock' => false ], + 'stripe' => [ + 'name' => 'Stripe', + 'developers' => 'https://stripe.com/docs/api', + 'icon' => 'icon-stripe', + 'enabled' => true, + 'sandbox' => false, + 'form' => false, + 'beta' => false, + 'mock' => false + ], // Keep Last 'mock' => [ 'name' => 'Mock', diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 19c8cf3b27..b25e61db1a 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -315,7 +315,7 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->label('docs', false) ->param('projectId', '', new Text(1024), 'Project ID.') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.') - ->param('code', '', new Text(1024), 'OAuth2 code.') + ->param('code', '', new Text(2048), 'OAuth2 code.') ->param('state', '', new Text(2048), 'Login state params.', true) ->inject('request') ->inject('response') @@ -342,7 +342,7 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->label('docs', false) ->param('projectId', '', new Text(1024), 'Project ID.') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.') - ->param('code', '', new Text(1024), 'OAuth2 code.') + ->param('code', '', new Text(2048), 'OAuth2 code.') ->param('state', '', new Text(2048), 'Login state params.', true) ->inject('request') ->inject('response') @@ -370,7 +370,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ->label('abuse-key', 'ip:{ip}') ->label('docs', false) ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.') - ->param('code', '', new Text(1024), 'OAuth2 code.') + ->param('code', '', new Text(2048), 'OAuth2 code.') ->param('state', '', new Text(2048), 'OAuth2 state params.', true) ->inject('request') ->inject('response') diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index da3cfc68b0..46b9897201 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -2011,14 +2011,18 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') $roles = Authorization::getRoles(); if (!Auth::isAppUser($roles) && !Auth::isPrivilegedUser($roles)) { - foreach ($data['$read'] as $read) { - if (!Authorization::isRole($read)) { - throw new Exception('Read permissions must be one of: ('.\implode(', ', $roles).')', 400); + if(!is_null($read)) { + foreach ($data['$read'] as $read) { + if (!Authorization::isRole($read)) { + throw new Exception('Read permissions must be one of: ('.\implode(', ', $roles).')', 400); + } } } - foreach ($data['$write'] as $write) { - if (!Authorization::isRole($write)) { - throw new Exception('Write permissions must be one of: ('.\implode(', ', $roles).')', 400); + if(!is_null($write)) { + foreach ($data['$write'] as $write) { + if (!Authorization::isRole($write)) { + throw new Exception('Write permissions must be one of: (' . \implode(', ', $roles) . ')', 400); + } } } } diff --git a/app/init.php b/app/init.php index d591d1ddbd..a45ac69aea 100644 --- a/app/init.php +++ b/app/init.php @@ -491,11 +491,12 @@ $register->set('geodb', function () { }); $register->set('db', function () { // This is usually for our workers or CLI commands scope $dbHost = App::getEnv('_APP_DB_HOST', ''); + $dbPort = App::getEnv('_APP_DB_PORT', ''); $dbUser = App::getEnv('_APP_DB_USER', ''); $dbPass = App::getEnv('_APP_DB_PASS', ''); $dbScheme = App::getEnv('_APP_DB_SCHEMA', ''); - $pdo = new PDO("mysql:host={$dbHost};dbname={$dbScheme};charset=utf8mb4", $dbUser, $dbPass, array( + $pdo = new PDO("mysql:host={$dbHost};port={$dbPort};dbname={$dbScheme};charset=utf8mb4", $dbUser, $dbPass, array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', PDO::ATTR_TIMEOUT => 3, // Seconds PDO::ATTR_PERSISTENT => true, diff --git a/app/views/console/database/collection.phtml b/app/views/console/database/collection.phtml index 93db293ad1..6c788858a5 100644 --- a/app/views/console/database/collection.phtml +++ b/app/views/console/database/collection.phtml @@ -527,15 +527,6 @@ $logs = $this->getParam('logs', null);
-
-
-
- Document Level -

With Document Level permissions, you have granular access control over every document. Users will only be able to access documents for which they have explicit permissions.

-

In this permission level, document permissions take precedence and collection permissions are ignored.

-
-
-
@@ -554,6 +545,15 @@ $logs = $this->getParam('logs', null);
+
+
+
+ Document Level +

With Document Level permissions, you have granular access control over every document. Users will only be able to access documents for which they have explicit permissions.

+

In this permission level, document permissions take precedence and collection permissions are ignored.

+
+
+
@@ -880,10 +880,10 @@ $logs = $this->getParam('logs', null);
  Default Value
diff --git a/app/views/console/database/document.phtml b/app/views/console/database/document.phtml index 308629c609..8c8de7429b 100644 --- a/app/views/console/database/document.phtml +++ b/app/views/console/database/document.phtml @@ -169,8 +169,11 @@ $logs = $this->getParam('logs', null);