Skip to content

Commit

Permalink
Merge pull request #79 from AlternC/issue-74
Browse files Browse the repository at this point in the history
Fixes #74 : Provide a force mode to generate certificate
  • Loading branch information
camlafit authored May 22, 2023
2 parents cd82763 + 20a28aa commit c092ef2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/usr/share/alternc/panel/class/m_acme.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,18 @@ public function m_acme()
* @return integer the ID of the newly created certificate in the table
* or false if an error occurred
*/
public function import($fqdn)
public function import($fqdn,$force = false)
{
global $cuid, $msg, $ssl;
$msg->log("acme", "import","$fqdn");

$output = array();
$return_var = -1;
exec("certbot --agree-tos --non-interactive --webroot -w /var/lib/acme/ certonly -d ".$fqdn." 2>&1", $output, $return_var);
$arg = "--agree-tos --non-interactive --webroot -w /var/lib/acme/";
if ($force) {
$arg.=" --force-renewal";
}
exec("certbot ".$arg." certonly -d ".$fqdn." 2>&1", $output, $return_var);

// Add certificate to panel
if ($return_var == 0) {
Expand Down

0 comments on commit c092ef2

Please sign in to comment.