From 9c1538de29f6e1fb672a9b18f8beadad470d67b4 Mon Sep 17 00:00:00 2001 From: Lain Date: Sat, 25 Jan 2025 23:01:38 -0300 Subject: [PATCH] Allow custom ssl server --- cloudflare.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cloudflare.py b/cloudflare.py index 52d749b..94321ca 100755 --- a/cloudflare.py +++ b/cloudflare.py @@ -76,7 +76,13 @@ class Cloudflare: dns_list = self.list_dns(zone_id, type_) return dns_list['result'][0]['content'] - def issue_cert(self, ssl_home: str, acme_directory: str, domains: List[str]) -> None: + def issue_cert( + self, + ssl_home: str, + acme_directory: str, + domains: List[str], + server: str = 'zerossl', +) -> None: env = { 'HOME': ssl_home, 'CF_Key': self.key, @@ -84,7 +90,7 @@ class Cloudflare: } acme = os.path.join(script_dir, acme_directory, 'acme.sh') - kwargs = [acme, '--issue', '--dns', 'dns_cf', '-d', self.host] + kwargs = [acme, '--server', server, '--issue', '--dns', 'dns_cf', '-d', self.host] for domain in domains: kwargs.extend(['-d', f"{domain}.{self.host}"]) @@ -169,8 +175,9 @@ class CloudflareAction(argparse.Action): if option_string == '--issue-cert': ssl_home = config.get('ssl', 'ssl_home') acme_directory = config.get('ssl', 'acme_directory') + server = config.get('ssl', 'server', fallback='zerossl') subdomains = config.get('General', 'subdomains').replace(' ', '').split(',') - self.cloudflare.issue_cert(ssl_home, acme_directory, subdomains) + self.cloudflare.issue_cert(ssl_home, acme_directory, subdomains, server) if option_string == '--maintenance': self.cloudflare.update_dns(