mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 01:18:37 +00:00
updates
This commit is contained in:
parent
b706571a21
commit
ec02d881c9
11 changed files with 12 additions and 10 deletions
|
|
@ -60,7 +60,9 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo
|
|||
var_dump(System::getEnv('_APP_DOMAIN_FUNCTIONS', ''));
|
||||
var_dump($host);
|
||||
var_dump(APP_HOSTNAME_INTERNAL);
|
||||
|
||||
var_dump($request->getHeader('host'));
|
||||
var_dump($request->getHeader('x-forwarded-host'));
|
||||
|
||||
if ($route === null) {
|
||||
if ($host === System::getEnv('_APP_DOMAIN_FUNCTIONS', '')) {
|
||||
throw new AppwriteException(AppwriteException::GENERAL_ACCESS_FORBIDDEN, 'This domain cannot be used for security reasons. Please use any subdomain instead.');
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class Build extends Event
|
|||
$client = new Client($this->queue, $this->connection);
|
||||
|
||||
return $client->enqueue([
|
||||
'sourceRegion' => System::getEnv('_APP_REGION', 'default'),
|
||||
'sourceRegion' => $this->getSourceRegion(),
|
||||
'project' => $this->project,
|
||||
'resource' => $this->resource,
|
||||
'deployment' => $this->deployment,
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class Certificate extends Event
|
|||
$client = new Client($this->queue, $this->connection);
|
||||
|
||||
return $client->enqueue([
|
||||
'sourceRegion' => System::getEnv('_APP_REGION', 'default'),
|
||||
'sourceRegion' => $this->getSourceRegion(),
|
||||
'project' => $this->project,
|
||||
'domain' => $this->domain,
|
||||
'skipRenewCheck' => $this->skipRenewCheck
|
||||
|
|
|
|||
|
|
@ -109,7 +109,6 @@ class Database extends Event
|
|||
public function trigger(): string|bool
|
||||
{
|
||||
|
||||
|
||||
try {
|
||||
$dsn = new DSN($this->getProject()->getAttribute('database'));
|
||||
} catch (\InvalidArgumentException) {
|
||||
|
|
@ -123,7 +122,7 @@ class Database extends Event
|
|||
|
||||
try {
|
||||
$result = $client->enqueue([
|
||||
'sourceRegion' => System::getEnv('_APP_REGION', 'default'),
|
||||
'sourceRegion' => $this->getSourceRegion(),
|
||||
'project' => $this->project,
|
||||
'user' => $this->user,
|
||||
'type' => $this->type,
|
||||
|
|
|
|||
|
|
@ -110,6 +110,8 @@ class Event
|
|||
return $this->event;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getSourceRegion(): string
|
||||
{
|
||||
return System::getEnv('_APP_REGION', 'default');
|
||||
|
|
|
|||
|
|
@ -220,6 +220,7 @@ class Func extends Event
|
|||
$events = $this->getEvent() ? Event::generateEvents($this->getEvent(), $this->getParams()) : null;
|
||||
|
||||
return $client->enqueue([
|
||||
'sourceRegion' => $this->getSourceRegion(),
|
||||
'project' => $this->project,
|
||||
'user' => $this->user,
|
||||
'function' => $this->function,
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ class Migration extends Event
|
|||
|
||||
return $client->enqueue([
|
||||
'sourceRegion' => $this->getSourceRegion(),
|
||||
|
||||
'project' => $this->project,
|
||||
'user' => $this->user,
|
||||
'migration' => $this->migration
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ class Builds extends Action
|
|||
$resource = new Document($payload['resource'] ?? []);
|
||||
$deployment = new Document($payload['deployment'] ?? []);
|
||||
$template = new Document($payload['template'] ?? []);
|
||||
|
||||
$this->sourceRegion = $payload['sourceRegion'] ?? 'default';
|
||||
|
||||
$log->addTag('projectId', $project->getId());
|
||||
$log->addTag('type', $type);
|
||||
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ class Certificates extends Action
|
|||
$document = new Document($payload['domain'] ?? []);
|
||||
$domain = new Domain($document->getAttribute('domain', ''));
|
||||
$skipRenewCheck = $payload['skipRenewCheck'] ?? false;
|
||||
|
||||
$this->sourceRegion = $payload['sourceRegion'] ?? 'default';
|
||||
|
||||
$log->addTag('domain', $domain->get());
|
||||
$this->execute($domain, $dbForConsole, $queueForMails, $queueForEvents, $queueForFunctions, $log,$realtimeConnection, $skipRenewCheck);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ class Databases extends Action
|
|||
$collection = new Document($payload['collection'] ?? []);
|
||||
$document = new Document($payload['document'] ?? []);
|
||||
$database = new Document($payload['database'] ?? []);
|
||||
|
||||
$this->sourceRegion = $payload['sourceRegion'] ?? 'default';
|
||||
|
||||
$log->addTag('projectId', $project->getId());
|
||||
$log->addTag('type', $type);
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,6 @@ class Functions extends Action
|
|||
|
||||
$this->sourceRegion = $payload['sourceRegion'] ?? 'default';
|
||||
|
||||
|
||||
if ($function->isEmpty() && !empty($functionId)) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue