Skip to content

Commit 1b3a56b

Browse files
author
Thom
committed
Hacky BIND modification seems not to be needed, just run the acme.sh command in the background and the next server cron will create the needed DNS records (#4202)
1 parent ed6365e commit 1b3a56b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

server/lib/classes/letsencrypt.inc.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ public function request_certificates($data, $server_type = 'apache') {
499499
$app->log("Let's Encrypt SSL Cert domains: $cli_domain_arg", LOGLEVEL_DEBUG);
500500

501501
if ($use_acme && $global_sites_config['acme_dns_user'] != '' && $dns_server_id == $conf["server_id"]) {
502-
$firstrun = true;
502+
$success = $app->system->_exec("(" . $letsencrypt_cmd . ") > /dev/null &", $allow_return_codes); // the code below seems not be needed, written on 13-02-2023. It can be removed if acme.sh with DNS-01 verification works well on single server setups.
503+
/*$firstrun = true;
503504
$dns_config = $app->getconf->get_server_config($conf["server_id"], 'dns');
504505
$zonefile = $dns_config['bind_zonefiles_dir'].'/'. "pri." . $zonedomain;
505506
$datalogfound = false;
@@ -511,12 +512,12 @@ public function request_certificates($data, $server_type = 'apache') {
511512
$sql = "SELECT data FROM sys_datalog,server WHERE sys_datalog.server_id = \"1\" AND sys_datalog.datalog_id > server.updated AND sys_datalog.dbtable = 'dns_rr' AND data LIKE '%_acme-challenge%'";
512513
$datalogs = $app->dbmaster->queryAllRecords($sql);
513514
if (is_array($datalogs)) {
514-
$app->log("Found datalog for acme-challenge, appending to zonefile.", LOGLEVEL_DEBUG);
515515
foreach ($datalogs as $datalog) {
516516
$datalog = unserialize($datalog['data']);
517517
$hostname = $datalog['new']['name'];
518518
$data = $datalog['new']['data'];
519519
$record = "\n" . $hostname . "." . $zonedomain . "." . " 3600 TXT \"" . $data . "\"";
520+
$app->log("Found datalog for acme-challenge, appending to zonefile with record: " . $record, LOGLEVEL_DEBUG);
520521
$app->system->file_put_contents($zonefile, $record);
521522
}
522523
$app->services->registerService('bind', 'dns_module', 'restartBind');
@@ -529,7 +530,7 @@ public function request_certificates($data, $server_type = 'apache') {
529530
$app->log("Can not find the datalog for the acme-challenge yet, waiting 20 seconds.", LOGLEVEL_DEBUG);
530531
sleep(20);
531532
}
532-
}
533+
}*/
533534
} else {
534535
$success = $app->system->_exec($letsencrypt_cmd, $allow_return_codes);
535536
}

0 commit comments

Comments
 (0)