改用element
增加acme多配置
This commit is contained in:
@@ -4,6 +4,7 @@ ACME 核心服务 - 集成 Let's Encrypt 证书申请与续签
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import time
|
||||
import hashlib
|
||||
import base64
|
||||
@@ -223,6 +224,20 @@ class AcmeService:
|
||||
)
|
||||
output = result.stdout + "\n" + result.stderr
|
||||
success = result.returncode == 0
|
||||
|
||||
# certbot 实际存储路径(可能忽略了 --cert-path)
|
||||
certbot_live = self.cert_dir / ".certbot-config" / "live" / store_dir
|
||||
if success and certbot_live.exists():
|
||||
import shutil
|
||||
src_fullchain = certbot_live / "fullchain.pem"
|
||||
src_privkey = certbot_live / "privkey.pem"
|
||||
dst_fullchain = domain_dir / "fullchain.pem"
|
||||
dst_privkey = domain_dir / "private.key"
|
||||
if src_fullchain.exists():
|
||||
shutil.copy2(str(src_fullchain), str(dst_fullchain))
|
||||
if src_privkey.exists():
|
||||
shutil.copy2(str(src_privkey), str(dst_privkey))
|
||||
|
||||
return success, output
|
||||
except subprocess.TimeoutExpired:
|
||||
return False, "Certbot timeout after 180s"
|
||||
|
||||
Reference in New Issue
Block a user