mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
debug cert
This commit is contained in:
parent
e972ccedd6
commit
1f606a591d
2 changed files with 20 additions and 1 deletions
|
|
@ -34,7 +34,11 @@ class LetsEncrypt implements Adapter
|
|||
$stdout,
|
||||
$stderr
|
||||
);
|
||||
|
||||
var_dump([
|
||||
'location' => 'issueCertificate.1',
|
||||
'certificate' => "certbot certonly -v --webroot --noninteractive --agree-tos$staging --email {$this->email} --cert-name $certName -w ".APP_STORAGE_CERTIFICATES." -d $domain",
|
||||
'result' => $exit,
|
||||
]);
|
||||
// Unexpected error, usually 5XX, API limits, ...
|
||||
if ($exit !== 0) {
|
||||
throw new Exception('Failed to issue a certificate with message: ' . $stderr);
|
||||
|
|
@ -71,7 +75,13 @@ class LetsEncrypt implements Adapter
|
|||
" - certFile: /storage/certificates/{$domain}/fullchain.pem",
|
||||
" keyFile: /storage/certificates/{$domain}/privkey.pem"
|
||||
]);
|
||||
var_dump([
|
||||
'location' => 'issueCertificate.2',
|
||||
'config' => $config,
|
||||
'path' => APP_STORAGE_CONFIG . '/' . $domain . '.yml',
|
||||
'file_put_contents' => file_put_contents(APP_STORAGE_CONFIG . '/' . $domain . '.yml', $config),
|
||||
|
||||
]);
|
||||
// Save configuration into Traefik using our new cert files
|
||||
if (!\file_put_contents(APP_STORAGE_CONFIG . '/' . $domain . '.yml', $config)) {
|
||||
throw new Exception('Failed to save Traefik configuration.');
|
||||
|
|
|
|||
|
|
@ -136,6 +136,11 @@ class Certificates extends Action
|
|||
$certificate->setAttribute('domain', $domain->get());
|
||||
}
|
||||
|
||||
var_dump([
|
||||
'location' => 'execute.1',
|
||||
'certificate' => $certificate
|
||||
]);
|
||||
|
||||
$success = false;
|
||||
|
||||
try {
|
||||
|
|
@ -184,6 +189,10 @@ class Certificates extends Action
|
|||
} finally {
|
||||
// All actions result in new updatedAt date
|
||||
$certificate->setAttribute('updated', DateTime::now());
|
||||
var_dump([
|
||||
'location' => 'execute.2',
|
||||
'certificate' => $certificate
|
||||
]);
|
||||
|
||||
// Save all changes we made to certificate document into database
|
||||
$this->saveCertificateDocument($domain->get(), $certificate, $success, $dbForPlatform, $queueForEvents, $queueForFunctions);
|
||||
|
|
|
|||
Loading…
Reference in a new issue