fix: certificates
This commit is contained in:
parent
49ba7d5dfd
commit
c675c048ac
|
@ -47,20 +47,20 @@ App::init(function ($utopia, $request, $response, $console, $project, $dbForCons
|
||||||
} else {
|
} else {
|
||||||
Authorization::disable();
|
Authorization::disable();
|
||||||
|
|
||||||
$certificate = $dbForConsole->findOne('certificates', [
|
$domainDocument = $dbForConsole->findOne('domain', [
|
||||||
new Query('domain', QUERY::TYPE_EQUAL, [$domain->get()])
|
new Query('domain', QUERY::TYPE_EQUAL, [$domain->get()])
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (empty($certificate)) {
|
if (!$domainDocument) {
|
||||||
$certificate = new Document([
|
$domainDocument = new Document([
|
||||||
'domain' => $domain->get(),
|
'domain' => $domain->get(),
|
||||||
]);
|
]);
|
||||||
$certificate = $dbForConsole->createDocument('certificates', $certificate);
|
$domainDocument = $dbForConsole->createDocument('domains', $domains);
|
||||||
|
|
||||||
Console::info('Issuing a TLS certificate for the master domain (' . $domain->get() . ') in a few seconds...');
|
Console::info('Issuing a TLS certificate for the master domain (' . $domain->get() . ') in a few seconds...');
|
||||||
|
|
||||||
Resque::enqueue('v1-certificates', 'CertificatesV1', [
|
Resque::enqueue('v1-certificates', 'CertificatesV1', [
|
||||||
'document' => $certificate,
|
'document' => $domainDocument,
|
||||||
'domain' => $domain->get(),
|
'domain' => $domain->get(),
|
||||||
'validateTarget' => false,
|
'validateTarget' => false,
|
||||||
'validateCNAME' => false,
|
'validateCNAME' => false,
|
||||||
|
@ -74,7 +74,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $dbForCons
|
||||||
Config::setParam('domains', $domains);
|
Config::setParam('domains', $domains);
|
||||||
}
|
}
|
||||||
|
|
||||||
$localeParam = (string)$request->getParam('locale', $request->getHeader('x-appwrite-locale', ''));
|
$localeParam = (string) $request->getParam('locale', $request->getHeader('x-appwrite-locale', ''));
|
||||||
|
|
||||||
if (\in_array($localeParam, Config::getParam('locale-codes'))) {
|
if (\in_array($localeParam, Config::getParam('locale-codes'))) {
|
||||||
$locale->setDefault($localeParam);
|
$locale->setDefault($localeParam);
|
||||||
|
|
Loading…
Reference in a new issue