Skip to content

Commit

Permalink
Update LetsEncryptSecureDomain.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Nov 4, 2024
1 parent e8dc629 commit 1fd0399
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,20 @@ public function handle(): void
'organization' => $generalSettings['organization_name'],
])->render();

$isCertbotInstalled = shell_exec('which certbot');
if (empty($isCertbotInstalled)) {
shell_exec('sudo apt install certbot -y');
}

$tmpFile = '/tmp/certbot-http-secure-command-'.$findDomain->id.'.sh';
file_put_contents($tmpFile, $certbotHttpSecureCommand);
shell_exec('chmod +x '.$tmpFile);
shell_exec('chmod +x /usr/local/phyre/web/Modules/LetsEncrypt/shell/hooks/pre/http-authenticator.sh');
shell_exec('chmod +x /usr/local/phyre/web/Modules/LetsEncrypt/shell/hooks/post/http-cleanup.sh');
$exec = shell_exec("bash $tmpFile");

sleep(10);

unlink($tmpFile);

$validateCertificates = [];
Expand Down

0 comments on commit 1fd0399

Please sign in to comment.