mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
commit
c109dcc683
32 changed files with 225 additions and 73 deletions
2
.gitmodules
vendored
2
.gitmodules
vendored
|
|
@ -1,4 +1,4 @@
|
|||
[submodule "app/console"]
|
||||
path = app/console
|
||||
url = https://github.com/appwrite/console
|
||||
branch = 4.3.3
|
||||
branch = 4.3.5
|
||||
|
|
|
|||
82
CHANGES.md
82
CHANGES.md
|
|
@ -1,3 +1,85 @@
|
|||
# Version 1.5.7
|
||||
## What's Changed
|
||||
|
||||
### Fixes
|
||||
* Fix database exception wrapping by @abnegate in https://github.com/appwrite/appwrite/pull/7787
|
||||
* Fix exception wrap order by @abnegate in https://github.com/appwrite/appwrite/pull/7818
|
||||
* Fix membership query to use internalId by @lohanidamodar in https://github.com/appwrite/appwrite/pull/7834
|
||||
* Fix vcs silent mode by @vermakhushboo in https://github.com/appwrite/appwrite/pull/7683
|
||||
* Fix function domain permissions by @stnguyen90 in https://github.com/appwrite/appwrite/pull/7852
|
||||
* Fix tests required for Cloud by @lohanidamodar in https://github.com/appwrite/appwrite/pull/7777
|
||||
* Fix OAuth error code by @vermakhushboo in https://github.com/appwrite/appwrite/pull/7893
|
||||
* Fix connection reclaim logic. by @eldadfux in https://github.com/appwrite/appwrite/pull/6886
|
||||
* Fix shared queue name by @abnegate in https://github.com/appwrite/appwrite/pull/8092
|
||||
* Fix syntax error by @abnegate in https://github.com/appwrite/appwrite/pull/8093
|
||||
* Fix missing id attribute error by @abnegate in https://github.com/appwrite/appwrite/pull/8094
|
||||
* Fix tests for CL by @lohanidamodar in https://github.com/appwrite/appwrite/pull/8076
|
||||
* Fix project deletes for shared tables by @abnegate in https://github.com/appwrite/appwrite/pull/8107
|
||||
* Handle SQL error code 'HY000' in realtime by @stnguyen90 in https://github.com/appwrite/appwrite/pull/8106
|
||||
* Fix: Don't Override `robots.txt` for Other Domains by @ItzNotABug in https://github.com/appwrite/appwrite/pull/8185
|
||||
* Escape function build command by @stnguyen90 in https://github.com/appwrite/appwrite/pull/7808
|
||||
* Create failed execution from worker if deployment doesn't exist by @vermakhushboo in https://github.com/appwrite/appwrite/pull/7896
|
||||
* Fix: admin mode on console by @TorstenDittmann in https://github.com/appwrite/appwrite/pull/7951
|
||||
* Fix file size default limit by @shimonewman in https://github.com/appwrite/appwrite/pull/7843
|
||||
* Fix: Python failing builds by @Meldiron in https://github.com/appwrite/appwrite/pull/8078
|
||||
* Fix shared project delete by @abnegate in https://github.com/appwrite/appwrite/pull/8142
|
||||
* Fix TextMagic class name by @stnguyen90 in https://github.com/appwrite/appwrite/pull/8132
|
||||
* Prevent functions domain and subdomain to be added as custom domain by @lohanidamodar in https://github.com/appwrite/appwrite/pull/7933
|
||||
* Fix don't publish max users exceed by @vermakhushboo in https://github.com/appwrite/appwrite/pull/8067
|
||||
* Fix invalid cache document id by @stnguyen90 in https://github.com/appwrite/appwrite/pull/8183
|
||||
* Fix not hiding tokens for clients via realtime by @abnegate in https://github.com/appwrite/appwrite/pull/7870
|
||||
|
||||
### Miscellaneous
|
||||
* Upload 400s to separate error logger by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/7784
|
||||
* Admin mode use teamInternalId by @lohanidamodar in https://github.com/appwrite/appwrite/pull/7835
|
||||
* Chore: update avatars API by @christyjacob4 in https://github.com/appwrite/appwrite/pull/7840
|
||||
* Use internal ids for query by @lohanidamodar in https://github.com/appwrite/appwrite/pull/7838
|
||||
* Remove cloud related scripts by @shimonewman in https://github.com/appwrite/appwrite/pull/7414
|
||||
* Update VCS Comment by @vermakhushboo in https://github.com/appwrite/appwrite/pull/7854
|
||||
* Transaction and reconnection fixes by @fogelito in https://github.com/appwrite/appwrite/pull/7877
|
||||
* Feat configurable collections by @christyjacob4 in https://github.com/appwrite/appwrite/pull/7882
|
||||
* Remove var_dump calls by @stnguyen90 in https://github.com/appwrite/appwrite/pull/7884
|
||||
* Storage DO adapter http version by @lohanidamodar in https://github.com/appwrite/appwrite/pull/7905
|
||||
* Update executor version by @vermakhushboo in https://github.com/appwrite/appwrite/pull/7910
|
||||
* Comment timer tick by @vermakhushboo in https://github.com/appwrite/appwrite/pull/7911
|
||||
* Update db for relationships and object as array attributes fixes by @abnegate in https://github.com/appwrite/appwrite/pull/7917
|
||||
* Bump executor version to 0.5.1 by @vermakhushboo in https://github.com/appwrite/appwrite/pull/7925
|
||||
* Update database by @abnegate in https://github.com/appwrite/appwrite/pull/7937
|
||||
* Reclaim only current connection by @abnegate in https://github.com/appwrite/appwrite/pull/7941
|
||||
* Match memberships on internal ID by @abnegate in https://github.com/appwrite/appwrite/pull/7953
|
||||
* Chore: queue retry update by @shimonewman in https://github.com/appwrite/appwrite/pull/7991
|
||||
* Chore task addition by @shimonewman in https://github.com/appwrite/appwrite/pull/7992
|
||||
* Databases.php collection not found by @fogelito in https://github.com/appwrite/appwrite/pull/7341
|
||||
* Update database by @abnegate in https://github.com/appwrite/appwrite/pull/8036
|
||||
* Feat upgrade db by @abnegate in https://github.com/appwrite/appwrite/pull/8050
|
||||
* Handle string error codes by @fogelito in https://github.com/appwrite/appwrite/pull/7878
|
||||
* Migration Logging Improvements by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/8057
|
||||
* Remove logger code from avatars.php by @vermakhushboo in https://github.com/appwrite/appwrite/pull/8065
|
||||
* Update chunk size to 7 MB by @vermakhushboo in https://github.com/appwrite/appwrite/pull/8060
|
||||
* Shared tables support by @abnegate in https://github.com/appwrite/appwrite/pull/7206
|
||||
* Ensure namespace is set if override equals shared tables by @abnegate in https://github.com/appwrite/appwrite/pull/8091
|
||||
* Update database by @abnegate in https://github.com/appwrite/appwrite/pull/8095
|
||||
* Disable sending realtime stats by @stnguyen90 in https://github.com/appwrite/appwrite/pull/8104
|
||||
* Increase chunk size to 10 MB by @vermakhushboo in https://github.com/appwrite/appwrite/pull/8099
|
||||
* Update db by @abnegate in https://github.com/appwrite/appwrite/pull/8113
|
||||
* Update executor image name to exc-1 by @vermakhushboo in https://github.com/appwrite/appwrite/pull/8123
|
||||
* Catch DB errors on delete by @abnegate in https://github.com/appwrite/appwrite/pull/8143
|
||||
* Update Logger and migrations, implement sampler. by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/8146
|
||||
* Increase shared tables projects by @abnegate in https://github.com/appwrite/appwrite/pull/8161
|
||||
* Feat: improve cold start error, merge to cloud by @loks0n in https://github.com/appwrite/appwrite/pull/8165
|
||||
* Add tests for scheduled functions by @vermakhushboo in https://github.com/appwrite/appwrite/pull/8164
|
||||
* Remove throw PdoException in Error hook by @fogelito in https://github.com/appwrite/appwrite/pull/8169
|
||||
* Refactor localdevice injection by @byawitz in https://github.com/appwrite/appwrite/pull/8173
|
||||
* Usage sms per country code count by @shimonewman in https://github.com/appwrite/appwrite/pull/7592
|
||||
* GetEnv on worker.php by @shimonewman in https://github.com/appwrite/appwrite/pull/8026
|
||||
* Feat get env by @shimonewman in https://github.com/appwrite/appwrite/pull/8180
|
||||
* Chore: remove compose version by @loks0n in https://github.com/appwrite/appwrite/pull/8148
|
||||
* Chore update executor host default var by @abnegate in https://github.com/appwrite/appwrite/pull/8190
|
||||
* Wrap realtime stats in an edition check by @abnegate in https://github.com/appwrite/appwrite/pull/8192
|
||||
* Update executor image name by @vermakhushboo in https://github.com/appwrite/appwrite/pull/8147
|
||||
* Feat: improve header demo values by @loks0n in https://github.com/appwrite/appwrite/pull/8089
|
||||
* Feat: add warning header by @loks0n in https://github.com/appwrite/appwrite/pull/8063
|
||||
|
||||
# Version 1.5.6
|
||||
## What's Changed
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,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.5.6
|
||||
appwrite/appwrite:1.5.7
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
|
@ -79,7 +79,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.5.6
|
||||
appwrite/appwrite:1.5.7
|
||||
```
|
||||
|
||||
#### PowerShell
|
||||
|
|
@ -89,7 +89,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.5.6
|
||||
appwrite/appwrite:1.5.7
|
||||
```
|
||||
|
||||
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
|
||||
|
|
|
|||
|
|
@ -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.5.6
|
||||
appwrite/appwrite:1.5.7
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
|
@ -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.5.6
|
||||
appwrite/appwrite:1.5.7
|
||||
```
|
||||
|
||||
#### PowerShell
|
||||
|
|
@ -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.5.6
|
||||
appwrite/appwrite:1.5.7
|
||||
```
|
||||
|
||||
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.
|
||||
|
|
|
|||
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
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
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
|
|
@ -1 +1 @@
|
|||
Subproject commit 7f0fa477ef22e51fa3d92445a044245015a6c6ee
|
||||
Subproject commit 5169fe16d63066f64ab5013c78953aea04e24b53
|
||||
|
|
@ -279,6 +279,8 @@ App::post('/v1/projects')
|
|||
}
|
||||
}
|
||||
|
||||
// Hook allowing instant project mirroring during migration
|
||||
// Outside of migration, hook is not registered and has no effect
|
||||
$hooks->trigger('afterProjectCreation', [ $project, $pools, $cache ]);
|
||||
|
||||
$response
|
||||
|
|
|
|||
|
|
@ -555,6 +555,9 @@ App::init()
|
|||
if (version_compare($responseFormat, '1.5.0', '<')) {
|
||||
$response->addFilter(new ResponseV17());
|
||||
}
|
||||
if (version_compare($responseFormat, APP_VERSION_STABLE, '>')) {
|
||||
$response->addHeader('X-Appwrite-Warning', "The current SDK is built for Appwrite " . $responseFormat . ". However, the current Appwrite server version is ". APP_VERSION_STABLE . ". Please downgrade your SDK to match the Appwrite version: https://appwrite.io/docs/sdks");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -885,20 +888,50 @@ App::get('/robots.txt')
|
|||
->desc('Robots.txt File')
|
||||
->label('scope', 'public')
|
||||
->label('docs', false)
|
||||
->inject('utopia')
|
||||
->inject('swooleRequest')
|
||||
->inject('request')
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
$template = new View(__DIR__ . '/../views/general/robots.phtml');
|
||||
$response->text($template->render(false));
|
||||
->inject('dbForConsole')
|
||||
->inject('getProjectDB')
|
||||
->inject('queueForEvents')
|
||||
->inject('queueForUsage')
|
||||
->inject('geodb')
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Reader $geodb) {
|
||||
$host = $request->getHostname() ?? '';
|
||||
$mainDomain = System::getEnv('_APP_DOMAIN', '');
|
||||
|
||||
if ($host === $mainDomain) {
|
||||
$template = new View(__DIR__ . '/../views/general/robots.phtml');
|
||||
$response->text($template->render(false));
|
||||
} else {
|
||||
router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $geodb);
|
||||
}
|
||||
});
|
||||
|
||||
App::get('/humans.txt')
|
||||
->desc('Humans.txt File')
|
||||
->label('scope', 'public')
|
||||
->label('docs', false)
|
||||
->inject('utopia')
|
||||
->inject('swooleRequest')
|
||||
->inject('request')
|
||||
->inject('response')
|
||||
->action(function (Response $response) {
|
||||
$template = new View(__DIR__ . '/../views/general/humans.phtml');
|
||||
$response->text($template->render(false));
|
||||
->inject('dbForConsole')
|
||||
->inject('getProjectDB')
|
||||
->inject('queueForEvents')
|
||||
->inject('queueForUsage')
|
||||
->inject('geodb')
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Reader $geodb) {
|
||||
$host = $request->getHostname() ?? '';
|
||||
$mainDomain = System::getEnv('_APP_DOMAIN', '');
|
||||
|
||||
if ($host === $mainDomain) {
|
||||
$template = new View(__DIR__ . '/../views/general/humans.phtml');
|
||||
$response->text($template->render(false));
|
||||
} else {
|
||||
router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $geodb);
|
||||
}
|
||||
});
|
||||
|
||||
App::get('/.well-known/acme-challenge/*')
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ App::init()
|
|||
|
||||
$useCache = $route->getLabel('cache', false);
|
||||
if ($useCache) {
|
||||
$key = md5($request->getURI() . implode('*', $request->getParams()) . '*' . APP_CACHE_BUSTER);
|
||||
$key = md5($request->getURI() . '*' . implode('*', $request->getParams()) . '*' . APP_CACHE_BUSTER);
|
||||
$cacheLog = Authorization::skip(fn () => $dbForProject->getDocument('cache', $key));
|
||||
$cache = new Cache(
|
||||
new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId())
|
||||
|
|
@ -666,7 +666,7 @@ App::shutdown()
|
|||
$resourceType = $parseLabel($pattern, $responsePayload, $requestParams, $user);
|
||||
}
|
||||
|
||||
$key = md5($request->getURI() . '*' . implode('*', $request->getParams())) . '*' . APP_CACHE_BUSTER;
|
||||
$key = md5($request->getURI() . '*' . implode('*', $request->getParams()) . '*' . APP_CACHE_BUSTER);
|
||||
$signature = md5($data['payload']);
|
||||
$cacheLog = Authorization::skip(fn () => $dbForProject->getDocument('cache', $key));
|
||||
$accessedAt = $cacheLog->getAttribute('accessedAt', '');
|
||||
|
|
|
|||
|
|
@ -112,8 +112,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_USER_ACCCESS = 24 * 60 * 60; // 24 hours
|
||||
const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours
|
||||
const APP_CACHE_BUSTER = 432;
|
||||
const APP_VERSION_STABLE = '1.5.6';
|
||||
const APP_CACHE_BUSTER = 443;
|
||||
const APP_VERSION_STABLE = '1.5.7';
|
||||
const APP_DATABASE_ATTRIBUTE_EMAIL = 'email';
|
||||
const APP_DATABASE_ATTRIBUTE_ENUM = 'enum';
|
||||
const APP_DATABASE_ATTRIBUTE_IP = 'ip';
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ $httpsPort = $this->getParam('httpsPort', '');
|
|||
$version = $this->getParam('version', '');
|
||||
$organization = $this->getParam('organization', '');
|
||||
$image = $this->getParam('image', '');
|
||||
?>version: '3'
|
||||
|
||||
services:
|
||||
?>services:
|
||||
traefik:
|
||||
image: traefik:2.11
|
||||
container_name: appwrite-traefik
|
||||
|
|
@ -523,6 +521,8 @@ services:
|
|||
restart: unless-stopped
|
||||
networks:
|
||||
- appwrite
|
||||
volumes:
|
||||
- appwrite-uploads:/storage/uploads:rw
|
||||
depends_on:
|
||||
- redis
|
||||
environment:
|
||||
|
|
@ -542,6 +542,27 @@ services:
|
|||
- _APP_LOGGING_CONFIG
|
||||
- _APP_SMS_FROM
|
||||
- _APP_SMS_PROVIDER
|
||||
- _APP_STORAGE_DEVICE
|
||||
- _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
|
||||
|
||||
appwrite-worker-migrations:
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ use Utopia\Queue\Connection;
|
|||
use Utopia\Queue\Message;
|
||||
use Utopia\Queue\Server;
|
||||
use Utopia\Registry\Registry;
|
||||
use Utopia\Storage\Device\Local;
|
||||
use Utopia\System\System;
|
||||
|
||||
Authorization::disable();
|
||||
|
|
@ -273,9 +272,6 @@ Server::setResource('deviceForCache', function (Document $project) {
|
|||
return getDevice(APP_STORAGE_CACHE . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
|
||||
Server::setResource('deviceForLocalFiles', function (Document $project) {
|
||||
return new Local(APP_STORAGE_UPLOADS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
|
||||
$pools = $register->get('pools');
|
||||
$platform = new Appwrite();
|
||||
|
|
|
|||
|
|
@ -570,6 +570,7 @@ services:
|
|||
networks:
|
||||
- appwrite
|
||||
volumes:
|
||||
- appwrite-uploads:/storage/uploads:rw
|
||||
- ./app:/usr/src/code/app
|
||||
- ./src:/usr/src/code/src
|
||||
depends_on:
|
||||
|
|
@ -592,6 +593,27 @@ services:
|
|||
- _APP_SMS_FROM
|
||||
- _APP_SMS_PROVIDER
|
||||
- _APP_SMS_PROJECTS_DENY_LIST
|
||||
- _APP_STORAGE_DEVICE
|
||||
- _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
|
||||
|
||||
appwrite-worker-migrations:
|
||||
entrypoint: worker-migrations
|
||||
|
|
|
|||
|
|
@ -27,14 +27,6 @@ class Compose
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion(): string
|
||||
{
|
||||
return (isset($this->compose['version'])) ? $this->compose['version'] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Service[]
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -307,6 +307,7 @@ class Exception extends \Exception
|
|||
$this->type = $type;
|
||||
$this->code = $code ?? $this->errors[$type]['code'];
|
||||
|
||||
// Mark string errors like HY001 from PDO as 500 errors
|
||||
if(\is_string($this->code)) {
|
||||
if (\is_numeric($this->code)) {
|
||||
$this->code = (int) $this->code;
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ abstract class Migration
|
|||
'1.5.4' => 'V20',
|
||||
'1.5.5' => 'V20',
|
||||
'1.5.6' => 'V20',
|
||||
'1.5.7' => 'V20',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ use Utopia\Messaging\Messages\SMS;
|
|||
use Utopia\Platform\Action;
|
||||
use Utopia\Queue\Message;
|
||||
use Utopia\Storage\Device;
|
||||
use Utopia\Storage\Device\Local;
|
||||
use Utopia\Storage\Storage;
|
||||
use Utopia\System\System;
|
||||
|
||||
|
|
@ -42,6 +43,8 @@ use function Swoole\Coroutine\batch;
|
|||
|
||||
class Messaging extends Action
|
||||
{
|
||||
private ?Local $localDevice = null;
|
||||
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'messaging';
|
||||
|
|
@ -58,9 +61,8 @@ class Messaging extends Action
|
|||
->inject('log')
|
||||
->inject('dbForProject')
|
||||
->inject('deviceForFiles')
|
||||
->inject('deviceForLocalFiles')
|
||||
->inject('queueForUsage')
|
||||
->callback(fn (Message $message, Log $log, Database $dbForProject, Device $deviceForFiles, Device $deviceForLocalFiles, Usage $queueForUsage) => $this->action($message, $log, $dbForProject, $deviceForFiles, $deviceForLocalFiles, $queueForUsage));
|
||||
->callback(fn (Message $message, Log $log, Database $dbForProject, Device $deviceForFiles, Usage $queueForUsage) => $this->action($message, $log, $dbForProject, $deviceForFiles, $queueForUsage));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -68,7 +70,6 @@ class Messaging extends Action
|
|||
* @param Log $log
|
||||
* @param Database $dbForProject
|
||||
* @param Device $deviceForFiles
|
||||
* @param Device $deviceForLocalFiles
|
||||
* @param Usage $queueForUsage
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
|
|
@ -78,7 +79,6 @@ class Messaging extends Action
|
|||
Log $log,
|
||||
Database $dbForProject,
|
||||
Device $deviceForFiles,
|
||||
Device $deviceForLocalFiles,
|
||||
Usage $queueForUsage
|
||||
): void {
|
||||
Runtime::setHookFlags(SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_TCP);
|
||||
|
|
@ -101,7 +101,7 @@ class Messaging extends Action
|
|||
case MESSAGE_SEND_TYPE_EXTERNAL:
|
||||
$message = $dbForProject->getDocument('messages', $payload['messageId']);
|
||||
|
||||
$this->sendExternalMessage($dbForProject, $message, $deviceForFiles, $deviceForLocalFiles, );
|
||||
$this->sendExternalMessage($dbForProject, $message, $deviceForFiles, $project);
|
||||
break;
|
||||
default:
|
||||
throw new \Exception('Unknown message type: ' . $type);
|
||||
|
|
@ -112,7 +112,7 @@ class Messaging extends Action
|
|||
Database $dbForProject,
|
||||
Document $message,
|
||||
Device $deviceForFiles,
|
||||
Device $deviceForLocalFiles,
|
||||
Document $project,
|
||||
): void {
|
||||
$topicIds = $message->getAttribute('topics', []);
|
||||
$targetIds = $message->getAttribute('targets', []);
|
||||
|
|
@ -218,8 +218,8 @@ class Messaging extends Action
|
|||
/**
|
||||
* @var array<array> $results
|
||||
*/
|
||||
$results = batch(\array_map(function ($providerId) use ($identifiers, &$providers, $default, $message, $dbForProject, $deviceForFiles, $deviceForLocalFiles) {
|
||||
return function () use ($providerId, $identifiers, &$providers, $default, $message, $dbForProject, $deviceForFiles, $deviceForLocalFiles) {
|
||||
$results = batch(\array_map(function ($providerId) use ($identifiers, &$providers, $default, $message, $dbForProject, $deviceForFiles, $project) {
|
||||
return function () use ($providerId, $identifiers, &$providers, $default, $message, $dbForProject, $deviceForFiles, $project) {
|
||||
if (\array_key_exists($providerId, $providers)) {
|
||||
$provider = $providers[$providerId];
|
||||
} else {
|
||||
|
|
@ -246,8 +246,8 @@ class Messaging extends Action
|
|||
$adapter->getMaxMessagesPerRequest()
|
||||
);
|
||||
|
||||
return batch(\array_map(function ($batch) use ($message, $provider, $adapter, $dbForProject, $deviceForFiles, $deviceForLocalFiles) {
|
||||
return function () use ($batch, $message, $provider, $adapter, $dbForProject, $deviceForFiles, $deviceForLocalFiles) {
|
||||
return batch(\array_map(function ($batch) use ($message, $provider, $adapter, $dbForProject, $deviceForFiles, $project) {
|
||||
return function () use ($batch, $message, $provider, $adapter, $dbForProject, $deviceForFiles, $project) {
|
||||
$deliveredTotal = 0;
|
||||
$deliveryErrors = [];
|
||||
$messageData = clone $message;
|
||||
|
|
@ -256,7 +256,7 @@ class Messaging extends Action
|
|||
$data = match ($provider->getAttribute('type')) {
|
||||
MESSAGE_TYPE_SMS => $this->buildSmsMessage($messageData, $provider),
|
||||
MESSAGE_TYPE_PUSH => $this->buildPushMessage($messageData),
|
||||
MESSAGE_TYPE_EMAIL => $this->buildEmailMessage($dbForProject, $messageData, $provider, $deviceForFiles, $deviceForLocalFiles),
|
||||
MESSAGE_TYPE_EMAIL => $this->buildEmailMessage($dbForProject, $messageData, $provider, $deviceForFiles, $project),
|
||||
default => throw new \Exception('Provider with the requested ID is of the incorrect type')
|
||||
};
|
||||
|
||||
|
|
@ -354,8 +354,8 @@ class Messaging extends Action
|
|||
|
||||
$path = $file->getAttribute('path', '');
|
||||
|
||||
if ($deviceForLocalFiles->exists($path)) {
|
||||
$deviceForLocalFiles->delete($path);
|
||||
if ($this->getLocalDevice($project)->exists($path)) {
|
||||
$this->getLocalDevice($project)->delete($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -524,7 +524,7 @@ class Messaging extends Action
|
|||
Document $message,
|
||||
Document $provider,
|
||||
Device $deviceForFiles,
|
||||
Device $deviceForLocalFiles,
|
||||
Document $project,
|
||||
): Email {
|
||||
$fromName = $provider['options']['fromName'] ?? null;
|
||||
$fromEmail = $provider['options']['fromEmail'] ?? null;
|
||||
|
|
@ -586,7 +586,7 @@ class Messaging extends Action
|
|||
}
|
||||
|
||||
if ($deviceForFiles->getType() !== Storage::DEVICE_LOCAL) {
|
||||
$deviceForFiles->transfer($path, $path, $deviceForLocalFiles);
|
||||
$deviceForFiles->transfer($path, $path, $this->getLocalDevice($project));
|
||||
}
|
||||
|
||||
$attachment = new Attachment(
|
||||
|
|
@ -658,4 +658,13 @@ class Messaging extends Action
|
|||
$badge
|
||||
);
|
||||
}
|
||||
|
||||
private function getLocalDevice($project): Local
|
||||
{
|
||||
if($this->localDevice === null) {
|
||||
$this->localDevice = new Local(APP_STORAGE_UPLOADS . '/app-' . $project->getId());
|
||||
}
|
||||
|
||||
return $this->localDevice;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,15 +96,15 @@ class OpenAPI3 extends Format
|
|||
];
|
||||
|
||||
if (isset($output['components']['securitySchemes']['Project'])) {
|
||||
$output['components']['securitySchemes']['Project']['x-appwrite'] = ['demo' => '5df5acd0d48c2'];
|
||||
$output['components']['securitySchemes']['Project']['x-appwrite'] = ['demo' => '<YOUR_PROJECT_ID>'];
|
||||
}
|
||||
|
||||
if (isset($output['components']['securitySchemes']['Key'])) {
|
||||
$output['components']['securitySchemes']['Key']['x-appwrite'] = ['demo' => '919c2d18fb5d4...a2ae413da83346ad2'];
|
||||
$output['components']['securitySchemes']['Key']['x-appwrite'] = ['demo' => '<YOUR_API_KEY>'];
|
||||
}
|
||||
|
||||
if (isset($output['securityDefinitions']['JWT'])) {
|
||||
$output['securityDefinitions']['JWT']['x-appwrite'] = ['demo' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...'];
|
||||
$output['securityDefinitions']['JWT']['x-appwrite'] = ['demo' => '<YOUR_JWT>'];
|
||||
}
|
||||
|
||||
if (isset($output['components']['securitySchemes']['Locale'])) {
|
||||
|
|
|
|||
|
|
@ -93,15 +93,15 @@ class Swagger2 extends Format
|
|||
];
|
||||
|
||||
if (isset($output['securityDefinitions']['Project'])) {
|
||||
$output['securityDefinitions']['Project']['x-appwrite'] = ['demo' => '5df5acd0d48c2'];
|
||||
$output['securityDefinitions']['Project']['x-appwrite'] = ['demo' => '<YOUR_PROJECT_ID>'];
|
||||
}
|
||||
|
||||
if (isset($output['securityDefinitions']['Key'])) {
|
||||
$output['securityDefinitions']['Key']['x-appwrite'] = ['demo' => '919c2d18fb5d4...a2ae413da83346ad2'];
|
||||
$output['securityDefinitions']['Key']['x-appwrite'] = ['demo' => '<YOUR_API_KEY>'];
|
||||
}
|
||||
|
||||
if (isset($output['securityDefinitions']['JWT'])) {
|
||||
$output['securityDefinitions']['JWT']['x-appwrite'] = ['demo' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...'];
|
||||
$output['securityDefinitions']['JWT']['x-appwrite'] = ['demo' => '<YOUR_JWT>'];
|
||||
}
|
||||
|
||||
if (isset($output['securityDefinitions']['Locale'])) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:2.2
|
||||
|
|
|
|||
|
|
@ -21,11 +21,6 @@ class ComposeTest extends TestCase
|
|||
$this->object = new Compose($data);
|
||||
}
|
||||
|
||||
public function testVersion(): void
|
||||
{
|
||||
$this->assertEquals('3', $this->object->getVersion());
|
||||
}
|
||||
|
||||
public function testServices(): void
|
||||
{
|
||||
$this->assertCount(15, $this->object->getServices());
|
||||
|
|
|
|||
Loading…
Reference in a new issue