Skip to content

Commit b2dffe4

Browse files
committed
Merge branch '1.7.x' into feat-tokens-module
2 parents 3f133ca + d8e5a97 commit b2dffe4

191 files changed

Lines changed: 6008 additions & 6557 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ _APP_MAINTENANCE_RETENTION_CACHE=2592000
8686
_APP_MAINTENANCE_RETENTION_EXECUTION=1209600
8787
_APP_MAINTENANCE_RETENTION_ABUSE=86400
8888
_APP_MAINTENANCE_RETENTION_AUDIT=1209600
89+
_APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE=15778800
8990
_APP_USAGE_AGGREGATION_INTERVAL=30
9091
_APP_STATS_RESOURCES_INTERVAL=3600
9192
_APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Login to Docker Hub
2727
uses: docker/login-action@v2
2828
with:
29-
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
username: ${{ vars.DOCKERHUB_USERNAME }}
3030
password: ${{ secrets.DOCKERHUB_TOKEN }}
3131

3232
- name: Extract metadata (tags, labels) for Docker

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Login to Docker Hub
2929
uses: docker/login-action@v2
3030
with:
31-
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
username: ${{ vars.DOCKERHUB_USERNAME }}
3232
password: ${{ secrets.DOCKERHUB_TOKEN }}
3333

3434
- name: Extract metadata (tags, labels) for Docker

.gitpod.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ tasks:
77
docker pull composer
88
command: |
99
docker run --rm --interactive --tty \
10+
--user "$(id -u):$(id -g)" \
1011
--volume $PWD:/app \
1112
composer install \
1213
--ignore-platform-reqs \
@@ -23,11 +24,3 @@ vscode:
2324
extensions:
2425
- ms-azuretools.vscode-docker
2526
- zobo.php-intellisense
26-
27-
github:
28-
# https://www.gitpod.io/docs/prebuilds#github-specific-configuration
29-
prebuilds:
30-
# enable for pull requests coming from forks (defaults to false)
31-
pullRequestsFromForks: true
32-
# add a check to pull requests (defaults to true)
33-
addCheck: false

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \
1212
--no-plugins --no-scripts --prefer-dist \
1313
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
1414

15-
FROM appwrite/base:0.9.5 AS final
15+
FROM appwrite/base:0.10.1 AS final
1616

1717
LABEL maintainer="[email protected]"
1818

@@ -44,12 +44,14 @@ COPY ./dev /usr/src/code/dev
4444

4545
# Set Volumes
4646
RUN mkdir -p /storage/uploads && \
47+
mkdir -p /storage/imports && \
4748
mkdir -p /storage/cache && \
4849
mkdir -p /storage/config && \
4950
mkdir -p /storage/certificates && \
5051
mkdir -p /storage/functions && \
5152
mkdir -p /storage/debug && \
5253
chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
54+
chown -Rf www-data.www-data /storage/imports && chmod -Rf 0755 /storage/imports && \
5355
chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
5456
chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
5557
chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
@@ -88,9 +90,7 @@ RUN chmod +x /usr/local/bin/doctor && \
8890
chmod +x /usr/local/bin/worker-stats-usage && \
8991
chmod +x /usr/local/bin/worker-stats-usage-dump && \
9092
chmod +x /usr/local/bin/stats-resources && \
91-
chmod +x /usr/local/bin/worker-stats-resources && \
92-
chmod +x /usr/local/bin/worker-usage && \
93-
chmod +x /usr/local/bin/worker-usage-dump
93+
chmod +x /usr/local/bin/worker-stats-resources
9494

9595
# Letsencrypt Permissions
9696
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/

README-CN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ docker run -it --rm \
7272
--volume /var/run/docker.sock:/var/run/docker.sock \
7373
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
7474
--entrypoint="install" \
75-
appwrite/appwrite:1.6.1
75+
appwrite/appwrite:1.6.2
7676
```
7777

7878
### Windows
@@ -84,7 +84,7 @@ docker run -it --rm ^
8484
--volume //var/run/docker.sock:/var/run/docker.sock ^
8585
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
8686
--entrypoint="install" ^
87-
appwrite/appwrite:1.6.1
87+
appwrite/appwrite:1.6.2
8888
```
8989

9090
#### PowerShell
@@ -94,7 +94,7 @@ docker run -it --rm `
9494
--volume /var/run/docker.sock:/var/run/docker.sock `
9595
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
9696
--entrypoint="install" `
97-
appwrite/appwrite:1.6.1
97+
appwrite/appwrite:1.6.2
9898
```
9999

100100
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> Appwrite Init has concluded! You can check out all the latest announcements [on our Init website](https://appwrite.io/init) :rocket:
1+
> [Get started with Appwrite](https://apwr.dev/appcloud)
22
33
<br />
44
<p align="center">
@@ -24,11 +24,9 @@
2424

2525
English | [简体中文](README-CN.md)
2626

27-
[**Announcing Appwrite Cloud Public Beta! Sign up today!**](https://cloud.appwrite.io)
28-
2927
Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend apps packaged as a set of Docker<nobr> microservices. Appwrite abstracts the complexity and repetitiveness required to build a modern backend API from scratch and allows you to build secure apps faster.
3028

31-
Using Appwrite, you can easily integrate your app with user authentication and multiple sign-in methods, a database for storing and querying users and team data, storage and file management, image manipulation, Cloud Functions, and [more services](https://appwrite.io/docs).
29+
Using Appwrite, you can easily integrate your app with user authentication and multiple sign-in methods, a database for storing and querying users and team data, storage and file management, image manipulation, Cloud Functions, messaging, and [more services](https://appwrite.io/docs).
3230

3331
<p align="center">
3432
<br />
@@ -52,7 +50,7 @@ Table of Contents:
5250
- [Upgrade from an Older Version](#upgrade-from-an-older-version)
5351
- [One-Click Setups](#one-click-setups)
5452
- [Getting Started](#getting-started)
55-
- [Services](#services)
53+
- [Products](#products)
5654
- [SDKs](#sdks)
5755
- [Client](#client)
5856
- [Server](#server)
@@ -79,7 +77,7 @@ docker run -it --rm \
7977
--volume /var/run/docker.sock:/var/run/docker.sock \
8078
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
8179
--entrypoint="install" \
82-
appwrite/appwrite:1.6.1
80+
appwrite/appwrite:1.6.2
8381
```
8482

8583
### Windows
@@ -91,7 +89,7 @@ docker run -it --rm ^
9189
--volume //var/run/docker.sock:/var/run/docker.sock ^
9290
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
9391
--entrypoint="install" ^
94-
appwrite/appwrite:1.6.1
92+
appwrite/appwrite:1.6.2
9593
```
9694

9795
#### PowerShell
@@ -101,7 +99,7 @@ docker run -it --rm `
10199
--volume /var/run/docker.sock:/var/run/docker.sock `
102100
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
103101
--entrypoint="install" `
104-
appwrite/appwrite:1.6.1
102+
appwrite/appwrite:1.6.2
105103
```
106104

107105
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.

app/cli.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Appwrite\Event\StatsUsage;
1010
use Appwrite\Platform\Appwrite;
1111
use Appwrite\Runtimes\Runtimes;
12+
use Executor\Executor;
1213
use Utopia\Cache\Adapter\Sharding;
1314
use Utopia\Cache\Cache;
1415
use Utopia\CLI\CLI;
@@ -25,7 +26,7 @@
2526
use Utopia\Registry\Registry;
2627
use Utopia\System\System;
2728

28-
// overwriting runtimes to be architectur agnostic for CLI
29+
// Overwriting runtimes to be architecture agnostic for CLI
2930
Config::setParam('runtimes', (new Runtimes('v4'))->getAll(supported: false));
3031

3132
// require controllers after overwriting runtimes
@@ -43,8 +44,7 @@
4344
$adapters[] = $pools
4445
->get($value)
4546
->pop()
46-
->getResource()
47-
;
47+
->getResource();
4848
}
4949

5050
return new Cache(new Sharding($adapters));
@@ -99,6 +99,10 @@
9999
return $dbForPlatform;
100100
}, ['pools', 'cache']);
101101

102+
CLI::setResource('console', function () {
103+
return new Document(Config::getParam('console'));
104+
}, []);
105+
102106
CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) {
103107
$databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools
104108

@@ -183,7 +187,7 @@
183187
$database
184188
->setSharedTables(true)
185189
->setNamespace('logsV1')
186-
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS)
190+
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_TASK)
187191
->setMaxQueryValues(APP_DATABASE_QUERY_MAX_VALUES);
188192

189193
// set tenant
@@ -252,6 +256,8 @@
252256
};
253257
}, ['register']);
254258

259+
CLI::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST')));
260+
255261
$platform = new Appwrite();
256262
$platform->init(Service::TYPE_TASK);
257263

app/config/collections/common.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@
10381038
'$id' => ID::custom('providerUid'),
10391039
'type' => Database::VAR_STRING,
10401040
'format' => '',
1041-
'size' => 2048,
1041+
'size' => 2048, // Decrease to 128 as in index length?
10421042
'signed' => true,
10431043
'required' => false,
10441044
'default' => null,
@@ -1107,14 +1107,14 @@
11071107
'$id' => ID::custom('_key_userInternalId_provider_providerUid'),
11081108
'type' => Database::INDEX_UNIQUE,
11091109
'attributes' => ['userInternalId', 'provider', 'providerUid'],
1110-
'lengths' => [11, 128, 128],
1110+
'lengths' => [11, 128, 128], // providerUid is length 2000!
11111111
'orders' => [Database::ORDER_ASC, Database::ORDER_ASC],
11121112
],
11131113
[
11141114
'$id' => ID::custom('_key_provider_providerUid'),
11151115
'type' => Database::INDEX_UNIQUE,
11161116
'attributes' => ['provider', 'providerUid'],
1117-
'lengths' => [128, 128],
1117+
'lengths' => [128, 128], // providerUid is length 2000!
11181118
'orders' => [Database::ORDER_ASC, Database::ORDER_ASC],
11191119
],
11201120
[
@@ -1417,6 +1417,13 @@
14171417
'lengths' => [],
14181418
'orders' => [Database::ORDER_ASC],
14191419
],
1420+
[
1421+
'$id' => ID::custom('_key_roles'),
1422+
'type' => Database::INDEX_KEY,
1423+
'attributes' => ['roles'],
1424+
'lengths' => [128],
1425+
'orders' => [],
1426+
],
14201427
],
14211428
],
14221429

app/config/collections/platform.php

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,29 @@
10661066
'default' => null,
10671067
'array' => false,
10681068
'filters' => [],
1069-
]
1069+
],
1070+
[
1071+
'$id' => ID::custom('owner'),
1072+
'type' => Database::VAR_STRING,
1073+
'format' => '',
1074+
'size' => 16,
1075+
'signed' => true,
1076+
'required' => false,
1077+
'default' => '', // "Appwrite" or empty string
1078+
'array' => false,
1079+
'filters' => [],
1080+
],
1081+
[
1082+
'$id' => ID::custom('region'),
1083+
'type' => Database::VAR_STRING,
1084+
'format' => '',
1085+
'size' => 16,
1086+
'signed' => true,
1087+
'required' => true,
1088+
'default' => null,
1089+
'array' => false,
1090+
'filters' => [],
1091+
],
10701092
],
10711093
'indexes' => [
10721094
[
@@ -1111,6 +1133,20 @@
11111133
'lengths' => [],
11121134
'orders' => [Database::ORDER_ASC],
11131135
],
1136+
[
1137+
'$id' => ID::custom('_key_owner'),
1138+
'type' => Database::INDEX_KEY,
1139+
'attributes' => ['owner'],
1140+
'lengths' => [16],
1141+
'orders' => [Database::ORDER_ASC],
1142+
],
1143+
[
1144+
'$id' => ID::custom('_key_region'),
1145+
'type' => Database::INDEX_KEY,
1146+
'attributes' => ['region'],
1147+
'lengths' => [16],
1148+
'orders' => [Database::ORDER_ASC],
1149+
],
11141150
],
11151151
],
11161152

0 commit comments

Comments
 (0)