diff --git a/.travis-ci/build.sh b/.travis-ci/build.sh index 27b598fd4b..050168289a 100644 --- a/.travis-ci/build.sh +++ b/.travis-ci/build.sh @@ -15,7 +15,7 @@ then exit 1 fi -if test $(find "./app/db/DBIP/dbip-country-lite-2021-02.mmdb" -mmin +259200) +if test $(find "./app/db/DBIP/dbip-country-lite-2021-06.mmdb" -mmin +259200) then printf "${RED}GEO country DB has not been updated for more than 6 months. Go to https://db-ip.com/db/download/ip-to-country-lite to download a newer version${NC}\n" fi diff --git a/CHANGES.md b/CHANGES.md index 0bedf0b12d..0dd92eeff6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,25 @@ +# NOT PUBLISHED YET + +## Features + +- Added file created date to file info on the console +- Added file size to file info on the console +- Refactored Devices page in Console: + - Renamed *Devices* to *Sessions* + - Add Provider Icon to each Session + - Add Anonymous Account Placeholder +- Upgraded telegraf docker image version to v1.1.0 + +## Bugs + +- Fixed bug when removing a project member on the Appwrite console (#1214) +- Fixed Swoole buffer output size to allow downloading files bigger than allowed size (#1189) +- Fixed ClamAV status when anti virus is not running (#1188) +- Fixed deleteSession which was removing cookieFallback from the localstorage on any logout instead of current session (#1206) +- Fixed Nepal flag (#1173) +- Fixed a bug in the Twitch OAuth adapter (#1209) +- Fixed missing session object when OAuth session creation event is triggered (#1208) + # Version 0.8.0 ## Features @@ -35,6 +57,8 @@ - Fixed incorrect audit worker event names (#1143) - Increased limit of memberships fetched in `createTeamMembership` to 2000 (#1143) - Fixed exception thrown when SSL certificate is already stored in the database (#1151) +- Fixed user delete button in the Appwrite console (#1216) +- Fixed missing placeholder for user name when empty (#1220) ## Breaking Changes (Read before upgrading!) diff --git a/Dockerfile b/Dockerfile index 2587ca737d..5c77c202df 100755 --- a/Dockerfile +++ b/Dockerfile @@ -54,8 +54,10 @@ RUN \ make && make install && \ cd .. && \ ## Imagick Extension - git clone --depth 1 --branch $PHP_IMAGICK_VERSION https://github.com/Imagick/imagick && \ + ## Last working commit https://github.com/Imagick/imagick/commit/35741750aa1cda2b7ac354bfa6128fa037e9cf32 + git clone --branch $PHP_IMAGICK_VERSION https://github.com/Imagick/imagick && \ cd imagick && \ + git checkout 35741750aa1cda2b7ac354bfa6128fa037e9cf32 && \ phpize && \ ./configure && \ make && make install && \ diff --git a/README.md b/README.md index 9725943c56..0596bee316 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ [](https://appwrite.io/discord) +[](https://store.appwrite.io) [](https://hub.docker.com/r/appwrite/appwrite) [](https://travis-ci.com/appwrite/appwrite) [](https://twitter.com/appwrite_io) -[](https://stackshare.io/appwrite) [**Appwrite 0.8 has been released! Learn what's new!**](https://dev.to/appwrite/announcing-appwrite-0-8-an-open-source-self-hosted-baas-kda) diff --git a/app/config/auth.php b/app/config/auth.php index 8e718e6804..11b89dd9ec 100644 --- a/app/config/auth.php +++ b/app/config/auth.php @@ -6,7 +6,7 @@ return [ 'email-password' => [ 'name' => 'Email/Password', 'key' => 'usersAuthEmailPassword', - 'icon' => '/images/users/email-password.png', + 'icon' => '/images/users/email.png', 'docs' => 'https://appwrite.io/docs/client/account?sdk=web#accountCreateSession', 'enabled' => true, ], diff --git a/app/config/locale/templates/email-cta.tpl b/app/config/locale/templates/email-cta.tpl index 634609a09e..97103f610e 100644 --- a/app/config/locale/templates/email-cta.tpl +++ b/app/config/locale/templates/email-cta.tpl @@ -1,7 +1,7 @@
| + |
- - - {{redirect}} - - + + {{redirect}} + \ No newline at end of file diff --git a/app/config/locale/translations/templates/es.email.auth.confirm.tpl b/app/config/locale/translations/templates/es.email.auth.confirm.tpl index 2c728ddce1..33e69819a0 100644 --- a/app/config/locale/translations/templates/es.email.auth.confirm.tpl +++ b/app/config/locale/translations/templates/es.email.auth.confirm.tpl @@ -1,4 +1,4 @@ -+ Hola {{name}},
@@ -12,4 +12,4 @@
Gracias,
- Hola, + Hola {{name}}, Te hemos enviado este correo porque {{owner}} quiere invitarte a formar parte del equipo {{team}} en {{project}}. diff --git a/app/config/locale/translations/templates/he.email.auth.confirm.tpl b/app/config/locale/translations/templates/he.email.auth.confirm.tpl index 0c1f2a36d3..585636c1c9 100644 --- a/app/config/locale/translations/templates/he.email.auth.confirm.tpl +++ b/app/config/locale/translations/templates/he.email.auth.confirm.tpl @@ -2,7 +2,7 @@ שלום {{name}}, - נא ללחוץ על הקישור שלהלן כדי לאמת את החשבון שלך. + אנא לחץ\י על הקישור שלהלן כדי לאמת את החשבון שלך. {{cta}}diff --git a/app/config/locale/translations/templates/he.email.auth.invitation.tpl b/app/config/locale/translations/templates/he.email.auth.invitation.tpl index 9a9226a5ba..b11cf388a4 100644 --- a/app/config/locale/translations/templates/he.email.auth.invitation.tpl +++ b/app/config/locale/translations/templates/he.email.auth.invitation.tpl @@ -5,7 +5,7 @@ הודעת דוא״ל זו נשלחה אליך כי {{owner}} ביקש להזמינך להצטרף לצוות {{team}} ב־{{project}}. - כדי להצטרף לצוות {{team}}, נא ללחוץ על הקישור: + כדי להצטרף לצוות {{team}}, אנא לחץ\י על הקישור: {{cta}}diff --git a/app/config/locale/translations/templates/he.email.auth.recovery.tpl b/app/config/locale/translations/templates/he.email.auth.recovery.tpl index e46bf1990e..ec249408a7 100644 --- a/app/config/locale/translations/templates/he.email.auth.recovery.tpl +++ b/app/config/locale/translations/templates/he.email.auth.recovery.tpl @@ -2,7 +2,7 @@ שלום {{name}}, - נא ללחוץ על הקישור שלהלן כדי לאפס את הסיסמה שלך ב־{{project}}. + אנא לחץ\י על הקישור שלהלן כדי לאפס את הסיסמה שלך ב־{{project}}. {{cta}}diff --git a/app/config/platforms.php b/app/config/platforms.php index cfb21f3d82..deec77d98e 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -15,7 +15,7 @@ return [ [ 'key' => 'web', 'name' => 'Web', - 'version' => '3.0.4', + 'version' => '3.1.0', 'url' => 'https://github.com/appwrite/sdk-for-web', 'package' => 'https://www.npmjs.com/package/appwrite', 'enabled' => true, @@ -62,7 +62,7 @@ return [ [ 'key' => 'flutter', 'name' => 'Flutter', - 'version' => '0.6.2', + 'version' => '0.6.4', 'url' => 'https://github.com/appwrite/sdk-for-flutter', 'package' => 'https://pub.dev/packages/appwrite', 'enabled' => true, @@ -178,7 +178,7 @@ return [ [ 'key' => 'nodejs', 'name' => 'Node.js', - 'version' => '2.2.2', + 'version' => '2.3.0', 'url' => 'https://github.com/appwrite/sdk-for-node', 'package' => 'https://www.npmjs.com/package/node-appwrite', 'enabled' => true, @@ -195,7 +195,7 @@ return [ [ 'key' => 'deno', 'name' => 'Deno', - 'version' => '0.2.1', + 'version' => '0.2.2', 'url' => 'https://github.com/appwrite/sdk-for-deno', 'package' => 'https://deno.land/x/appwrite', 'enabled' => true, @@ -212,7 +212,7 @@ return [ [ 'key' => 'php', 'name' => 'PHP', - 'version' => '2.1.1', + 'version' => '2.1.2', 'url' => 'https://github.com/appwrite/sdk-for-php', 'package' => 'https://packagist.org/packages/appwrite/appwrite', 'enabled' => true, @@ -229,7 +229,7 @@ return [ [ 'key' => 'python', 'name' => 'Python', - 'version' => '0.2.1', + 'version' => '0.3.0', 'url' => 'https://github.com/appwrite/sdk-for-python', 'package' => 'https://pypi.org/project/appwrite/', 'enabled' => true, @@ -246,7 +246,7 @@ return [ [ 'key' => 'ruby', 'name' => 'Ruby', - 'version' => '2.1.1', + 'version' => '2.2.0', 'url' => 'https://github.com/appwrite/sdk-for-ruby', 'package' => 'https://rubygems.org/gems/appwrite', 'enabled' => true, @@ -314,7 +314,7 @@ return [ [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '0.6.1', + 'version' => '0.6.3', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'package' => 'https://pub.dev/packages/dart_appwrite', 'enabled' => true, @@ -331,7 +331,7 @@ return [ [ 'key' => 'cli', 'name' => 'Command Line', - 'version' => '0.10.1', + 'version' => '0.10.0', 'url' => 'https://github.com/appwrite/sdk-for-cli', 'package' => 'https://github.com/appwrite/sdk-for-cli', 'enabled' => true, diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 61b0e27be7..13639c9125 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -58,15 +58,16 @@ App::post('/v1/account') /** @var Appwrite\Database\Database $projectDB */ /** @var Appwrite\Event\Event $audits */ + $email = \strtolower($email); if ('console' === $project->getId()) { - $whitlistEmails = $project->getAttribute('authWhitelistEmails'); - $whitlistIPs = $project->getAttribute('authWhitelistIPs'); + $whitelistEmails = $project->getAttribute('authWhitelistEmails'); + $whitelistIPs = $project->getAttribute('authWhitelistIPs'); - if (!empty($whitlistEmails) && !\in_array($email, $whitlistEmails)) { + if (!empty($whitelistEmails) && !\in_array($email, $whitelistEmails)) { throw new Exception('Console registration is restricted to specific emails. Contact your administrator for more information.', 401); } - if (!empty($whitlistIPs) && !\in_array($request->getIP(), $whitlistIPs)) { + if (!empty($whitelistIPs) && !\in_array($request->getIP(), $whitelistIPs)) { throw new Exception('Console registration is restricted to specific IPs. Contact your administrator for more information.', 401); } } @@ -174,6 +175,7 @@ App::post('/v1/account/sessions') /** @var MaxMind\Db\Reader $geodb */ /** @var Appwrite\Event\Event $audits */ + $email = \strtolower($email); $protocol = $request->getProtocol(); $profile = $projectDB->getCollectionFirst([ // Get user by email address 'limit' => 1, @@ -386,7 +388,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ->inject('projectDB') ->inject('geodb') ->inject('audits') - ->action(function ($provider, $code, $state, $request, $response, $project, $user, $projectDB, $geodb, $audits) use ($oauthDefaultSuccess) { + ->inject('events') + ->action(function ($provider, $code, $state, $request, $response, $project, $user, $projectDB, $geodb, $audits, $events) use ($oauthDefaultSuccess) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $project */ @@ -579,6 +582,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ->setParam('data', ['provider' => $provider]) ; + $events->setParam('eventData', $response->output($session, Response::MODEL_SESSION)); + if (!Config::getParam('domainVerification')) { $response ->addHeader('X-Fallback-Cookies', \json_encode([Auth::$cookieName => Auth::encodeSession($user->getId(), $secret)])) @@ -1083,6 +1088,7 @@ App::patch('/v1/account/email') throw new Exception('Invalid credentials', 401); } + $email = \strtolower($email); $profile = $projectDB->getCollectionFirst([ // Get user by email address 'limit' => 1, 'filters' => [ @@ -1272,16 +1278,16 @@ App::delete('/v1/account/sessions/:sessionId') ->setParam('resource', '/user/'.$user->getId()) ; - if (!Config::getParam('domainVerification')) { - $response - ->addHeader('X-Fallback-Cookies', \json_encode([])) - ; - } - $session->setAttribute('current', false); - + if ($session->getAttribute('secret') == Auth::hash(Auth::$secret)) { // If current session delete the cookies too $session->setAttribute('current', true); + + if (!Config::getParam('domainVerification')) { + $response + ->addHeader('X-Fallback-Cookies', \json_encode([])) + ; + } $response ->addCookie(Auth::$cookieName.'_legacy', '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, null) @@ -1405,7 +1411,8 @@ App::post('/v1/account/recovery') $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::$roles); $isAppUser = Auth::isAppUser(Authorization::$roles); - + + $email = \strtolower($email); $profile = $projectDB->getCollectionFirst([ // Get user by email address 'limit' => 1, 'filters' => [ diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 9d2a28f04f..a9c72f2d4f 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1305,7 +1305,7 @@ App::post('/v1/projects/:projectId/platforms') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_PLATFORM) ->param('projectId', null, new UID(), 'Project unique ID.') - ->param('type', null, new WhiteList(['web', 'flutter-ios', 'flutter-android', 'ios', 'android', 'unity'], true), 'Platform type.') + ->param('type', null, new WhiteList(['web', 'flutter-ios', 'flutter-android', 'flutter-linux', 'flutter-macos', 'flutter-windows', 'ios', 'android', 'unity'], true), 'Platform type.') ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.') ->param('key', '', new Text(256), 'Package name for android or bundle ID for iOS. Max length: 256 chars.', true) ->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 238e6248a1..598783128e 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -285,7 +285,8 @@ App::post('/v1/teams/:teamId/memberships') $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::$roles); $isAppUser = Auth::isAppUser(Authorization::$roles); - + + $email = \strtolower($email); $name = (empty($name)) ? $email : $name; $team = $projectDB->getDocument($teamId); @@ -784,7 +785,7 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') if ($membership->getAttribute('confirm')) { // Count only confirmed members $team = $projectDB->updateDocument(\array_merge($team->getArrayCopy(), [ - 'sum' => $team->getAttribute('sum', 0) - 1, + 'sum' => \max($team->getAttribute('sum', 0) - 1, 0), // Ensure that sum >= 0 ])); } diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 03543b7cd3..49e201e1d7 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -40,6 +40,7 @@ App::post('/v1/users') /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ + $email = \strtolower($email); $profile = $projectDB->getCollectionFirst([ // Get user by email address 'limit' => 1, 'filters' => [ diff --git a/app/controllers/mock.php b/app/controllers/mock.php index d9cd03f288..80c4c6c427 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -6,9 +6,9 @@ use Appwrite\Database\Document; use Appwrite\Network\Validator\Host; use Appwrite\Utopia\Response; use Utopia\App; -use Utopia\Validator\Numeric; -use Utopia\Validator\Text; use Utopia\Validator\ArrayList; +use Utopia\Validator\Integer; +use Utopia\Validator\Text; use Utopia\Storage\Validator\File; App::get('/v1/mock/tests/foo') @@ -24,7 +24,7 @@ App::get('/v1/mock/tests/foo') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -42,7 +42,7 @@ App::post('/v1/mock/tests/foo') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -60,7 +60,7 @@ App::patch('/v1/mock/tests/foo') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -78,7 +78,7 @@ App::put('/v1/mock/tests/foo') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -96,7 +96,7 @@ App::delete('/v1/mock/tests/foo') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -114,7 +114,7 @@ App::get('/v1/mock/tests/bar') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -132,7 +132,7 @@ App::post('/v1/mock/tests/bar') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -150,7 +150,7 @@ App::patch('/v1/mock/tests/bar') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -168,7 +168,7 @@ App::put('/v1/mock/tests/bar') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -186,11 +186,36 @@ App::delete('/v1/mock/tests/bar') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); +App::get('/v1/mock/tests/general/download') + ->desc('Download File') + ->groups(['mock']) + ->label('scope', 'public') + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('sdk.namespace', 'general') + ->label('sdk.method', 'download') + ->label('sdk.methodType', 'location') + ->label('sdk.description', 'Mock a file download request.') + ->label('sdk.response.type', '*/*') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.mock', true) + ->inject('response') + ->action(function ($response) { + /** @var Utopia\Swoole\Request $request */ + + $response + ->setContentType('text/plain') + ->addHeader('Content-Disposition', 'attachment; filename="test.txt"') + ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT') // 45 days cache + ->addHeader('X-Peak', \memory_get_peak_usage()) + ->send("Download test passed.") + ; + }); + App::post('/v1/mock/tests/general/upload') ->desc('Upload File') ->groups(['mock']) @@ -205,7 +230,7 @@ App::post('/v1/mock/tests/general/upload') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->param('file', [], new File(), 'Sample file param', false) ->inject('request') @@ -246,6 +271,7 @@ App::get('/v1/mock/tests/general/redirect') ->label('sdk.description', 'Mock a redirect request.') ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) + ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->inject('response') ->action(function ($response) { @@ -369,6 +395,7 @@ App::get('/v1/mock/tests/general/502-error') ->label('sdk.description', 'Mock a 502 bad gateway.') ->label('sdk.response.code', Response::STATUS_CODE_BAD_GATEWAY) ->label('sdk.response.type', Response::CONTENT_TYPE_TEXT) + ->label('sdk.response.model', Response::MODEL_ANY) ->label('sdk.mock', true) ->inject('response') ->action(function ($response) { diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index c9d2595b42..5a1eeda8de 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -48,7 +48,9 @@ App::init(function ($utopia, $request, $response, $project, $user, $register, $e //TODO make sure we get array here foreach ($request->getParams() as $key => $value) { // Set request params as potential abuse keys - $timeLimit->setParam('{param-'.$key.'}', (\is_array($value)) ? \json_encode($value) : $value); + if(!empty($value)) { + $timeLimit->setParam('{param-'.$key.'}', (\is_array($value)) ? \json_encode($value) : $value); + } } $abuse = new Abuse($timeLimit); diff --git a/app/controllers/web/home.php b/app/controllers/web/home.php index d76d8da054..f3eeb71c94 100644 --- a/app/controllers/web/home.php +++ b/app/controllers/web/home.php @@ -8,6 +8,7 @@ use Utopia\App; use Utopia\View; use Utopia\Config\Config; use Utopia\Exception; +use Utopia\Validator\Boolean; use Utopia\Validator\Range; use Utopia\Validator\WhiteList; @@ -494,4 +495,4 @@ App::get('/versions') } $response->json($versions); - }); \ No newline at end of file + }); diff --git a/app/db/DBIP/dbip-country-lite-2021-02.mmdb b/app/db/DBIP/dbip-country-lite-2021-02.mmdb deleted file mode 100644 index 6434c220f9..0000000000 Binary files a/app/db/DBIP/dbip-country-lite-2021-02.mmdb and /dev/null differ diff --git a/app/db/DBIP/dbip-country-lite-2021-06.mmdb b/app/db/DBIP/dbip-country-lite-2021-06.mmdb new file mode 100644 index 0000000000..984d200d19 Binary files /dev/null and b/app/db/DBIP/dbip-country-lite-2021-06.mmdb differ diff --git a/app/init.php b/app/init.php index 3d4455bb23..ab505d60f6 100644 --- a/app/init.php +++ b/app/init.php @@ -46,7 +46,7 @@ const APP_USERAGENT = APP_NAME.'-Server v%s. Please report abuse at %s'; const APP_MODE_DEFAULT = 'default'; const APP_MODE_ADMIN = 'admin'; const APP_PAGING_LIMIT = 12; -const APP_CACHE_BUSTER = 146; +const APP_CACHE_BUSTER = 148; const APP_VERSION_STABLE = '0.8.0'; const APP_STORAGE_UPLOADS = '/storage/uploads'; const APP_STORAGE_FUNCTIONS = '/storage/functions'; @@ -228,7 +228,7 @@ $register->set('smtp', function () { return $mail; }); $register->set('geodb', function () { - return new Reader(__DIR__.'/db/DBIP/dbip-country-lite-2021-02.mmdb'); + return new Reader(__DIR__.'/db/DBIP/dbip-country-lite-2021-06.mmdb'); }); /* diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php index 108ce7a486..96d9dbf563 100644 --- a/app/tasks/sdks.php +++ b/app/tasks/sdks.php @@ -202,7 +202,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND \exec('rm -rf '.$target.' && \ mkdir -p '.$target.' && \ cd '.$target.' && \ - git init && \ + git init --initial-branch=master && \ git remote add origin '.$gitUrl.' && \ git fetch && \ git pull '.$gitUrl.' && \ diff --git a/app/views/console/account/index.phtml b/app/views/console/account/index.phtml index 3f1e7decc9..4ad919cc2b 100644 --- a/app/views/console/account/index.phtml +++ b/app/views/console/account/index.phtml @@ -193,8 +193,8 @@ - Devices+Sessions
-
@@ -317,7 +329,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
-
+
Unknown
on
@@ -283,7 +289,7 @@
data-failure-param-alert-text="Logout from All Sessions Failed"
data-failure-param-alert-classname="error">
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+ Register your Flutter App@@ -387,6 +399,105 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);+ + + + Linux+ + +MacOS+ + +Windows+ +
- -----
+ Unknown
+ Anonymous User
|
@@ -479,7 +480,7 @@ $auth = $this->getParam('auth', []);
- |
+
escape($name); ?> sandbox beta
diff --git a/app/views/console/users/team.phtml b/app/views/console/users/team.phtml
index 912d123062..4b1efcd22b 100644
--- a/app/views/console/users/team.phtml
+++ b/app/views/console/users/team.phtml
@@ -12,7 +12,7 @@
- Unknown + Unknown diff --git a/app/views/console/users/user.phtml b/app/views/console/users/user.phtml index 048d870071..d949823501 100644 --- a/app/views/console/users/user.phtml +++ b/app/views/console/users/user.phtml @@ -12,7 +12,8 @@ - Unknown + Unknown + Anonymous User @@ -96,7 +97,7 @@ Danger Zone-
+
- This is the area where you can delete this user. By deleting this user you will lose all data associated with this user. @@ -109,7 +110,7 @@ data-analytics-event="submit" data-analytics-category="console" data-analytics-label="Delete User" - data-service="users.deleteUser" + data-service="users.delete" data-event="submit" data-param-user-id="{{router.params.id}}" data-success="alert,trigger,redirect" @@ -180,8 +181,8 @@Devices+Sessions
-
-
@@ -259,11 +265,11 @@
data-param-user-id="{{router.params.id}}"
data-event="load,logs-load">
-
+
on
+
+
-
@@ -244,7 +250,7 @@
data-failure-param-alert-text="Failed to logout all sessions"
data-failure-param-alert-classname="error">
-
+
|