mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +00:00
chore: fix bug
This commit is contained in:
parent
f4d456fa4c
commit
28b02a4ba8
1 changed files with 7 additions and 7 deletions
|
|
@ -160,7 +160,10 @@ class Certificates extends Action
|
|||
|
||||
try {
|
||||
// Generate certificate files using Let's Encrypt
|
||||
$letsEncryptData = $this->issueCertificate($folder, $domain->get(), $email);
|
||||
$letsEncryptData = $this->issueCertificate($folder, $domain->get(), $email);
|
||||
|
||||
// Give certificates to Traefik
|
||||
$this->applyCertificateFiles($folder, $domain->get(), $letsEncryptData);
|
||||
} catch (\Throwable $th) {
|
||||
Console::error('Failed to generate Lets Encrypt certificate');
|
||||
}
|
||||
|
|
@ -176,9 +179,6 @@ class Certificates extends Action
|
|||
Console::error('Failed to add custom hostname to registrar: ' . $th->getMessage());
|
||||
}
|
||||
|
||||
// Give certificates to Traefik
|
||||
$this->applyCertificateFiles($folder, $domain->get(), $letsEncryptData);
|
||||
|
||||
// Update certificate info stored in database
|
||||
$certificate->setAttribute('renewDate', $this->getRenewDate($domain->get()));
|
||||
$certificate->setAttribute('attempts', 0);
|
||||
|
|
@ -222,13 +222,13 @@ class Certificates extends Action
|
|||
{
|
||||
$client = new Client();
|
||||
$client
|
||||
->addHeader('Content-Type', Client::CONTENT_TYPE_APPLICATION_JSON)
|
||||
->addHeader('content-type', Client::CONTENT_TYPE_APPLICATION_JSON)
|
||||
->addHeader('Authorization', 'Bearer ' . System::getEnv('_APP_SYSTEM_CLOUDFLARE_TOKEN'));
|
||||
|
||||
$response = $client->fetch("https://api.cloudflare.com/client/v4/zones/b2d0e62383d3c0f6299efab107af2c7a/custom_hostnames", Client::METHOD_POST, [
|
||||
'custom_metadata' => [
|
||||
'projectId' => $project->getId(),
|
||||
'organizationId' => $project->getAttribute('teamId')
|
||||
'projectId' => $project->getId() ?? '',
|
||||
'organizationId' => $project->getAttribute('teamId', '')
|
||||
],
|
||||
'hostname' => $hostname,
|
||||
'ssl' => [
|
||||
|
|
|
|||
Loading…
Reference in a new issue