-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
希望添加SSL证书挂载目录 #112
Comments
我们会视情况而定 |
https://gitee.com/lsmir2/docker-uuwaf 我做了处理 #配置路径
wafupdate=/opt/docker/docker-uuwaf/data/updateWafssl
#修改证书的路径, sql 账号密码
$wafupdate -n "server.crt" -k "server.key" -s "uuwaf:[email protected]:3306/uuwaf" --id 1 |
抛砖引玉吧,写了个python脚本,青龙面板每个月执行一次 from datetime import datetime
import os
import requests
import json
import time
# 读取当前目录下指定文件名的文件,返回字符串
def read_file(filename):
return open(os.path.join(os.path.dirname(__file__), filename), 'r').read()
# 提取acme证书目录配置中的时间戳
def get_time(time):
return time.split('Le_CertCreateTime')[1].split('\'')[1]
cert = read_file('fullchain.cer')
key = read_file('com.key')
dt = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(get_time(read_file('com.conf')))))
ct= datetime.now().strftime('%Y-%m-%d %H:%M:%S')
# 组合成请求体
post_json = {
"id": "0",
"sni": "[\"*.证书域名.com\",\"证书域名.com\"]",
"cert": cert,
"key": key,
"expire_time": dt,
"update_time": ct
}
pwd = '{"usr":"南墙管理员","pwd":"密码","otp":""}'
# 获取token
token = requests.post('https://192.168.20.112:4443/api/v1/users/login',data=pwd,verify=False).json()['token']
# 提交证书数据
requests.post('https://192.168.20.112:4443/api/v1/certs/config',data=json.dumps(post_json),headers={"authorization": token},verify=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
因为没有公网80和443端口,现阶段无法使用南墙代替acme。
但南墙手动添加的证书是写入数据库中,无法通过替换文件的方式更新最新的证书。
希望能给个文件目录,系统自动将目录中的证书导入到数据库。
The text was updated successfully, but these errors were encountered: