Skip to content

Commit

Permalink
Merge pull request #6238 from appwrite/1.4.x
Browse files Browse the repository at this point in the history
1.4.x
  • Loading branch information
abnegate committed Sep 15, 2023
2 parents 549e0b4 + 6770b99 commit 9ba609c
Show file tree
Hide file tree
Showing 24 changed files with 236 additions and 284 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "app/console"]
path = app/console
url = https://github.com/appwrite/console
branch = 3.0.4
branch = 3.1.1
28 changes: 28 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# Version 1.4.3

## Features
- Support for the all new bun runtime [#6230](https://github.com/appwrite/appwrite/pull/6230)
- Stripe function templates [Console #540](https://github.com/appwrite/console/pull/540)

## Fixes
- Fix missing _APP_OPENSSL_KEY_V1 in the compose file [#6199](https://github.com/appwrite/appwrite/pull/6199)
- Fix V2 functions env vars [#6215](https://github.com/appwrite/appwrite/pull/6215)
- Fix Don't update User Accessed At for Users and Teams APIs [#6222](https://github.com/appwrite/appwrite/pull/6222)
- Fix Git deploys with S3 [#6227](https://github.com/appwrite/appwrite/pull/6227)
- Fix manual internal id insertion [#6232](https://github.com/appwrite/appwrite/pull/6232)
- Fix function timeout [#6235](https://github.com/appwrite/appwrite/pull/6235)
- Fix collections with datetime attributes migration [#17](https://github.com/utopia-php/migration/pull/17)
- Fix not all user data being migrated [#17](https://github.com/utopia-php/migration/pull/17)
- Fix team memberships migration [#16](https://github.com/utopia-php/migration/pull/16)
- Fix events validation on create/update webhooks [#6219](https://github.com/appwrite/appwrite/pull/6219)
- Fix schedules task [#6246](https://github.com/appwrite/appwrite/pull/6246)
- Fix missing keys when updating document via relationship [Database #320](https://github.com/utopia-php/database/pull/320)
- Fix Discord template [Console #538](https://github.com/appwrite/console/pull/538)
- Fix form var is url not text [Console #539](https://github.com/appwrite/console/pull/539)
- Fix incorrect link to migration docs for self-hosted to cloud [Console #543](https://github.com/appwrite/console/pull/543)
- Fix can't disable smtp [Console #548](https://github.com/appwrite/console/pull/548)
- Fix create function cover for case where VCS is not enabled [Console #544](https://github.com/appwrite/console/pull/544)
- Fix users list not re-rendering [Console #537](https://github.com/appwrite/console/pull/537)
- Fix create attribute modal null when selecting same time twice [Console #549](https://github.com/appwrite/console/pull/549)
- Fix runtime versions in templates [Console #546](https://github.com/appwrite/console/pull/546)

# Version 1.4.2

## Fixes
Expand Down
95 changes: 2 additions & 93 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,99 +37,8 @@ ARG VERSION=dev
ARG DEBUG=false
ENV DEBUG=$DEBUG

ENV DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
ENV DOCKER_COMPOSE_VERSION=v2.5.0

ENV _APP_SERVER=swoole \
_APP_ENV=production \
_APP_LOCALE=en \
_APP_WORKER_PER_CORE= \
_APP_DOMAIN=localhost \
_APP_DOMAIN_FUNCTIONS=functions.localhost \
_APP_DOMAIN_TARGET=localhost \
_APP_HOME=https://appwrite.io \
_APP_EDITION=community \
_APP_CONSOLE_WHITELIST_ROOT=enabled \
_APP_CONSOLE_WHITELIST_EMAILS= \
_APP_CONSOLE_WHITELIST_IPS= \
_APP_SYSTEM_EMAIL_NAME= \
_APP_SYSTEM_EMAIL_ADDRESS= \
_APP_SYSTEM_RESPONSE_FORMAT= \
_APP_SYSTEM_SECURITY_EMAIL_ADDRESS= \
_APP_OPTIONS_ABUSE=enabled \
_APP_OPTIONS_FORCE_HTTPS=disabled \
_APP_OPENSSL_KEY_V1=your-secret-key \
_APP_STORAGE_LIMIT=10000000 \
_APP_STORAGE_ANTIVIRUS=enabled \
_APP_STORAGE_ANTIVIRUS_HOST=clamav \
_APP_STORAGE_ANTIVIRUS_PORT=3310 \
_APP_STORAGE_DEVICE=Local \
_APP_STORAGE_S3_ACCESS_KEY= \
_APP_STORAGE_S3_SECRET= \
_APP_STORAGE_S3_REGION= \
_APP_STORAGE_S3_BUCKET= \
_APP_STORAGE_DO_SPACES_ACCESS_KEY= \
_APP_STORAGE_DO_SPACES_SECRET= \
_APP_STORAGE_DO_SPACES_REGION= \
_APP_STORAGE_DO_SPACES_BUCKET= \
_APP_STORAGE_BACKBLAZE_ACCESS_KEY= \
_APP_STORAGE_BACKBLAZE_SECRET= \
_APP_STORAGE_BACKBLAZE_REGION= \
_APP_STORAGE_BACKBLAZE_BUCKET= \
_APP_STORAGE_LINODE_ACCESS_KEY= \
_APP_STORAGE_LINODE_SECRET= \
_APP_STORAGE_LINODE_REGION= \
_APP_STORAGE_LINODE_BUCKET= \
_APP_STORAGE_WASABI_ACCESS_KEY= \
_APP_STORAGE_WASABI_SECRET= \
_APP_STORAGE_WASABI_REGION= \
_APP_STORAGE_WASABI_BUCKET= \
_APP_REDIS_HOST=redis \
_APP_REDIS_PORT=6379 \
_APP_DB_HOST=mariadb \
_APP_DB_PORT=3306 \
_APP_DB_USER=root \
_APP_DB_PASS=password \
_APP_DB_SCHEMA=appwrite \
_APP_INFLUXDB_HOST=influxdb \
_APP_INFLUXDB_PORT=8086 \
_APP_STATSD_HOST=telegraf \
_APP_STATSD_PORT=8125 \
_APP_SMTP_HOST= \
_APP_SMTP_PORT= \
_APP_SMTP_SECURE= \
_APP_SMTP_USERNAME= \
_APP_SMTP_PASSWORD= \
_APP_SMS_PROVIDER= \
_APP_SMS_FROM= \
_APP_FUNCTIONS_SIZE_LIMIT=30000000 \
_APP_FUNCTIONS_TIMEOUT=900 \
_APP_FUNCTIONS_CONTAINERS=10 \
_APP_FUNCTIONS_CPUS=1 \
_APP_FUNCTIONS_MEMORY=128 \
_APP_FUNCTIONS_MEMORY_SWAP=128 \
_APP_EXECUTOR_SECRET=a-random-secret \
_APP_EXECUTOR_HOST=http://appwrite-executor/v1 \
_APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION \
_APP_USAGE_STATS=enabled \
_APP_USAGE_AGGREGATION_INTERVAL=30 \
# 14 Days = 1209600 s
_APP_MAINTENANCE_RETENTION_EXECUTION=1209600 \
_APP_MAINTENANCE_RETENTION_AUDIT=1209600 \
# 1 Day = 86400 s
_APP_MAINTENANCE_RETENTION_ABUSE=86400 \
_APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000 \
_APP_MAINTENANCE_INTERVAL=86400 \
_APP_LOGGING_PROVIDER= \
_APP_LOGGING_CONFIG= \
_APP_VCS_GITHUB_APP_NAME= \
_APP_VCS_GITHUB_PRIVATE_KEY= \
_APP_VCS_GITHUB_APP_ID= \
_APP_VCS_GITHUB_CLIENT_ID= \
_APP_VCS_GITHUB_CLIENT_SECRET= \
_APP_VCS_GITHUB_WEBHOOK_SECRET=
ENV _APP_VERSION=$VERSION \
_APP_HOME=https://appwrite.io

RUN \
if [ "$DEBUG" == "true" ]; then \
Expand Down
6 changes: 3 additions & 3 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```

### Windows
Expand All @@ -78,7 +78,7 @@ docker run -it --rm ^
--volume //var/run/docker.sock:/var/run/docker.sock ^
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
--entrypoint="install" ^
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```

#### PowerShell
Expand All @@ -88,7 +88,7 @@ docker run -it --rm `
--volume /var/run/docker.sock:/var/run/docker.sock `
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
--entrypoint="install" `
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```

运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```

### Windows
Expand All @@ -87,7 +87,7 @@ docker run -it --rm ^
--volume //var/run/docker.sock:/var/run/docker.sock ^
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
--entrypoint="install" ^
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```

#### PowerShell
Expand All @@ -97,7 +97,7 @@ docker run -it --rm `
--volume /var/run/docker.sock:/var/run/docker.sock `
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
--entrypoint="install" `
appwrite/appwrite:1.4.2
appwrite/appwrite:1.4.3
```

Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation.
Expand Down
6 changes: 3 additions & 3 deletions app/config/platforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
[
'key' => 'apple',
'name' => 'Apple',
'version' => '4.0.0',
'version' => '4.0.1',
'url' => 'https://github.com/appwrite/sdk-for-apple',
'package' => 'https://github.com/appwrite/sdk-for-apple',
'enabled' => true,
Expand Down Expand Up @@ -203,7 +203,7 @@
[
'key' => 'cli',
'name' => 'Command Line',
'version' => '4.0.0',
'version' => '4.1.0',
'url' => 'https://github.com/appwrite/sdk-for-cli',
'package' => 'https://www.npmjs.com/package/appwrite-cli',
'enabled' => true,
Expand Down Expand Up @@ -415,7 +415,7 @@
[
'key' => 'swift',
'name' => 'Swift',
'version' => '4.0.0',
'version' => '4.0.1',
'url' => 'https://github.com/appwrite/sdk-for-swift',
'package' => 'https://github.com/appwrite/sdk-for-swift',
'enabled' => true,
Expand Down
9 changes: 5 additions & 4 deletions app/config/variables.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
'name' => '_APP_DOMAIN_FUNCTIONS',
'description' => 'A domain to use for function preview URLs. Setting to empty turns off function preview URLs.',
'introduction' => '',
'default' => '',
'default' => 'functions.localhost',
'required' => false,
'question' => '',
'filter' => ''
Expand Down Expand Up @@ -846,10 +846,11 @@
],
[
'name' => '_APP_FUNCTIONS_MAINTENANCE_INTERVAL',
'description' => 'Interval how often executor checks for inactive runimes. The default value is 60 seconds.',
'introduction' => '1.2.0',
'default' => '60',
'description' => 'Interval value containing the number of seconds that the executor should wait before checking for inactive runtimes. The default value is 3600 seconds (1 hour).',
'introduction' => '1.4.0',
'default' => '3600',
'required' => false,
'overwrite' => true,
'question' => '',
'filter' => ''
],
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/api/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
'search' => implode(' ', [$userId, $email, $name]),
'accessedAt' => DateTime::now(),
]);
$user->removeAttribute('$internalId');
Authorization::skip(fn() => $dbForProject->createDocument('users', $user));
} catch (Duplicate) {
throw new Exception(Exception::USER_ALREADY_EXISTS);
Expand Down Expand Up @@ -653,6 +654,7 @@
'search' => implode(' ', [$userId, $email, $name]),
'accessedAt' => DateTime::now(),
]);
$user->removeAttribute('$internalId');
Authorization::skip(fn() => $dbForProject->createDocument('users', $user));
} catch (Duplicate) {
$failureRedirect(Exception::USER_ALREADY_EXISTS);
Expand Down Expand Up @@ -955,6 +957,7 @@
'accessedAt' => DateTime::now(),
]);

$user->removeAttribute('$internalId');
Authorization::skip(fn () => $dbForProject->createDocument('users', $user));
}

Expand Down Expand Up @@ -1284,6 +1287,7 @@
'accessedAt' => DateTime::now(),
]);

$user->removeAttribute('$internalId');
Authorization::skip(fn () => $dbForProject->createDocument('users', $user));
}

Expand Down Expand Up @@ -1534,6 +1538,7 @@
'search' => $userId,
'accessedAt' => DateTime::now(),
]);
$user->removeAttribute('$internalId');
Authorization::skip(fn() => $dbForProject->createDocument('users', $user));

// Create session token
Expand Down
12 changes: 11 additions & 1 deletion app/controllers/api/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1456,9 +1456,9 @@

$deploymentId = ID::unique();

$deployment->removeAttribute('$internalId');
$deployment = $dbForProject->createDocument('deployments', $deployment->setAttributes([
'$id' => $deploymentId,
'$internalId' => '',
'buildId' => '',
'buildInternalId' => '',
'entrypoint' => $function->getAttribute('entrypoint'),
Expand Down Expand Up @@ -1658,6 +1658,16 @@

$vars = [];

// V2 vars
if ($version === 'v2') {
$vars = \array_merge($vars, [
'APPWRITE_FUNCTION_TRIGGER' => $headers['x-appwrite-trigger'] ?? '',
'APPWRITE_FUNCTION_DATA' => $body ?? '',
'APPWRITE_FUNCTION_USER_ID' => $headers['x-appwrite-user-id'] ?? '',
'APPWRITE_FUNCTION_JWT' => $headers['x-appwrite-user-jwt'] ?? ''
]);
}

// Shared vars
foreach ($function->getAttribute('varsProject', []) as $var) {
$vars[$var->getAttribute('key')] = $var->getAttribute('value', '');
Expand Down
1 change: 0 additions & 1 deletion app/controllers/api/teams.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,6 @@
'tokens' => null,
'memberships' => null,
'search' => implode(' ', [$userId, $email, $name]),
'accessedAt' => DateTime::now(),
])));
} catch (Duplicate $th) {
throw new Exception(Exception::USER_ALREADY_EXISTS);
Expand Down
1 change: 0 additions & 1 deletion app/controllers/api/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e
'tokens' => null,
'memberships' => null,
'search' => implode(' ', [$userId, $email, $phone, $name]),
'accessedAt' => DateTime::now(),
]));
} catch (Duplicate $th) {
throw new Exception(Exception::USER_ALREADY_EXISTS);
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/api/vcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Utopia\Database\Query;
use Utopia\Database\Validator\Authorization;
use Utopia\Database\Validator\UID;
use Utopia\Detector\Adapter\Bun;
use Utopia\Detector\Adapter\CPP;
use Utopia\Detector\Adapter\Dart;
use Utopia\Detector\Adapter\Deno;
Expand Down Expand Up @@ -469,6 +470,7 @@

$detectorFactory
->addDetector(new JavaScript())
->addDetector(new Bun())
->addDetector(new PHP())
->addDetector(new Python())
->addDetector(new Dart())
Expand Down Expand Up @@ -549,6 +551,7 @@

$detectorFactory
->addDetector(new JavaScript())
->addDetector(new Bun())
->addDetector(new PHP())
->addDetector(new Python())
->addDetector(new Dart())
Expand Down
4 changes: 2 additions & 2 deletions app/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours
const APP_USER_ACCCESS = 24 * 60 * 60; // 24 hours
const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours
const APP_CACHE_BUSTER = 509;
const APP_VERSION_STABLE = '1.4.2';
const APP_CACHE_BUSTER = 510;
const APP_VERSION_STABLE = '1.4.3';
const APP_DATABASE_ATTRIBUTE_EMAIL = 'email';
const APP_DATABASE_ATTRIBUTE_ENUM = 'enum';
const APP_DATABASE_ATTRIBUTE_IP = 'ip';
Expand Down
Loading

0 comments on commit 9ba609c

Please sign in to comment.