Merge branch '0.14.x' of https://github.com/appwrite/appwrite into feat-new-event-model
This commit is contained in:
commit
840f7419dc
|
@ -74,6 +74,17 @@ App::init(function ($utopia, $request, $response, $console, $project, $dbForCons
|
||||||
} else {
|
} else {
|
||||||
Authorization::disable();
|
Authorization::disable();
|
||||||
|
|
||||||
|
$mainDomain = null;
|
||||||
|
if(!empty(App::getEnv('_APP_DOMAIN', ''))) {
|
||||||
|
$mainDomain = App::getEnv('_APP_DOMAIN', '');
|
||||||
|
} else {
|
||||||
|
$domainDocument = $dbForConsole->findOne('domains', [], 0, ['_id'], ['ASC']);
|
||||||
|
$mainDomain = $domainDocument ? $domainDocument->getAttribute('domain') : $domain->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
if($mainDomain !== $domain->get()) {
|
||||||
|
Console::warning($domain->get() . ' is not a main domain. Skipping SSL certificate generation.');
|
||||||
|
} else {
|
||||||
$domainDocument = $dbForConsole->findOne('domains', [
|
$domainDocument = $dbForConsole->findOne('domains', [
|
||||||
new Query('domain', QUERY::TYPE_EQUAL, [$domain->get()])
|
new Query('domain', QUERY::TYPE_EQUAL, [$domain->get()])
|
||||||
]);
|
]);
|
||||||
|
@ -89,16 +100,16 @@ App::init(function ($utopia, $request, $response, $console, $project, $dbForCons
|
||||||
|
|
||||||
$domainDocument = $dbForConsole->createDocument('domains', $domainDocument);
|
$domainDocument = $dbForConsole->createDocument('domains', $domainDocument);
|
||||||
|
|
||||||
Console::info('Issuing a TLS certificate for the master domain (' . $domain->get() . ') in a few seconds...');
|
Console::info('Issuing a TLS certificate for the main domain (' . $domain->get() . ') in a few seconds...');
|
||||||
|
|
||||||
$event = new Certificate();
|
$event = new Certificate();
|
||||||
$event
|
$event
|
||||||
->setDomain($domainDocument)
|
->setDomain($domainDocument)
|
||||||
->trigger();
|
->trigger();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$domains[$domain->get()] = true;
|
$domains[$domain->get()] = true;
|
||||||
|
|
||||||
Authorization::reset(); // ensure authorization is re-enabled
|
Authorization::reset(); // ensure authorization is re-enabled
|
||||||
}
|
}
|
||||||
Config::setParam('domains', $domains);
|
Config::setParam('domains', $domains);
|
||||||
|
|
Loading…
Reference in a new issue