Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-mw committed Nov 11, 2024
1 parent 1fd0399 commit 89b94eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public function handle(): void
'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'],
Expand All @@ -43,7 +46,7 @@ public function handle(): void
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);
Expand All @@ -52,6 +55,10 @@ public function handle(): void
$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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
--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

0 comments on commit 89b94eb

Please sign in to comment.