Merge branch '1.4.x' of github.com:appwrite/appwrite into fix-email-templates
This commit is contained in:
commit
4e19c94d08
24 changed files with 192 additions and 60 deletions
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -1,4 +1,4 @@
|
||||||
[submodule "app/console"]
|
[submodule "app/console"]
|
||||||
path = app/console
|
path = app/console
|
||||||
url = https://github.com/appwrite/console
|
url = https://github.com/appwrite/console
|
||||||
branch = 3.0.1
|
branch = 3.0.2
|
||||||
|
|
10
CHANGES.md
10
CHANGES.md
|
@ -1,8 +1,18 @@
|
||||||
# Version 1.4.1
|
# Version 1.4.1
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Add upgrade task [#6068](https://github.com/appwrite/appwrite/pull/6068)
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|
||||||
|
- Fix VCS/migration/assistant scopes [#6071](https://github.com/appwrite/appwrite/pull/6071)
|
||||||
- Add missing parameters required for custom email templates [#6077](https://github.com/appwrite/appwrite/pull/6077)
|
- Add missing parameters required for custom email templates [#6077](https://github.com/appwrite/appwrite/pull/6077)
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Update console to 3.0.2 [#6071](https://github.com/appwrite/appwrite/pull/6071)
|
||||||
|
|
||||||
# Version 1.4.0
|
# Version 1.4.0
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
|
@ -167,6 +167,7 @@ RUN chmod +x /usr/local/bin/doctor && \
|
||||||
chmod +x /usr/local/bin/maintenance && \
|
chmod +x /usr/local/bin/maintenance && \
|
||||||
chmod +x /usr/local/bin/usage && \
|
chmod +x /usr/local/bin/usage && \
|
||||||
chmod +x /usr/local/bin/install && \
|
chmod +x /usr/local/bin/install && \
|
||||||
|
chmod +x /usr/local/bin/upgrade && \
|
||||||
chmod +x /usr/local/bin/migrate && \
|
chmod +x /usr/local/bin/migrate && \
|
||||||
chmod +x /usr/local/bin/realtime && \
|
chmod +x /usr/local/bin/realtime && \
|
||||||
chmod +x /usr/local/bin/schedule && \
|
chmod +x /usr/local/bin/schedule && \
|
||||||
|
|
|
@ -66,7 +66,7 @@ docker run -it --rm \
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||||
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
||||||
--entrypoint="install" \
|
--entrypoint="install" \
|
||||||
appwrite/appwrite:1.4.0
|
appwrite/appwrite:1.4.1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -78,7 +78,7 @@ docker run -it --rm ^
|
||||||
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
||||||
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
||||||
--entrypoint="install" ^
|
--entrypoint="install" ^
|
||||||
appwrite/appwrite:1.4.0
|
appwrite/appwrite:1.4.1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### PowerShell
|
#### PowerShell
|
||||||
|
@ -88,7 +88,7 @@ docker run -it --rm `
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock `
|
--volume /var/run/docker.sock:/var/run/docker.sock `
|
||||||
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
|
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
|
||||||
--entrypoint="install" `
|
--entrypoint="install" `
|
||||||
appwrite/appwrite:1.4.0
|
appwrite/appwrite:1.4.1
|
||||||
```
|
```
|
||||||
|
|
||||||
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
|
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
|
||||||
|
|
|
@ -75,7 +75,7 @@ docker run -it --rm \
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||||
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
||||||
--entrypoint="install" \
|
--entrypoint="install" \
|
||||||
appwrite/appwrite:1.4.0
|
appwrite/appwrite:1.4.1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -87,7 +87,7 @@ docker run -it --rm ^
|
||||||
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
||||||
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
||||||
--entrypoint="install" ^
|
--entrypoint="install" ^
|
||||||
appwrite/appwrite:1.4.0
|
appwrite/appwrite:1.4.1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### PowerShell
|
#### PowerShell
|
||||||
|
@ -97,7 +97,7 @@ docker run -it --rm `
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock `
|
--volume /var/run/docker.sock:/var/run/docker.sock `
|
||||||
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
|
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
|
||||||
--entrypoint="install" `
|
--entrypoint="install" `
|
||||||
appwrite/appwrite:1.4.0
|
appwrite/appwrite:1.4.1
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
|
@ -357,7 +357,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'dotnet',
|
'key' => 'dotnet',
|
||||||
'name' => '.NET',
|
'name' => '.NET',
|
||||||
'version' => '0.4.2',
|
'version' => '0.5.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-dotnet',
|
'url' => 'https://github.com/appwrite/sdk-for-dotnet',
|
||||||
'package' => 'https://www.nuget.org/packages/Appwrite',
|
'package' => 'https://www.nuget.org/packages/Appwrite',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
|
|
@ -57,6 +57,9 @@ $admins = [
|
||||||
'rules.write',
|
'rules.write',
|
||||||
'migrations.read',
|
'migrations.read',
|
||||||
'migrations.write',
|
'migrations.write',
|
||||||
|
'vcs.read',
|
||||||
|
'vcs.write',
|
||||||
|
'assistant.read',
|
||||||
];
|
];
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -87,5 +87,14 @@ return [ // List of publicly visible scopes
|
||||||
],
|
],
|
||||||
'migrations.write' => [
|
'migrations.write' => [
|
||||||
'description' => 'Access to create, update, and delete your project\'s migrations.',
|
'description' => 'Access to create, update, and delete your project\'s migrations.',
|
||||||
]
|
],
|
||||||
|
'vcs.read' => [
|
||||||
|
'description' => 'Access to read your project\'s VCS repositories',
|
||||||
|
],
|
||||||
|
'vcs.write' => [
|
||||||
|
'description' => 'Access to create, update, and delete your project\'s VCS repositories',
|
||||||
|
],
|
||||||
|
'assistant.read' => [
|
||||||
|
'description' => 'Access to read the Assistant service',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -58,6 +58,7 @@ App::get('/v1/console/variables')
|
||||||
App::post('/v1/console/assistant')
|
App::post('/v1/console/assistant')
|
||||||
->desc('Ask Query')
|
->desc('Ask Query')
|
||||||
->groups(['api', 'assistant'])
|
->groups(['api', 'assistant'])
|
||||||
|
->label('scope', 'assistant.read')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.namespace', 'assistant')
|
->label('sdk.namespace', 'assistant')
|
||||||
->label('sdk.method', 'chat')
|
->label('sdk.method', 'chat')
|
||||||
|
|
|
@ -580,7 +580,7 @@ App::get('/v1/migrations/firebase/report/oauth')
|
||||||
App::get('/v1/migrations/firebase/connect')
|
App::get('/v1/migrations/firebase/connect')
|
||||||
->desc('Authorize with firebase')
|
->desc('Authorize with firebase')
|
||||||
->groups(['api', 'migrations'])
|
->groups(['api', 'migrations'])
|
||||||
->label('origin', '*')
|
->label('scope', 'migrations.read')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.namespace', 'migrations')
|
->label('sdk.namespace', 'migrations')
|
||||||
->label('sdk.method', 'createFirebaseAuth')
|
->label('sdk.method', 'createFirebaseAuth')
|
||||||
|
@ -622,6 +622,7 @@ App::get('/v1/migrations/firebase/connect')
|
||||||
App::get('/v1/migrations/firebase/redirect')
|
App::get('/v1/migrations/firebase/redirect')
|
||||||
->desc('Capture and receive data on Firebase authorization')
|
->desc('Capture and receive data on Firebase authorization')
|
||||||
->groups(['api', 'migrations'])
|
->groups(['api', 'migrations'])
|
||||||
|
->label('scope', 'public')
|
||||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||||
->param('code', '', new Text(2048), 'OAuth2 code. This is a temporary code that the will be later exchanged for an access token.', true)
|
->param('code', '', new Text(2048), 'OAuth2 code. This is a temporary code that the will be later exchanged for an access token.', true)
|
||||||
->inject('user')
|
->inject('user')
|
||||||
|
@ -733,6 +734,7 @@ App::get('/v1/migrations/firebase/redirect')
|
||||||
App::get('/v1/migrations/firebase/projects')
|
App::get('/v1/migrations/firebase/projects')
|
||||||
->desc('List Firebase Projects')
|
->desc('List Firebase Projects')
|
||||||
->groups(['api', 'migrations'])
|
->groups(['api', 'migrations'])
|
||||||
|
->label('scope', 'migrations.read')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.namespace', 'migrations')
|
->label('sdk.namespace', 'migrations')
|
||||||
->label('sdk.method', 'listFirebaseProjects')
|
->label('sdk.method', 'listFirebaseProjects')
|
||||||
|
@ -821,6 +823,7 @@ App::get('/v1/migrations/firebase/projects')
|
||||||
App::get('/v1/migrations/firebase/deauthorize')
|
App::get('/v1/migrations/firebase/deauthorize')
|
||||||
->desc('Revoke Appwrite\'s authorization to access Firebase Projects')
|
->desc('Revoke Appwrite\'s authorization to access Firebase Projects')
|
||||||
->groups(['api', 'migrations'])
|
->groups(['api', 'migrations'])
|
||||||
|
->label('scope', 'migrations.write')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.namespace', 'migrations')
|
->label('sdk.namespace', 'migrations')
|
||||||
->label('sdk.method', 'deleteFirebaseAuth')
|
->label('sdk.method', 'deleteFirebaseAuth')
|
||||||
|
|
|
@ -226,8 +226,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId
|
||||||
App::get('/v1/vcs/github/authorize')
|
App::get('/v1/vcs/github/authorize')
|
||||||
->desc('Install GitHub App')
|
->desc('Install GitHub App')
|
||||||
->groups(['api', 'vcs'])
|
->groups(['api', 'vcs'])
|
||||||
->label('origin', '*')
|
->label('scope', 'vcs.read')
|
||||||
->label('sdk.auth', [])
|
|
||||||
->label('sdk.namespace', 'vcs')
|
->label('sdk.namespace', 'vcs')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.method', 'createGitHubInstallation')
|
->label('sdk.method', 'createGitHubInstallation')
|
||||||
|
@ -238,12 +237,12 @@ App::get('/v1/vcs/github/authorize')
|
||||||
->label('sdk.hide', true)
|
->label('sdk.hide', true)
|
||||||
->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a successful installation attempt.', true, ['clients'])
|
->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a successful installation attempt.', true, ['clients'])
|
||||||
->param('failure', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a failed installation attempt.', true, ['clients'])
|
->param('failure', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a failed installation attempt.', true, ['clients'])
|
||||||
->param('projectId', '', new UID(), 'Project ID')
|
|
||||||
->inject('request')
|
->inject('request')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function (string $success, string $failure, string $projectId, Request $request, Response $response) {
|
->inject('project')
|
||||||
|
->action(function (string $success, string $failure, Request $request, Response $response, Document $project) {
|
||||||
$state = \json_encode([
|
$state = \json_encode([
|
||||||
'projectId' => $projectId,
|
'projectId' => $project->getId(),
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'failure' => $failure,
|
'failure' => $failure,
|
||||||
]);
|
]);
|
||||||
|
@ -263,6 +262,7 @@ App::get('/v1/vcs/github/authorize')
|
||||||
App::get('/v1/vcs/github/callback')
|
App::get('/v1/vcs/github/callback')
|
||||||
->desc('Capture installation and authorization from GitHub App')
|
->desc('Capture installation and authorization from GitHub App')
|
||||||
->groups(['api', 'vcs'])
|
->groups(['api', 'vcs'])
|
||||||
|
->label('scope', 'public')
|
||||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||||
->param('installation_id', '', new Text(256, 0), 'GitHub installation ID', true)
|
->param('installation_id', '', new Text(256, 0), 'GitHub installation ID', true)
|
||||||
->param('setup_action', '', new Text(256, 0), 'GitHub setup actuon type', true)
|
->param('setup_action', '', new Text(256, 0), 'GitHub setup actuon type', true)
|
||||||
|
@ -422,6 +422,7 @@ App::get('/v1/vcs/github/callback')
|
||||||
App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:providerRepositoryId/detection')
|
App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:providerRepositoryId/detection')
|
||||||
->desc('Detect runtime settings from source code')
|
->desc('Detect runtime settings from source code')
|
||||||
->groups(['api', 'vcs'])
|
->groups(['api', 'vcs'])
|
||||||
|
->label('scope', 'vcs.write')
|
||||||
->label('sdk.namespace', 'vcs')
|
->label('sdk.namespace', 'vcs')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.method', 'createRepositoryDetection')
|
->label('sdk.method', 'createRepositoryDetection')
|
||||||
|
@ -488,6 +489,7 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:pr
|
||||||
App::get('/v1/vcs/github/installations/:installationId/providerRepositories')
|
App::get('/v1/vcs/github/installations/:installationId/providerRepositories')
|
||||||
->desc('List Repositories')
|
->desc('List Repositories')
|
||||||
->groups(['api', 'vcs'])
|
->groups(['api', 'vcs'])
|
||||||
|
->label('scope', 'vcs.read')
|
||||||
->label('sdk.namespace', 'vcs')
|
->label('sdk.namespace', 'vcs')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.method', 'listRepositories')
|
->label('sdk.method', 'listRepositories')
|
||||||
|
@ -580,6 +582,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories')
|
||||||
App::post('/v1/vcs/github/installations/:installationId/providerRepositories')
|
App::post('/v1/vcs/github/installations/:installationId/providerRepositories')
|
||||||
->desc('Create repository')
|
->desc('Create repository')
|
||||||
->groups(['api', 'vcs'])
|
->groups(['api', 'vcs'])
|
||||||
|
->label('scope', 'vcs.write')
|
||||||
->label('sdk.namespace', 'vcs')
|
->label('sdk.namespace', 'vcs')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.method', 'createRepository')
|
->label('sdk.method', 'createRepository')
|
||||||
|
@ -680,6 +683,7 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories')
|
||||||
App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:providerRepositoryId')
|
App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:providerRepositoryId')
|
||||||
->desc('Get repository')
|
->desc('Get repository')
|
||||||
->groups(['api', 'vcs'])
|
->groups(['api', 'vcs'])
|
||||||
|
->label('scope', 'vcs.read')
|
||||||
->label('sdk.namespace', 'vcs')
|
->label('sdk.namespace', 'vcs')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.method', 'getRepository')
|
->label('sdk.method', 'getRepository')
|
||||||
|
@ -725,6 +729,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro
|
||||||
App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:providerRepositoryId/branches')
|
App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:providerRepositoryId/branches')
|
||||||
->desc('List Repository Branches')
|
->desc('List Repository Branches')
|
||||||
->groups(['api', 'vcs'])
|
->groups(['api', 'vcs'])
|
||||||
|
->label('scope', 'vcs.read')
|
||||||
->label('sdk.namespace', 'vcs')
|
->label('sdk.namespace', 'vcs')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.method', 'listRepositoryBranches')
|
->label('sdk.method', 'listRepositoryBranches')
|
||||||
|
@ -770,6 +775,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro
|
||||||
App::post('/v1/vcs/github/events')
|
App::post('/v1/vcs/github/events')
|
||||||
->desc('Create Event')
|
->desc('Create Event')
|
||||||
->groups(['api', 'vcs'])
|
->groups(['api', 'vcs'])
|
||||||
|
->label('scope', 'public')
|
||||||
->inject('gitHub')
|
->inject('gitHub')
|
||||||
->inject('request')
|
->inject('request')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
|
@ -905,8 +911,9 @@ App::post('/v1/vcs/github/events')
|
||||||
);
|
);
|
||||||
|
|
||||||
App::get('/v1/vcs/installations')
|
App::get('/v1/vcs/installations')
|
||||||
->groups(['api', 'vcs'])
|
|
||||||
->desc('List installations')
|
->desc('List installations')
|
||||||
|
->groups(['api', 'vcs'])
|
||||||
|
->label('scope', 'vcs.read')
|
||||||
->label('sdk.namespace', 'vcs')
|
->label('sdk.namespace', 'vcs')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.method', 'listInstallations')
|
->label('sdk.method', 'listInstallations')
|
||||||
|
@ -956,8 +963,9 @@ App::get('/v1/vcs/installations')
|
||||||
});
|
});
|
||||||
|
|
||||||
App::get('/v1/vcs/installations/:installationId')
|
App::get('/v1/vcs/installations/:installationId')
|
||||||
->groups(['api', 'vcs'])
|
|
||||||
->desc('Get installation')
|
->desc('Get installation')
|
||||||
|
->groups(['api', 'vcs'])
|
||||||
|
->label('scope', 'vcs.read')
|
||||||
->label('sdk.namespace', 'vcs')
|
->label('sdk.namespace', 'vcs')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.method', 'getInstallation')
|
->label('sdk.method', 'getInstallation')
|
||||||
|
@ -984,8 +992,9 @@ App::get('/v1/vcs/installations/:installationId')
|
||||||
});
|
});
|
||||||
|
|
||||||
App::delete('/v1/vcs/installations/:installationId')
|
App::delete('/v1/vcs/installations/:installationId')
|
||||||
->groups(['api', 'vcs'])
|
|
||||||
->desc('Delete Installation')
|
->desc('Delete Installation')
|
||||||
|
->groups(['api', 'vcs'])
|
||||||
|
->label('scope', 'vcs.write')
|
||||||
->label('sdk.namespace', 'vcs')
|
->label('sdk.namespace', 'vcs')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.method', 'deleteInstallation')
|
->label('sdk.method', 'deleteInstallation')
|
||||||
|
@ -1018,6 +1027,7 @@ App::delete('/v1/vcs/installations/:installationId')
|
||||||
App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositoryId')
|
App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositoryId')
|
||||||
->desc('Authorize external deployment')
|
->desc('Authorize external deployment')
|
||||||
->groups(['api', 'vcs'])
|
->groups(['api', 'vcs'])
|
||||||
|
->label('scope', 'vcs.write')
|
||||||
->label('sdk.namespace', 'vcs')
|
->label('sdk.namespace', 'vcs')
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||||
->label('sdk.method', 'updateExternalDeployments')
|
->label('sdk.method', 'updateExternalDeployments')
|
||||||
|
|
|
@ -198,6 +198,34 @@ App::delete('/v1/mock/tests/bar')
|
||||||
->action(function ($required, $default, $z) {
|
->action(function ($required, $default, $z) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
App::get('/v1/mock/tests/general/headers')
|
||||||
|
->desc('Get headers')
|
||||||
|
->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', 'headers')
|
||||||
|
->label('sdk.description', 'Return headers from the request')
|
||||||
|
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||||
|
->label('sdk.response.model', Response::MODEL_MOCK)
|
||||||
|
->label('sdk.mock', true)
|
||||||
|
->inject('request')
|
||||||
|
->inject('response')
|
||||||
|
->action(function (Request $request, Response $response) {
|
||||||
|
$res = [
|
||||||
|
'x-sdk-name' => $request->getHeader('x-sdk-name'),
|
||||||
|
'x-sdk-platform' => $request->getHeader('x-sdk-platform'),
|
||||||
|
'x-sdk-language' => $request->getHeader('x-sdk-language'),
|
||||||
|
'x-sdk-version' => $request->getHeader('x-sdk-version'),
|
||||||
|
];
|
||||||
|
$res = array_map(function ($key, $value) {
|
||||||
|
return $key . ': ' . $value;
|
||||||
|
}, array_keys($res), $res);
|
||||||
|
$res = implode("; ", $res);
|
||||||
|
|
||||||
|
$response->dynamic(new Document(['result' => $res]), Response::MODEL_MOCK);
|
||||||
|
});
|
||||||
|
|
||||||
App::get('/v1/mock/tests/general/download')
|
App::get('/v1/mock/tests/general/download')
|
||||||
->desc('Download File')
|
->desc('Download File')
|
||||||
->groups(['mock'])
|
->groups(['mock'])
|
||||||
|
|
|
@ -108,8 +108,8 @@ const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return
|
||||||
const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours
|
const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours
|
||||||
const APP_USER_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_UPDATE = 24 * 60 * 60; // 24 hours
|
||||||
const APP_CACHE_BUSTER = 507;
|
const APP_CACHE_BUSTER = 508;
|
||||||
const APP_VERSION_STABLE = '1.4.0';
|
const APP_VERSION_STABLE = '1.4.1';
|
||||||
const APP_DATABASE_ATTRIBUTE_EMAIL = 'email';
|
const APP_DATABASE_ATTRIBUTE_EMAIL = 'email';
|
||||||
const APP_DATABASE_ATTRIBUTE_ENUM = 'enum';
|
const APP_DATABASE_ATTRIBUTE_ENUM = 'enum';
|
||||||
const APP_DATABASE_ATTRIBUTE_IP = 'ip';
|
const APP_DATABASE_ATTRIBUTE_IP = 'ip';
|
||||||
|
|
|
@ -650,7 +650,7 @@ services:
|
||||||
- MYSQL_DATABASE=${_APP_DB_SCHEMA}
|
- MYSQL_DATABASE=${_APP_DB_SCHEMA}
|
||||||
- MYSQL_USER=${_APP_DB_USER}
|
- MYSQL_USER=${_APP_DB_USER}
|
||||||
- MYSQL_PASSWORD=${_APP_DB_PASS}
|
- MYSQL_PASSWORD=${_APP_DB_PASS}
|
||||||
command: 'mysqld --innodb-flush-method=fsync --max_connections=${_APP_CONNECTIONS_MAX}'
|
command: 'mysqld --innodb-flush-method=fsync'
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7.0.4-alpine
|
image: redis:7.0.4-alpine
|
||||||
|
|
3
bin/upgrade
Executable file
3
bin/upgrade
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
php /usr/src/code/app/cli.php upgrade $@
|
|
@ -65,6 +65,7 @@ abstract class Migration
|
||||||
'1.3.7' => 'V18',
|
'1.3.7' => 'V18',
|
||||||
'1.3.8' => 'V18',
|
'1.3.8' => 'V18',
|
||||||
'1.4.0' => 'V19',
|
'1.4.0' => 'V19',
|
||||||
|
'1.4.1' => 'V19',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,6 +10,7 @@ use Utopia\Database\Database;
|
||||||
use Utopia\Database\DateTime;
|
use Utopia\Database\DateTime;
|
||||||
use Utopia\Database\Document;
|
use Utopia\Database\Document;
|
||||||
use Utopia\Database\Exception;
|
use Utopia\Database\Exception;
|
||||||
|
use Utopia\Database\Query;
|
||||||
|
|
||||||
class V19 extends Migration
|
class V19 extends Migration
|
||||||
{
|
{
|
||||||
|
@ -33,6 +34,11 @@ class V19 extends Migration
|
||||||
Console::info('Migrating Collections');
|
Console::info('Migrating Collections');
|
||||||
$this->migrateCollections();
|
$this->migrateCollections();
|
||||||
|
|
||||||
|
if ($this->project->getId() == 'console') {
|
||||||
|
Console::info('Migrating Domains');
|
||||||
|
$this->migrateDomains();
|
||||||
|
}
|
||||||
|
|
||||||
Console::info('Migrating Buckets');
|
Console::info('Migrating Buckets');
|
||||||
$this->migrateBuckets();
|
$this->migrateBuckets();
|
||||||
|
|
||||||
|
@ -43,6 +49,33 @@ class V19 extends Migration
|
||||||
$this->cleanCollections();
|
$this->cleanCollections();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function migrateDomains(): void
|
||||||
|
{
|
||||||
|
foreach ($this->documentsIterator('domains') as $domain) {
|
||||||
|
$status = 'created';
|
||||||
|
if ($domain->getAttribute('verification', false)) {
|
||||||
|
$status = 'verified';
|
||||||
|
}
|
||||||
|
|
||||||
|
$ruleDocument = new Document([
|
||||||
|
'projectId' => $domain->getAttribute('projectId'),
|
||||||
|
'projectInternalId' => $domain->getAttribute('projectInternalId'),
|
||||||
|
'domain' => $domain->getAttribute('domain'),
|
||||||
|
'resourceType' => 'api',
|
||||||
|
'resourceInternalId' => '',
|
||||||
|
'resourceId' => '',
|
||||||
|
'status' => $status,
|
||||||
|
'certificateId' => $domain->getAttribute('certificateId'),
|
||||||
|
]);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$this->consoleDB->createDocument('rules', $ruleDocument);
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
Console::warning("Error migrating domain {$domain->getAttribute('domain')}: {$th->getMessage()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Migrating all Bucket tables.
|
* Migrating all Bucket tables.
|
||||||
*
|
*
|
||||||
|
@ -611,30 +644,6 @@ class V19 extends Migration
|
||||||
$document->setAttribute('smtp', []);
|
$document->setAttribute('smtp', []);
|
||||||
$document->setAttribute('templates', []);
|
$document->setAttribute('templates', []);
|
||||||
|
|
||||||
break;
|
|
||||||
case 'rules':
|
|
||||||
$status = 'created';
|
|
||||||
if ($document->getAttribute('verification', false)) {
|
|
||||||
$status = 'verified';
|
|
||||||
}
|
|
||||||
|
|
||||||
$ruleDocument = new Document([
|
|
||||||
'projectId' => $this->project->getId(),
|
|
||||||
'projectInternalId' => $this->project->getInternalId(),
|
|
||||||
'domain' => $document->getAttribute('domain'),
|
|
||||||
'resourceType' => 'api',
|
|
||||||
'resourceInternalId' => '',
|
|
||||||
'resourceId' => '',
|
|
||||||
'status' => $status,
|
|
||||||
'certificateId' => $document->getAttribute('certificateId'),
|
|
||||||
]);
|
|
||||||
|
|
||||||
try {
|
|
||||||
$this->consoleDB->createDocument('rules', $ruleDocument);
|
|
||||||
} catch (\Throwable $th) {
|
|
||||||
Console::warning("Error migrating domain {$document->getAttribute('domain')}: {$th->getMessage()}");
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -22,6 +22,7 @@ use Appwrite\Platform\Tasks\VolumeSync;
|
||||||
use Appwrite\Platform\Tasks\CalcUsersStats;
|
use Appwrite\Platform\Tasks\CalcUsersStats;
|
||||||
use Appwrite\Platform\Tasks\CalcTierStats;
|
use Appwrite\Platform\Tasks\CalcTierStats;
|
||||||
use Appwrite\Platform\Tasks\PatchDeleteProjectCollections;
|
use Appwrite\Platform\Tasks\PatchDeleteProjectCollections;
|
||||||
|
use Appwrite\Platform\Tasks\Upgrade;
|
||||||
|
|
||||||
class Tasks extends Service
|
class Tasks extends Service
|
||||||
{
|
{
|
||||||
|
@ -36,6 +37,7 @@ class Tasks extends Service
|
||||||
->addAction(Hamster::getName(), new Hamster())
|
->addAction(Hamster::getName(), new Hamster())
|
||||||
->addAction(Doctor::getName(), new Doctor())
|
->addAction(Doctor::getName(), new Doctor())
|
||||||
->addAction(Install::getName(), new Install())
|
->addAction(Install::getName(), new Install())
|
||||||
|
->addAction(Upgrade::getName(), new Upgrade())
|
||||||
->addAction(Maintenance::getName(), new Maintenance())
|
->addAction(Maintenance::getName(), new Maintenance())
|
||||||
->addAction(PatchCreateMissingSchedules::getName(), new PatchCreateMissingSchedules())
|
->addAction(PatchCreateMissingSchedules::getName(), new PatchCreateMissingSchedules())
|
||||||
->addAction(ClearCardCache::getName(), new ClearCardCache())
|
->addAction(ClearCardCache::getName(), new ClearCardCache())
|
||||||
|
|
|
@ -16,6 +16,8 @@ use Utopia\Platform\Action;
|
||||||
|
|
||||||
class Install extends Action
|
class Install extends Action
|
||||||
{
|
{
|
||||||
|
protected string $path = '/usr/src/code/appwrite';
|
||||||
|
|
||||||
public static function getName(): string
|
public static function getName(): string
|
||||||
{
|
{
|
||||||
return 'install';
|
return 'install';
|
||||||
|
@ -36,7 +38,6 @@ class Install extends Action
|
||||||
public function action(string $httpPort, string $httpsPort, string $organization, string $image, string $interactive): void
|
public function action(string $httpPort, string $httpsPort, string $organization, string $image, string $interactive): void
|
||||||
{
|
{
|
||||||
$config = Config::getParam('variables');
|
$config = Config::getParam('variables');
|
||||||
$path = '/usr/src/code/appwrite';
|
|
||||||
$defaultHTTPPort = '80';
|
$defaultHTTPPort = '80';
|
||||||
$defaultHTTPSPort = '443';
|
$defaultHTTPSPort = '443';
|
||||||
$vars = [];
|
$vars = [];
|
||||||
|
@ -56,19 +57,28 @@ class Install extends Action
|
||||||
Console::success('Starting Appwrite installation...');
|
Console::success('Starting Appwrite installation...');
|
||||||
|
|
||||||
// Create directory with write permissions
|
// Create directory with write permissions
|
||||||
if (!\file_exists(\dirname($path))) {
|
if (!\file_exists(\dirname($this->path))) {
|
||||||
if (!@\mkdir(\dirname($path), 0755, true)) {
|
if (!@\mkdir(\dirname($this->path), 0755, true)) {
|
||||||
Console::error('Can\'t create directory ' . \dirname($path));
|
Console::error('Can\'t create directory ' . \dirname($this->path));
|
||||||
Console::exit(1);
|
Console::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = @file_get_contents($path . '/docker-compose.yml');
|
$data = @file_get_contents($this->path . '/docker-compose.yml');
|
||||||
|
|
||||||
if ($data !== false) {
|
if ($data !== false) {
|
||||||
|
if ($interactive == 'Y' && Console::isInteractive()) {
|
||||||
|
$answer = Console::confirm('Previous installation found, do you want to overwrite it (a backup will be created before overwriting)? (Y/n)');
|
||||||
|
|
||||||
|
if ($answer !== 'Y') {
|
||||||
|
Console::info('No action taken.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$time = \time();
|
$time = \time();
|
||||||
Console::info('Compose file found, creating backup: docker-compose.yml.' . $time . '.backup');
|
Console::info('Compose file found, creating backup: docker-compose.yml.' . $time . '.backup');
|
||||||
file_put_contents($path . '/docker-compose.yml.' . $time . '.backup', $data);
|
file_put_contents($this->path . '/docker-compose.yml.' . $time . '.backup', $data);
|
||||||
$compose = new Compose($data);
|
$compose = new Compose($data);
|
||||||
$appwrite = $compose->getService('appwrite');
|
$appwrite = $compose->getService('appwrite');
|
||||||
$oldVersion = ($appwrite) ? $appwrite->getImageVersion() : null;
|
$oldVersion = ($appwrite) ? $appwrite->getImageVersion() : null;
|
||||||
|
@ -102,11 +112,11 @@ class Install extends Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = @file_get_contents($path . '/.env');
|
$data = @file_get_contents($this->path . '/.env');
|
||||||
|
|
||||||
if ($data !== false) { // Fetch all env vars from previous .env file
|
if ($data !== false) { // Fetch all env vars from previous .env file
|
||||||
Console::info('Env file found, creating backup: .env.' . $time . '.backup');
|
Console::info('Env file found, creating backup: .env.' . $time . '.backup');
|
||||||
file_put_contents($path . '/.env.' . $time . '.backup', $data);
|
file_put_contents($this->path . '/.env.' . $time . '.backup', $data);
|
||||||
$env = new Env($data);
|
$env = new Env($data);
|
||||||
|
|
||||||
foreach ($env->list() as $key => $value) {
|
foreach ($env->list() as $key => $value) {
|
||||||
|
@ -196,14 +206,14 @@ class Install extends Action
|
||||||
|
|
||||||
$templateForEnv->setParam('vars', $input);
|
$templateForEnv->setParam('vars', $input);
|
||||||
|
|
||||||
if (!file_put_contents($path . '/docker-compose.yml', $templateForCompose->render(false))) {
|
if (!file_put_contents($this->path . '/docker-compose.yml', $templateForCompose->render(false))) {
|
||||||
$message = 'Failed to save Docker Compose file';
|
$message = 'Failed to save Docker Compose file';
|
||||||
$this->sendEvent($analytics, $message);
|
$this->sendEvent($analytics, $message);
|
||||||
Console::error($message);
|
Console::error($message);
|
||||||
Console::exit(1);
|
Console::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_put_contents($path . '/.env', $templateForEnv->render(false))) {
|
if (!file_put_contents($this->path . '/.env', $templateForEnv->render(false))) {
|
||||||
$message = 'Failed to save environment variables file';
|
$message = 'Failed to save environment variables file';
|
||||||
$this->sendEvent($analytics, $message);
|
$this->sendEvent($analytics, $message);
|
||||||
Console::error($message);
|
Console::error($message);
|
||||||
|
@ -222,7 +232,7 @@ class Install extends Action
|
||||||
|
|
||||||
Console::log("Running \"docker compose up -d --remove-orphans --renew-anon-volumes\"");
|
Console::log("Running \"docker compose up -d --remove-orphans --renew-anon-volumes\"");
|
||||||
|
|
||||||
$exit = Console::execute("${env} docker compose --project-directory ${path} up -d --remove-orphans --renew-anon-volumes", '', $stdout, $stderr);
|
$exit = Console::execute("$env docker compose --project-directory $this->path up -d --remove-orphans --renew-anon-volumes", '', $stdout, $stderr);
|
||||||
|
|
||||||
if ($exit !== 0) {
|
if ($exit !== 0) {
|
||||||
$message = 'Failed to install Appwrite dockers';
|
$message = 'Failed to install Appwrite dockers';
|
||||||
|
|
42
src/Appwrite/Platform/Tasks/Upgrade.php
Normal file
42
src/Appwrite/Platform/Tasks/Upgrade.php
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Appwrite\Platform\Tasks;
|
||||||
|
|
||||||
|
use Utopia\CLI\Console;
|
||||||
|
use Utopia\Validator\Text;
|
||||||
|
|
||||||
|
class Upgrade extends Install
|
||||||
|
{
|
||||||
|
public static function getName(): string
|
||||||
|
{
|
||||||
|
return 'upgrade';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this
|
||||||
|
->desc('Upgrade Appwrite')
|
||||||
|
->param('httpPort', '', new Text(4), 'Server HTTP port', true)
|
||||||
|
->param('httpsPort', '', new Text(4), 'Server HTTPS port', true)
|
||||||
|
->param('organization', 'appwrite', new Text(0), 'Docker Registry organization', true)
|
||||||
|
->param('image', 'appwrite', new Text(0), 'Main appwrite docker image', true)
|
||||||
|
->param('interactive', 'Y', new Text(1), 'Run an interactive session', true)
|
||||||
|
->callback(fn ($httpPort, $httpsPort, $organization, $image, $interactive) => $this->action($httpPort, $httpsPort, $organization, $image, $interactive));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function action(string $httpPort, string $httpsPort, string $organization, string $image, string $interactive): void
|
||||||
|
{
|
||||||
|
// Check for previous installation
|
||||||
|
$data = @file_get_contents($this->path . '/docker-compose.yml');
|
||||||
|
if (empty($data)) {
|
||||||
|
Console::error('Appwrite installation not found.');
|
||||||
|
Console::log('The command was not run in the parent folder of your appwrite installation.');
|
||||||
|
Console::log('Please navigate to the parent directory of the Appwrite installation and try again.');
|
||||||
|
Console::log(' parent_directory <= you run the command in this directory');
|
||||||
|
Console::log(' └── appwrite');
|
||||||
|
Console::log(' └── docker-compose.yml');
|
||||||
|
Console::exit(1);
|
||||||
|
}
|
||||||
|
parent::action($httpPort, $httpsPort, $organization, $image, $interactive);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue