From 41b0076623e559638edc86ba4dce4ea9fa3e8b71 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Tue, 25 Feb 2020 11:21:56 +0200 Subject: [PATCH] Fix for missing paths --- app/workers/certificates.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/workers/certificates.php b/app/workers/certificates.php index b69462db7f..b0a6b9bd42 100644 --- a/app/workers/certificates.php +++ b/app/workers/certificates.php @@ -93,6 +93,14 @@ class CertificatesV1 if(!$response) { throw new Exception('Failed to issue a certificate'); } + + $path = APP_STORAGE_CERTIFICATES.'/'.$domain->get(); + + if(!is_readable($path)) { + if (!mkdir($path, 0755, true)) { + throw new Exception('Failed to create path...'); + } + } if(!@rename('/etc/letsencrypt/live/'.$domain->get().'/cert.pem', APP_STORAGE_CERTIFICATES.'/'.$domain->get().'/cert.pem')) { throw new Exception('Failed to rename certificate cert.pem: '.json_encode($response));