Certbot DNS EdgeOne (TEO) 插件
通过腾讯云 EdgeOne API 完成 Certbot DNS-01 验证,支持普通域名和泛域名。
站点必须已通过 NS 模式接入 EdgeOne,并完成权威 DNS 服务器切换。CNAME 接入、DNSPod 托管接入及 Pages 站点请使用实际权威 DNS 服务商的插件;本插件不会修改 DNSPod。
功能特性
- 使用官方腾讯云 TEO SDK(API 版本
2022-09-01) - 自动分页查询站点,按 DNS 标签边界选择最长匹配的站点,支持 IDN
- 支持同名多个 TXT 验证值,仅删除本次创建的记录,保留已有记录
- 支持临时凭证,可指定站点 ID 解决同名站点歧义
- 支持 Certbot 3/4/5,Python 3.9–3.15
Python 3.9 使用 Certbot 3/4(Certbot 4.2 起要求 Python ≥3.9.2);Python 3.14–3.15 使用 Certbot 4/5。
Certbot 3 环境需额外安装 pyopenssl<25。
安装
在本仓库目录安装,插件和 Certbot 必须处于同一个 Python 环境:
python3 -m pip install .
# 或使用 uv 创建独立工具环境
uv tool install --with . 'certbot>=5,<6'
也可安装兼容包 certbot-dns-tencent-edgeone,它依赖同版本的 certbot-dns-teo,共用实现和插件入口。在仓库根目录同时安装两个本地项目:
python3 -m pip install . ./packages/certbot-dns-tencent-edgeone
两个包发布到 PyPI 后,也可用 python3 -m pip install certbot-dns-tencent-edgeone 安装。
使用任一包时,认证器均为 dns-teo,命令行参数和凭证前缀均保持 dns-teo- / dns_teo_。
配置文件
保存为 ~/teo.ini:
dns_teo_secret_id = YOUR_SECRET_ID
dns_teo_secret_key = YOUR_SECRET_KEY
# 使用临时凭证时填写
# dns_teo_token = YOUR_SESSION_TOKEN
# 可选:仅允许操作指定的 NS 站点,同名站点有歧义时必须指定
# dns_teo_zone_id = zone-xxxxxxxxxxxx
chmod 600 ~/teo.ini
运行
certbot certonly \
--authenticator dns-teo \
--dns-teo-credentials ~/teo.ini \
--dns-teo-propagation-seconds 30 \
-d example.com \
-d '*.example.com'
TXT TTL 默认 600 秒,可用 --dns-teo-ttl 设置为 60–86400 秒。
传播等待默认 30 秒,由 Certbot 在所有挑战记录创建后统一执行;如 DNS 尚未生效,可增加 --dns-teo-propagation-seconds。
成功签发后可用 certbot renew 续期,Certbot 会保存认证器和凭证路径。
腾讯云权限配置
SecretId / SecretKey 所属账号需要以下操作权限(CAM 自定义策略):
{
"version": "2.0",
"statement": [{
"effect": "allow",
"action": [
"teo:DescribeZones",
"teo:DescribeDnsRecords",
"teo:CreateDnsRecord",
"teo:DeleteDnsRecords"
],
"resource": ["*"]
}]
}
使用公共端点 teo.tencentcloudapi.com,不需要配置 Region。
指定 dns_teo_zone_id 后仍需 DescribeZones 权限,以校验域名范围和 NS 接入状态。
开发与验证
uv sync --locked --all-packages --python 3.13
uv run --no-sync ruff check .
uv run --no-sync ruff format --check .
uv run --no-sync pytest --cov=certbot_dns_teo --cov-report=term-missing
uv run --no-sync tox run-parallel -p 4
uv build --all-packages --out-dir dist --clear
uv run --no-sync twine check --strict dist/*
uv run --no-sync python scripts/check_alias_installation.py
测试使用真实 SDK 请求/响应对象和 ACME 挑战对象,mock 云端调用,不修改真实 DNS 或申请证书。
兼容矩阵覆盖 Python 3.9–3.13 × Certbot 3、Python 3.9–3.15 × Certbot 4、Python 3.10–3.15 × Certbot 5;tox 从源码目录之外验证 wheel 和实际 Certbot CLI 插件发现。
GitHub Actions 执行相同检查,并在全新环境中仅以兼容包为安装目标,验证其自动安装核心依赖且 Certbot 只发现一个 dns-teo 插件。
两个包版本保持一致,兼容包的依赖固定为同版本核心包;升级时需同时修改根目录和 packages/certbot-dns-tencent-edgeone/pyproject.toml 中的版本及依赖,测试会检查一致性。
发布 v1.0.0 格式的正式 GitHub Release 后,经 CI 通过使用 PyPI Trusted Publishing 先发布核心包,再发布兼容包。两个 PyPI 项目均需配置此仓库的受信任发布者(release.yml 工作流、GitHub pypi environment)。预发布仅验证和构建。
参考实现:certbot-dns-tencent。 接口文档:站点列表、DNS 记录列表、创建记录、删除记录。
Metadata
Release files for certbot-dns-teo 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| certbot_dns_teo-1.0.0.tar.gz | 140.1 kB | With provenance | Details for certbot_dns_teo-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| certbot_dns_teo-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for certbot_dns_teo-1.0.0-py3-none-any.whl |
Total release size: 150.2 kB
Release files / certbot_dns_teo-1.0.0.tar.gz
| Download URL | certbot_dns_teo-1.0.0.tar.gz |
|---|---|
| Size | 140.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
806f521e60cf83091951070be4a5cf0da404836402f47893a527654f19af88cf
|
|
BLAKE2b-256 checksum How to use checksums |
0df3c6f22a54f3c3edb8209030da97bfcae31180f397b71c1f4eb9a3c4ec695f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logRelease files / certbot_dns_teo-1.0.0-py3-none-any.whl
| Download URL | certbot_dns_teo-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95a99b44ca866de7254f4d59324d629bb9751d88ffeb6a1a95a0548acc1196f2
|
|
BLAKE2b-256 checksum How to use checksums |
62e50cbefe0e4a5ceedfe46e5cc550f60d2883682435994816e5b989183710ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logSecurity for certbot-dns-teo 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for certbot_dns_teo-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.