Merge branch '1.4.x' into fix-prevent-webhook-abuse
This commit is contained in:
commit
018800c7ae
9 changed files with 43 additions and 20 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
# Version 1.4.9
|
||||||
|
|
||||||
|
## Bug fixes
|
||||||
|
|
||||||
|
* Fix 400 error on function domain execution in [#7059](https://github.com/appwrite/appwrite/pull/7059)
|
||||||
|
|
||||||
# Version 1.4.8
|
# Version 1.4.8
|
||||||
|
|
||||||
## Notable changes
|
## Notable changes
|
||||||
|
|
|
@ -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.8
|
appwrite/appwrite:1.4.9
|
||||||
```
|
```
|
||||||
|
|
||||||
### 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.8
|
appwrite/appwrite:1.4.9
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 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.8
|
appwrite/appwrite:1.4.9
|
||||||
```
|
```
|
||||||
|
|
||||||
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
|
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
|
||||||
|
|
|
@ -76,7 +76,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.8
|
appwrite/appwrite:1.4.9
|
||||||
```
|
```
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -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 "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
||||||
--entrypoint="install" ^
|
--entrypoint="install" ^
|
||||||
appwrite/appwrite:1.4.8
|
appwrite/appwrite:1.4.9
|
||||||
```
|
```
|
||||||
|
|
||||||
#### PowerShell
|
#### PowerShell
|
||||||
|
@ -98,7 +98,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.8
|
appwrite/appwrite:1.4.9
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
||||||
|
|
|
@ -352,7 +352,7 @@ App::get('/v1/health/queue/webhooks')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function (Connection $queue, Response $response) {
|
->action(function (Connection $queue, Response $response) {
|
||||||
$client = new Client(Event::WEBHOOK_QUEUE_NAME, $queue);
|
$client = new Client(Event::WEBHOOK_QUEUE_NAME, $queue);
|
||||||
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
|
$response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE);
|
||||||
}, ['response']);
|
}, ['response']);
|
||||||
|
|
||||||
App::get('/v1/health/queue/logs')
|
App::get('/v1/health/queue/logs')
|
||||||
|
@ -370,7 +370,7 @@ App::get('/v1/health/queue/logs')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function (Connection $queue, Response $response) {
|
->action(function (Connection $queue, Response $response) {
|
||||||
$client = new Client(Event::AUDITS_QUEUE_NAME, $queue);
|
$client = new Client(Event::AUDITS_QUEUE_NAME, $queue);
|
||||||
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
|
$response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE);
|
||||||
}, ['response']);
|
}, ['response']);
|
||||||
|
|
||||||
App::get('/v1/health/queue/certificates')
|
App::get('/v1/health/queue/certificates')
|
||||||
|
@ -388,7 +388,7 @@ App::get('/v1/health/queue/certificates')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function (Connection $queue, Response $response) {
|
->action(function (Connection $queue, Response $response) {
|
||||||
$client = new Client(Event::CERTIFICATES_QUEUE_NAME, $queue);
|
$client = new Client(Event::CERTIFICATES_QUEUE_NAME, $queue);
|
||||||
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
|
$response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE);
|
||||||
}, ['response']);
|
}, ['response']);
|
||||||
|
|
||||||
App::get('/v1/health/queue/builds')
|
App::get('/v1/health/queue/builds')
|
||||||
|
@ -406,7 +406,7 @@ App::get('/v1/health/queue/builds')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function (Connection $queue, Response $response) {
|
->action(function (Connection $queue, Response $response) {
|
||||||
$client = new Client(Event::BUILDS_QUEUE_NAME, $queue);
|
$client = new Client(Event::BUILDS_QUEUE_NAME, $queue);
|
||||||
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
|
$response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE);
|
||||||
}, ['response']);
|
}, ['response']);
|
||||||
|
|
||||||
App::get('/v1/health/queue/databases')
|
App::get('/v1/health/queue/databases')
|
||||||
|
@ -425,7 +425,7 @@ App::get('/v1/health/queue/databases')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function (string $name, Connection $queue, Response $response) {
|
->action(function (string $name, Connection $queue, Response $response) {
|
||||||
$client = new Client($name, $queue);
|
$client = new Client($name, $queue);
|
||||||
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
|
$response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE);
|
||||||
}, ['response']);
|
}, ['response']);
|
||||||
|
|
||||||
App::get('/v1/health/queue/deletes')
|
App::get('/v1/health/queue/deletes')
|
||||||
|
@ -443,7 +443,7 @@ App::get('/v1/health/queue/deletes')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function (Connection $queue, Response $response) {
|
->action(function (Connection $queue, Response $response) {
|
||||||
$client = new Client(Event::DELETE_QUEUE_NAME, $queue);
|
$client = new Client(Event::DELETE_QUEUE_NAME, $queue);
|
||||||
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
|
$response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE);
|
||||||
}, ['response']);
|
}, ['response']);
|
||||||
|
|
||||||
App::get('/v1/health/queue/mails')
|
App::get('/v1/health/queue/mails')
|
||||||
|
@ -461,7 +461,7 @@ App::get('/v1/health/queue/mails')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function (Connection $queue, Response $response) {
|
->action(function (Connection $queue, Response $response) {
|
||||||
$client = new Client(Event::MAILS_QUEUE_NAME, $queue);
|
$client = new Client(Event::MAILS_QUEUE_NAME, $queue);
|
||||||
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
|
$response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE);
|
||||||
}, ['response']);
|
}, ['response']);
|
||||||
|
|
||||||
App::get('/v1/health/queue/messaging')
|
App::get('/v1/health/queue/messaging')
|
||||||
|
@ -479,7 +479,7 @@ App::get('/v1/health/queue/messaging')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function (Connection $queue, Response $response) {
|
->action(function (Connection $queue, Response $response) {
|
||||||
$client = new Client(Event::MESSAGING_QUEUE_NAME, $queue);
|
$client = new Client(Event::MESSAGING_QUEUE_NAME, $queue);
|
||||||
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
|
$response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE);
|
||||||
}, ['response']);
|
}, ['response']);
|
||||||
|
|
||||||
App::get('/v1/health/queue/migrations')
|
App::get('/v1/health/queue/migrations')
|
||||||
|
@ -497,7 +497,7 @@ App::get('/v1/health/queue/migrations')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function (Connection $queue, Response $response) {
|
->action(function (Connection $queue, Response $response) {
|
||||||
$client = new Client(Event::MIGRATIONS_QUEUE_NAME, $queue);
|
$client = new Client(Event::MIGRATIONS_QUEUE_NAME, $queue);
|
||||||
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
|
$response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE);
|
||||||
}, ['response']);
|
}, ['response']);
|
||||||
|
|
||||||
App::get('/v1/health/queue/functions')
|
App::get('/v1/health/queue/functions')
|
||||||
|
@ -515,7 +515,7 @@ App::get('/v1/health/queue/functions')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function (Connection $queue, Response $response) {
|
->action(function (Connection $queue, Response $response) {
|
||||||
$client = new Client(Event::FUNCTIONS_QUEUE_NAME, $queue);
|
$client = new Client(Event::FUNCTIONS_QUEUE_NAME, $queue);
|
||||||
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
|
$response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE);
|
||||||
}, ['response']);
|
}, ['response']);
|
||||||
|
|
||||||
App::get('/v1/health/storage/local')
|
App::get('/v1/health/storage/local')
|
||||||
|
|
|
@ -408,7 +408,7 @@ App::init()
|
||||||
* @see https://www.owasp.org/index.php/List_of_useful_HTTP_headers
|
* @see https://www.owasp.org/index.php/List_of_useful_HTTP_headers
|
||||||
*/
|
*/
|
||||||
if (App::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS
|
if (App::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS
|
||||||
if ($request->getProtocol() !== 'https' && ($requestHeaders['host'] ?? '') !== 'localhost' && ($requestHeaders['host'] ?? '') !== APP_HOSTNAME_INTERNAL) { // localhost allowed for proxy, APP_HOSTNAME_INTERNAL allowed for migrations
|
if ($request->getProtocol() !== 'https' && ($swooleRequest->header['host'] ?? '') !== 'localhost' && ($swooleRequest->header['host'] ?? '') !== APP_HOSTNAME_INTERNAL) { // localhost allowed for proxy, APP_HOSTNAME_INTERNAL allowed for migrations
|
||||||
if ($request->getMethod() !== Request::METHOD_GET) {
|
if ($request->getMethod() !== Request::METHOD_GET) {
|
||||||
throw new AppwriteException(AppwriteException::GENERAL_PROTOCOL_UNSUPPORTED, 'Method unsupported over HTTP. Please use HTTPS instead.');
|
throw new AppwriteException(AppwriteException::GENERAL_PROTOCOL_UNSUPPORTED, 'Method unsupported over HTTP. Please use HTTPS instead.');
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ 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 = 515;
|
const APP_CACHE_BUSTER = 515;
|
||||||
const APP_VERSION_STABLE = '1.4.8';
|
const APP_VERSION_STABLE = '1.4.9';
|
||||||
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';
|
||||||
|
|
|
@ -73,6 +73,7 @@ abstract class Migration
|
||||||
'1.4.6' => 'V19',
|
'1.4.6' => 'V19',
|
||||||
'1.4.7' => 'V19',
|
'1.4.7' => 'V19',
|
||||||
'1.4.8' => 'V19',
|
'1.4.8' => 'V19',
|
||||||
|
'1.4.9' => 'V19',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -178,7 +178,8 @@ class Deletes extends Action
|
||||||
$project = $dbForConsole->getDocument('projects', $document->getAttribute('projectId'));
|
$project = $dbForConsole->getDocument('projects', $document->getAttribute('projectId'));
|
||||||
|
|
||||||
if ($project->isEmpty()) {
|
if ($project->isEmpty()) {
|
||||||
Console::warning('Unable to delete schedule for function ' . $document->getAttribute('resourceId'));
|
$dbForConsole->deleteDocument('schedules', $document->getId());
|
||||||
|
Console::success('Deleted schedule for deleted project ' . $document->getAttribute('projectId'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -920,17 +921,28 @@ class Deletes extends Action
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$chunk = 0;
|
$chunk = 0;
|
||||||
$limit = 50;
|
$limit = 50;
|
||||||
|
$results = [];
|
||||||
$sum = $limit;
|
$sum = $limit;
|
||||||
|
$cursor = null;
|
||||||
|
|
||||||
$executionStart = \microtime(true);
|
$executionStart = \microtime(true);
|
||||||
|
|
||||||
while ($sum === $limit) {
|
while ($sum === $limit) {
|
||||||
$chunk++;
|
$chunk++;
|
||||||
|
|
||||||
$results = $database->find($collection, \array_merge([Query::limit($limit)], $queries));
|
$mergedQueries = \array_merge([Query::limit($limit)], $queries);
|
||||||
|
if ($cursor instanceof Document) {
|
||||||
|
$mergedQueries[] = Query::cursorAfter($cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
$results = $database->find($collection, $mergedQueries);
|
||||||
|
|
||||||
$sum = count($results);
|
$sum = count($results);
|
||||||
|
|
||||||
|
if ($sum > 0) {
|
||||||
|
$cursor = $results[$sum - 1];
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($results as $document) {
|
foreach ($results as $document) {
|
||||||
if (is_callable($callback)) {
|
if (is_callable($callback)) {
|
||||||
$callback($document);
|
$callback($document);
|
||||||
|
|
|
@ -107,6 +107,10 @@ class Request extends UtopiaRequest
|
||||||
{
|
{
|
||||||
$headers = $this->generateHeaders();
|
$headers = $this->generateHeaders();
|
||||||
|
|
||||||
|
if (empty($this->swoole->cookie)) {
|
||||||
|
return $headers;
|
||||||
|
}
|
||||||
|
|
||||||
$cookieHeaders = [];
|
$cookieHeaders = [];
|
||||||
foreach ($this->swoole->cookie as $key => $value) {
|
foreach ($this->swoole->cookie as $key => $value) {
|
||||||
$cookieHeaders[] = "{$key}={$value}";
|
$cookieHeaders[] = "{$key}={$value}";
|
||||||
|
|
Loading…
Reference in a new issue