# certbot-letencrypt-tencentcloud-qiniu-deploy **Repository Path**: senqi666/certbot-letencrypt-tencentcloud-qiniu-deploy ## Basic Information - **Project Name**: certbot-letencrypt-tencentcloud-qiniu-deploy - **Description**: 自动验证腾讯云DNS并使用certbot续签证书,支持上传至七牛 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2026-01-08 - **Last Updated**: 2026-02-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # certbot-letencrypt-tencentcloud-qiniu-deploy #### 介绍 自动验证腾讯云DNS并使用certbot续签证书,支持上传至七牛 #### 安装教程 1. 安装 certbot ```bash yum install certbot ``` 2. 将仓库脚本放入目录:`/etc/letsencrypt/renewal-hooks` #### 使用说明 1. 安装脚本所需python包 ```bash pip3 install -r requirements.txt ``` 2. 去腾讯云申请API KEY并配置在 `tencent_credentials.json` 3. 设置 `certbot-tencent-dns-hook.sh` 文件中的`PYTHON_SCRIPT` 变量并检查下方所需的python脚本路径:`/usr/bin/python3` 4. 设置 `tencent_cloud_dns.py` 文件中的 `credentials_paths`变量,设置为 `tencent_credentials.json` 文件的路径 5. 去七牛云申请API KEY并配置在 `ssl_auto.py` 文件中的 `access_key` 和 `secret_key` 变量 6. 设置 `ssl_auto.py` 文件中的 `need_domains`。填入需要将证书上传至七牛云的域名 #### 证书生成 `certbot-tencent-dns-hook.sh` 支持向腾讯云添加域名解析 `add` 和删除域名解析 `clean` 1. 首次生成证书 ```bash certbot certonly --email xxx@163.com --manual --preferred-challenges=dns --manual-auth-hook "/etc/letsencrypt/renewal-hooks/certbot-tencent-dns-hook.sh add" --manual-cleanup-hook "/etc/letsencrypt/renewal-hooks/certbot-tencent-dns-hook.sh clean" -d example.com ``` 2. 首次强制更新证书进行测试 ```bash certbot renew --force-renewal --deploy-hook "/usr/bin/python3 /etc/letsencrypt/renewal-hooks/ssl_auto.py ; /usr/sbin/nginx -s reload" ``` 3. crontab配置证书自动更新(每月15日) ```bash 0 0 15 * * certbot renew --quiet --no-self-upgrade ```