diff --git a/app/bot.php b/app/bot.php index 2351e02..d4b0e43 100644 --- a/app/bot.php +++ b/app/bot.php @@ -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']]);