diff --git a/.travis-ci/build.sh b/.travis-ci/build.sh
index 27b598fd4..050168289 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/Dockerfile b/Dockerfile
index 8c59bb726..00958f3f1 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -53,8 +53,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 9725943c5..0596bee31 100644
--- a/README.md
+++ b/README.md
@@ -10,10 +10,10 @@
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
+[![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io)
[![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)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
-[![Follow Appwrite on StackShare](https://img.shields.io/badge/follow%20on-stackshare-blue?style=flat-square)](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/platforms.php b/app/config/platforms.php
index 1409cf2cc..9f83e6302 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,
@@ -179,7 +179,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,
@@ -196,7 +196,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,
@@ -213,7 +213,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,
@@ -230,7 +230,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,
@@ -247,7 +247,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,
@@ -315,7 +315,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,
@@ -332,7 +332,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 eff7c81c2..1801a26e3 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,
@@ -1086,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' => [
@@ -1408,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/teams.php b/app/controllers/api/teams.php
index 6b33b6da2..3b3039a0f 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);
diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php
index 1f628e223..9dd13e34e 100644
--- a/app/controllers/api/users.php
+++ b/app/controllers/api/users.php
@@ -41,6 +41,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 307b8c291..80c4c6c42 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,7 +186,7 @@ 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) {
});
@@ -230,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')
@@ -271,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) {
@@ -394,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/web/home.php b/app/controllers/web/home.php
index d76d8da05..f3eeb71c9 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 6434c220f..000000000
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 000000000..984d200d1
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 58ef6ca1b..e628b56da 100644
--- a/app/init.php
+++ b/app/init.php
@@ -39,7 +39,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';
@@ -233,7 +233,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 96f874229..d5f858a7b 100644
--- a/app/tasks/sdks.php
+++ b/app/tasks/sdks.php
@@ -201,7 +201,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/layouts/default.phtml b/app/views/layouts/default.phtml
index 465e08366..aa4dfc3f5 100644
--- a/app/views/layouts/default.phtml
+++ b/app/views/layouts/default.phtml
@@ -43,7 +43,7 @@ if(!empty($platforms)) {
-
+
getParam('prefetch', []) as $prefetch): ?>
@@ -52,12 +52,12 @@ if(!empty($platforms)) {
-
-
+
+
-
+
-
+