From 89b94eb86c0d2651a54bde1f7704e59300e5eb5e Mon Sep 17 00:00:00 2001 From: Peter Ivanov Date: Mon, 11 Nov 2024 14:52:22 +0200 Subject: [PATCH] update --- web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php | 9 ++++++++- .../views/actions/certbot-http-secure-command.blade.php | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php b/web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php index 299ceeb..0481690 100644 --- a/web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php +++ b/web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php @@ -33,6 +33,9 @@ class LetsEncryptSecureDomain 'domain' => $findDomain->domain, 'domainRoot' => $findDomain->domain_root, 'domainPublic' => $findDomain->domain_public, + 'sslCertificateFilePath'=> $sslCertificateFilePath, + 'sslCertificateKeyFilePath'=> $sslCertificateKeyFilePath, + 'sslCertificateChainFilePath'=> $sslCertificateChainFilePath, 'email' => $generalSettings['master_email'], 'country' => $generalSettings['master_country'], 'locality' => $generalSettings['master_locality'], @@ -43,7 +46,7 @@ class LetsEncryptSecureDomain if (empty($isCertbotInstalled)) { shell_exec('sudo apt install certbot -y'); } - + $output =''; $tmpFile = '/tmp/certbot-http-secure-command-'.$findDomain->id.'.sh'; file_put_contents($tmpFile, $certbotHttpSecureCommand); shell_exec('chmod +x '.$tmpFile); @@ -52,6 +55,10 @@ class LetsEncryptSecureDomain $exec = shell_exec("bash $tmpFile"); sleep(10); + shell_exec('chmod 0755 /etc/letsencrypt/live/'.$findDomain->domain.'/privkey.pem'); + shell_exec('chmod 0755 /etc/letsencrypt/live/'.$findDomain->domain.'/fullchain.pem'); + shell_exec('chmod 0755 /etc/letsencrypt/live/'.$findDomain->domain.'/cert.pem'); + shell_exec('chmod 0755 /etc/letsencrypt/live/'.$findDomain->domain.'/chain.pem'); unlink($tmpFile); diff --git a/web/Modules/LetsEncrypt/resources/views/actions/certbot-http-secure-command.blade.php b/web/Modules/LetsEncrypt/resources/views/actions/certbot-http-secure-command.blade.php index 9c8ee8f..e4f5d1d 100644 --- a/web/Modules/LetsEncrypt/resources/views/actions/certbot-http-secure-command.blade.php +++ b/web/Modules/LetsEncrypt/resources/views/actions/certbot-http-secure-command.blade.php @@ -4,6 +4,10 @@ sudo certbot certonly \ --manual \ --preferred-challenges=http \ -d {{$domain}} \ + --cert-name {{$domain}} \ --email {{$email}} \ + --cert-path {{$sslCertificateFilePath}} \ + --key-path {{$sslCertificateKeyFilePath}} \ + --fullchain-path {{$sslCertificateChainFilePath}} \ --manual-auth-hook /usr/local/phyre/web/Modules/LetsEncrypt/shell/hooks/pre/http-authenticator.sh \ --force-renewal