fix import ssl letsencrypt

This commit is contained in:
mercury
2023-04-23 15:24:18 +04:00
parent 7be4971419
commit 8e5352149e
+3 -1
View File
@@ -743,7 +743,7 @@ class Bot
case 'letsencrypt':
$out[] = 'Install certificate:';
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
exec("certbot certonly --preferred-chain 'ISRG Root X1' -n --agree-tos --email mail@{$conf['domain']} -d {$conf['domain']} --webroot -w /certs/ 2>&1", $out, $code);
exec("certbot certonly --force-renew --preferred-chain 'ISRG Root X1' -n --agree-tos --email mail@{$conf['domain']} -d {$conf['domain']} --webroot -w /certs/ 2>&1", $out, $code);
if ($code > 0) {
$this->send($this->input['chat'], "ERROR\n" . implode("\n", $out));
break;
@@ -751,6 +751,8 @@ class Bot
$out[] = 'Generate bundle';
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
$bundle = file_get_contents("/etc/letsencrypt/live/{$conf['domain']}/privkey.pem") . file_get_contents("/etc/letsencrypt/live/{$conf['domain']}/fullchain.pem");
$conf['letsencrypt'] = 1;
$this->setPacConf($conf);
break;
case 'self':
$r = $this->request('getFile', ['file_id' => $this->input['file_id']]);