certbot-dns-teo 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- certbot_dns_teo-1.0.0/.gitignore +265 -0
- certbot_dns_teo-1.0.0/CHANGELOG.md +13 -0
- certbot_dns_teo-1.0.0/LICENSE +22 -0
- certbot_dns_teo-1.0.0/PKG-INFO +145 -0
- certbot_dns_teo-1.0.0/README.md +112 -0
- certbot_dns_teo-1.0.0/certbot_dns_teo/__init__.py +5 -0
- certbot_dns_teo-1.0.0/certbot_dns_teo/compat.py +24 -0
- certbot_dns_teo-1.0.0/certbot_dns_teo/dns_teo.py +171 -0
- certbot_dns_teo-1.0.0/certbot_dns_teo/teo_client.py +129 -0
- certbot_dns_teo-1.0.0/packages/certbot-dns-tencent-edgeone/LICENSE +22 -0
- certbot_dns_teo-1.0.0/packages/certbot-dns-tencent-edgeone/README.md +35 -0
- certbot_dns_teo-1.0.0/packages/certbot-dns-tencent-edgeone/pyproject.toml +32 -0
- certbot_dns_teo-1.0.0/pyproject.toml +78 -0
- certbot_dns_teo-1.0.0/scripts/check_alias_installation.py +54 -0
- certbot_dns_teo-1.0.0/scripts/check_installation.py +70 -0
- certbot_dns_teo-1.0.0/tests/conftest.py +45 -0
- certbot_dns_teo-1.0.0/tests/test_authenticator.py +130 -0
- certbot_dns_teo-1.0.0/tests/test_config_and_routing.py +214 -0
- certbot_dns_teo-1.0.0/tests/test_packaging.py +22 -0
- certbot_dns_teo-1.0.0/tests/test_teo_client.py +267 -0
- certbot_dns_teo-1.0.0/tox.ini +33 -0
- certbot_dns_teo-1.0.0/uv.lock +2619 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
*.lcov
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
# Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# uv
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
# uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
# poetry.lock
|
|
110
|
+
# poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
# pdm.lock
|
|
117
|
+
# pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
# pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi/*
|
|
127
|
+
!.pixi/config.toml
|
|
128
|
+
|
|
129
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
130
|
+
__pypackages__/
|
|
131
|
+
|
|
132
|
+
# Celery stuff
|
|
133
|
+
celerybeat-schedule*
|
|
134
|
+
celerybeat.pid
|
|
135
|
+
|
|
136
|
+
# Redis
|
|
137
|
+
*.rdb
|
|
138
|
+
*.aof
|
|
139
|
+
*.pid
|
|
140
|
+
|
|
141
|
+
# RabbitMQ
|
|
142
|
+
mnesia/
|
|
143
|
+
rabbitmq/
|
|
144
|
+
rabbitmq-data/
|
|
145
|
+
|
|
146
|
+
# ActiveMQ
|
|
147
|
+
activemq-data/
|
|
148
|
+
|
|
149
|
+
# SageMath parsed files
|
|
150
|
+
*.sage.py
|
|
151
|
+
|
|
152
|
+
# Environments
|
|
153
|
+
.env
|
|
154
|
+
.envrc
|
|
155
|
+
.venv
|
|
156
|
+
env/
|
|
157
|
+
venv/
|
|
158
|
+
ENV/
|
|
159
|
+
env.bak/
|
|
160
|
+
venv.bak/
|
|
161
|
+
|
|
162
|
+
# Spyder project settings
|
|
163
|
+
.spyderproject
|
|
164
|
+
.spyproject
|
|
165
|
+
|
|
166
|
+
# Rope project settings
|
|
167
|
+
.ropeproject
|
|
168
|
+
|
|
169
|
+
# mkdocs/Zensical documentation
|
|
170
|
+
/site
|
|
171
|
+
|
|
172
|
+
# mypy
|
|
173
|
+
.mypy_cache/
|
|
174
|
+
.dmypy.json
|
|
175
|
+
dmypy.json
|
|
176
|
+
|
|
177
|
+
# Pyre type checker
|
|
178
|
+
.pyre/
|
|
179
|
+
|
|
180
|
+
# pytype static type analyzer
|
|
181
|
+
.pytype/
|
|
182
|
+
|
|
183
|
+
# Cython debug symbols
|
|
184
|
+
cython_debug/
|
|
185
|
+
|
|
186
|
+
# PyCharm
|
|
187
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
188
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
189
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
190
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
191
|
+
# .idea/
|
|
192
|
+
|
|
193
|
+
# Abstra
|
|
194
|
+
# Abstra is an AI-powered process automation framework.
|
|
195
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
196
|
+
# Learn more at https://abstra.io/docs
|
|
197
|
+
.abstra/
|
|
198
|
+
|
|
199
|
+
# Visual Studio Code
|
|
200
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
|
|
201
|
+
# can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
202
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer, you
|
|
203
|
+
# could uncomment the following to ignore the entire vscode folder
|
|
204
|
+
# .vscode/
|
|
205
|
+
# Temporary file for partial code execution
|
|
206
|
+
tempCodeRunnerFile.py
|
|
207
|
+
|
|
208
|
+
# Ruff stuff:
|
|
209
|
+
.ruff_cache/
|
|
210
|
+
|
|
211
|
+
# PyPI configuration file
|
|
212
|
+
.pypirc
|
|
213
|
+
|
|
214
|
+
# Marimo
|
|
215
|
+
marimo/_static/
|
|
216
|
+
marimo/_lsp/
|
|
217
|
+
__marimo__/
|
|
218
|
+
|
|
219
|
+
# Streamlit
|
|
220
|
+
.streamlit/secrets.toml
|
|
221
|
+
|
|
222
|
+
# Local AI assistant instructions, configuration, sessions, and artifacts
|
|
223
|
+
AGENTS.md
|
|
224
|
+
AGENTS.override.md
|
|
225
|
+
CLAUDE.md
|
|
226
|
+
CLAUDE.local.md
|
|
227
|
+
GEMINI.md
|
|
228
|
+
COPILOT.md
|
|
229
|
+
AI_CONTEXT.md
|
|
230
|
+
SKILL.md
|
|
231
|
+
.codex/
|
|
232
|
+
.claude/
|
|
233
|
+
.gemini/
|
|
234
|
+
.cursor/
|
|
235
|
+
.windsurf/
|
|
236
|
+
.cline/
|
|
237
|
+
.roo/
|
|
238
|
+
.trae/
|
|
239
|
+
.continue/
|
|
240
|
+
.opencode/
|
|
241
|
+
.agent/
|
|
242
|
+
.agents/
|
|
243
|
+
.ai/
|
|
244
|
+
.skills/
|
|
245
|
+
.zcode/
|
|
246
|
+
.specify/
|
|
247
|
+
.serena/
|
|
248
|
+
.kiro/
|
|
249
|
+
.junie/
|
|
250
|
+
.cursorrules
|
|
251
|
+
.cursorignore
|
|
252
|
+
.cursorindexingignore
|
|
253
|
+
.clinerules
|
|
254
|
+
.windsurfrules
|
|
255
|
+
.roorules
|
|
256
|
+
.aider*
|
|
257
|
+
.mcp.json
|
|
258
|
+
mcp.json
|
|
259
|
+
/ai/
|
|
260
|
+
/skills/
|
|
261
|
+
/.github/copilot-instructions.md
|
|
262
|
+
/.github/instructions/
|
|
263
|
+
/.github/prompts/
|
|
264
|
+
/.github/agents/
|
|
265
|
+
/.github/skills/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# 更新记录
|
|
2
|
+
|
|
3
|
+
## 1.0.0 — 2026-10-27
|
|
4
|
+
|
|
5
|
+
- 发布 `certbot-dns-teo` 与 `certbot-dns-tencent-edgeone` 1.0.0,兼容包精确依赖同版本核心包。
|
|
6
|
+
- 沿用 `dns-teo` 认证器、`dns_teo_` 凭证前缀和现有 DNS-01 验证行为。
|
|
7
|
+
|
|
8
|
+
## 0.1.0
|
|
9
|
+
|
|
10
|
+
- 实现腾讯云 EdgeOne (TEO) 的 Certbot DNS-01 插件 `dns-teo`。
|
|
11
|
+
- 支持 NS 站点发现、泛域名、多 TXT 值、已有记录保护和临时凭证。
|
|
12
|
+
- 提供 Certbot 3/4/5 兼容测试、wheel 检查与 CI/CD。
|
|
13
|
+
- 新增兼容发行包 `certbot-dns-tencent-edgeone`,依赖同版本 `certbot-dns-teo`,继续使用 `dns-teo` 插件及原有配置;支持双包构建、安装验证和按依赖顺序发布。
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 iDigimon
|
|
4
|
+
Copyright (c) 2025 TiyeeJiang (portions adapted from certbot-dns-tencent)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: certbot-dns-teo
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: 腾讯云 EdgeOne (TEO) 插件,用于 Certbot 的 DNS-01 验证
|
|
5
|
+
Project-URL: Homepage, https://github.com/iDigimon/teo
|
|
6
|
+
Project-URL: Repository, https://github.com/iDigimon/teo
|
|
7
|
+
Project-URL: Issues, https://github.com/iDigimon/teo/issues
|
|
8
|
+
Author-email: tiyee <tiyee@live.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: acme,certbot,dns-01,edgeone,tencent,teo
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Plugins
|
|
14
|
+
Classifier: Intended Audience :: System Administrators
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
24
|
+
Classifier: Topic :: Security
|
|
25
|
+
Requires-Python: >=3.9
|
|
26
|
+
Requires-Dist: acme<6,>=3
|
|
27
|
+
Requires-Dist: certbot<5,>=3; python_version < '3.10'
|
|
28
|
+
Requires-Dist: certbot<6,>=3; python_version >= '3.10' and python_version < '3.14'
|
|
29
|
+
Requires-Dist: certbot<6,>=4; python_version >= '3.14'
|
|
30
|
+
Requires-Dist: importlib-metadata<9,>=4.6; python_version < '3.10'
|
|
31
|
+
Requires-Dist: tencentcloud-sdk-python-teo<4,>=3.1.130
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# Certbot DNS EdgeOne (TEO) 插件
|
|
35
|
+
|
|
36
|
+
通过腾讯云 EdgeOne API 完成 Certbot DNS-01 验证,支持普通域名和泛域名。
|
|
37
|
+
|
|
38
|
+
站点必须已通过 **NS 模式接入 EdgeOne**,并完成权威 DNS 服务器切换。CNAME 接入、DNSPod 托管接入及 Pages 站点请使用实际权威 DNS 服务商的插件;本插件不会修改 DNSPod。
|
|
39
|
+
|
|
40
|
+
## 功能特性
|
|
41
|
+
|
|
42
|
+
- 使用官方腾讯云 TEO SDK(API 版本 `2022-09-01`)
|
|
43
|
+
- 自动分页查询站点,按 DNS 标签边界选择最长匹配的站点,支持 IDN
|
|
44
|
+
- 支持同名多个 TXT 验证值,仅删除本次创建的记录,保留已有记录
|
|
45
|
+
- 支持临时凭证,可指定站点 ID 解决同名站点歧义
|
|
46
|
+
- 支持 Certbot 3/4/5,Python 3.9–3.15
|
|
47
|
+
|
|
48
|
+
Python 3.9 使用 Certbot 3/4(Certbot 4.2 起要求 Python ≥3.9.2);Python 3.14–3.15 使用 Certbot 4/5。
|
|
49
|
+
Certbot 3 环境需额外安装 `pyopenssl<25`。
|
|
50
|
+
|
|
51
|
+
## 安装
|
|
52
|
+
|
|
53
|
+
在本仓库目录安装,插件和 Certbot 必须处于同一个 Python 环境:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python3 -m pip install .
|
|
57
|
+
# 或使用 uv 创建独立工具环境
|
|
58
|
+
uv tool install --with . 'certbot>=5,<6'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
也可安装兼容包 `certbot-dns-tencent-edgeone`,它依赖同版本的 `certbot-dns-teo`,共用实现和插件入口。在仓库根目录同时安装两个本地项目:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
python3 -m pip install . ./packages/certbot-dns-tencent-edgeone
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
两个包发布到 PyPI 后,也可用 `python3 -m pip install certbot-dns-tencent-edgeone` 安装。
|
|
68
|
+
使用任一包时,认证器均为 `dns-teo`,命令行参数和凭证前缀均保持 `dns-teo-` / `dns_teo_`。
|
|
69
|
+
|
|
70
|
+
## 配置文件
|
|
71
|
+
|
|
72
|
+
保存为 `~/teo.ini`:
|
|
73
|
+
|
|
74
|
+
```ini
|
|
75
|
+
dns_teo_secret_id = YOUR_SECRET_ID
|
|
76
|
+
dns_teo_secret_key = YOUR_SECRET_KEY
|
|
77
|
+
# 使用临时凭证时填写
|
|
78
|
+
# dns_teo_token = YOUR_SESSION_TOKEN
|
|
79
|
+
# 可选:仅允许操作指定的 NS 站点,同名站点有歧义时必须指定
|
|
80
|
+
# dns_teo_zone_id = zone-xxxxxxxxxxxx
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
chmod 600 ~/teo.ini
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 运行
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
certbot certonly \
|
|
91
|
+
--authenticator dns-teo \
|
|
92
|
+
--dns-teo-credentials ~/teo.ini \
|
|
93
|
+
--dns-teo-propagation-seconds 30 \
|
|
94
|
+
-d example.com \
|
|
95
|
+
-d '*.example.com'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
TXT TTL 默认 600 秒,可用 `--dns-teo-ttl` 设置为 60–86400 秒。
|
|
99
|
+
传播等待默认 30 秒,由 Certbot 在所有挑战记录创建后统一执行;如 DNS 尚未生效,可增加 `--dns-teo-propagation-seconds`。
|
|
100
|
+
成功签发后可用 `certbot renew` 续期,Certbot 会保存认证器和凭证路径。
|
|
101
|
+
|
|
102
|
+
## 腾讯云权限配置
|
|
103
|
+
|
|
104
|
+
SecretId / SecretKey 所属账号需要以下操作权限(CAM 自定义策略):
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"version": "2.0",
|
|
109
|
+
"statement": [{
|
|
110
|
+
"effect": "allow",
|
|
111
|
+
"action": [
|
|
112
|
+
"teo:DescribeZones",
|
|
113
|
+
"teo:DescribeDnsRecords",
|
|
114
|
+
"teo:CreateDnsRecord",
|
|
115
|
+
"teo:DeleteDnsRecords"
|
|
116
|
+
],
|
|
117
|
+
"resource": ["*"]
|
|
118
|
+
}]
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
使用公共端点 `teo.tencentcloudapi.com`,不需要配置 Region。
|
|
123
|
+
指定 `dns_teo_zone_id` 后仍需 `DescribeZones` 权限,以校验域名范围和 NS 接入状态。
|
|
124
|
+
|
|
125
|
+
## 开发与验证
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
uv sync --locked --all-packages --python 3.13
|
|
129
|
+
uv run --no-sync ruff check .
|
|
130
|
+
uv run --no-sync ruff format --check .
|
|
131
|
+
uv run --no-sync pytest --cov=certbot_dns_teo --cov-report=term-missing
|
|
132
|
+
uv run --no-sync tox run-parallel -p 4
|
|
133
|
+
uv build --all-packages --out-dir dist --clear
|
|
134
|
+
uv run --no-sync twine check --strict dist/*
|
|
135
|
+
uv run --no-sync python scripts/check_alias_installation.py
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
测试使用真实 SDK 请求/响应对象和 ACME 挑战对象,mock 云端调用,不修改真实 DNS 或申请证书。
|
|
139
|
+
兼容矩阵覆盖 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 插件发现。
|
|
140
|
+
GitHub Actions 执行相同检查,并在全新环境中仅以兼容包为安装目标,验证其自动安装核心依赖且 Certbot 只发现一个 `dns-teo` 插件。
|
|
141
|
+
两个包版本保持一致,兼容包的依赖固定为同版本核心包;升级时需同时修改根目录和 `packages/certbot-dns-tencent-edgeone/pyproject.toml` 中的版本及依赖,测试会检查一致性。
|
|
142
|
+
发布 `v1.0.0` 格式的正式 GitHub Release 后,经 CI 通过使用 PyPI Trusted Publishing 先发布核心包,再发布兼容包。两个 PyPI 项目均需配置此仓库的受信任发布者(`release.yml` 工作流、GitHub `pypi` environment)。预发布仅验证和构建。
|
|
143
|
+
|
|
144
|
+
参考实现:[certbot-dns-tencent](https://github.com/iDigimon/certbot-dns-tencent)。
|
|
145
|
+
接口文档:[站点列表](https://cloud.tencent.com/document/api/1552/80713)、[DNS 记录列表](https://cloud.tencent.com/document/api/1552/80716)、[创建记录](https://cloud.tencent.com/document/api/1552/80720)、[删除记录](https://cloud.tencent.com/document/api/1552/80718)。
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Certbot DNS EdgeOne (TEO) 插件
|
|
2
|
+
|
|
3
|
+
通过腾讯云 EdgeOne API 完成 Certbot DNS-01 验证,支持普通域名和泛域名。
|
|
4
|
+
|
|
5
|
+
站点必须已通过 **NS 模式接入 EdgeOne**,并完成权威 DNS 服务器切换。CNAME 接入、DNSPod 托管接入及 Pages 站点请使用实际权威 DNS 服务商的插件;本插件不会修改 DNSPod。
|
|
6
|
+
|
|
7
|
+
## 功能特性
|
|
8
|
+
|
|
9
|
+
- 使用官方腾讯云 TEO SDK(API 版本 `2022-09-01`)
|
|
10
|
+
- 自动分页查询站点,按 DNS 标签边界选择最长匹配的站点,支持 IDN
|
|
11
|
+
- 支持同名多个 TXT 验证值,仅删除本次创建的记录,保留已有记录
|
|
12
|
+
- 支持临时凭证,可指定站点 ID 解决同名站点歧义
|
|
13
|
+
- 支持 Certbot 3/4/5,Python 3.9–3.15
|
|
14
|
+
|
|
15
|
+
Python 3.9 使用 Certbot 3/4(Certbot 4.2 起要求 Python ≥3.9.2);Python 3.14–3.15 使用 Certbot 4/5。
|
|
16
|
+
Certbot 3 环境需额外安装 `pyopenssl<25`。
|
|
17
|
+
|
|
18
|
+
## 安装
|
|
19
|
+
|
|
20
|
+
在本仓库目录安装,插件和 Certbot 必须处于同一个 Python 环境:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
python3 -m pip install .
|
|
24
|
+
# 或使用 uv 创建独立工具环境
|
|
25
|
+
uv tool install --with . 'certbot>=5,<6'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
也可安装兼容包 `certbot-dns-tencent-edgeone`,它依赖同版本的 `certbot-dns-teo`,共用实现和插件入口。在仓库根目录同时安装两个本地项目:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
python3 -m pip install . ./packages/certbot-dns-tencent-edgeone
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
两个包发布到 PyPI 后,也可用 `python3 -m pip install certbot-dns-tencent-edgeone` 安装。
|
|
35
|
+
使用任一包时,认证器均为 `dns-teo`,命令行参数和凭证前缀均保持 `dns-teo-` / `dns_teo_`。
|
|
36
|
+
|
|
37
|
+
## 配置文件
|
|
38
|
+
|
|
39
|
+
保存为 `~/teo.ini`:
|
|
40
|
+
|
|
41
|
+
```ini
|
|
42
|
+
dns_teo_secret_id = YOUR_SECRET_ID
|
|
43
|
+
dns_teo_secret_key = YOUR_SECRET_KEY
|
|
44
|
+
# 使用临时凭证时填写
|
|
45
|
+
# dns_teo_token = YOUR_SESSION_TOKEN
|
|
46
|
+
# 可选:仅允许操作指定的 NS 站点,同名站点有歧义时必须指定
|
|
47
|
+
# dns_teo_zone_id = zone-xxxxxxxxxxxx
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
chmod 600 ~/teo.ini
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 运行
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
certbot certonly \
|
|
58
|
+
--authenticator dns-teo \
|
|
59
|
+
--dns-teo-credentials ~/teo.ini \
|
|
60
|
+
--dns-teo-propagation-seconds 30 \
|
|
61
|
+
-d example.com \
|
|
62
|
+
-d '*.example.com'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
TXT TTL 默认 600 秒,可用 `--dns-teo-ttl` 设置为 60–86400 秒。
|
|
66
|
+
传播等待默认 30 秒,由 Certbot 在所有挑战记录创建后统一执行;如 DNS 尚未生效,可增加 `--dns-teo-propagation-seconds`。
|
|
67
|
+
成功签发后可用 `certbot renew` 续期,Certbot 会保存认证器和凭证路径。
|
|
68
|
+
|
|
69
|
+
## 腾讯云权限配置
|
|
70
|
+
|
|
71
|
+
SecretId / SecretKey 所属账号需要以下操作权限(CAM 自定义策略):
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"version": "2.0",
|
|
76
|
+
"statement": [{
|
|
77
|
+
"effect": "allow",
|
|
78
|
+
"action": [
|
|
79
|
+
"teo:DescribeZones",
|
|
80
|
+
"teo:DescribeDnsRecords",
|
|
81
|
+
"teo:CreateDnsRecord",
|
|
82
|
+
"teo:DeleteDnsRecords"
|
|
83
|
+
],
|
|
84
|
+
"resource": ["*"]
|
|
85
|
+
}]
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
使用公共端点 `teo.tencentcloudapi.com`,不需要配置 Region。
|
|
90
|
+
指定 `dns_teo_zone_id` 后仍需 `DescribeZones` 权限,以校验域名范围和 NS 接入状态。
|
|
91
|
+
|
|
92
|
+
## 开发与验证
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
uv sync --locked --all-packages --python 3.13
|
|
96
|
+
uv run --no-sync ruff check .
|
|
97
|
+
uv run --no-sync ruff format --check .
|
|
98
|
+
uv run --no-sync pytest --cov=certbot_dns_teo --cov-report=term-missing
|
|
99
|
+
uv run --no-sync tox run-parallel -p 4
|
|
100
|
+
uv build --all-packages --out-dir dist --clear
|
|
101
|
+
uv run --no-sync twine check --strict dist/*
|
|
102
|
+
uv run --no-sync python scripts/check_alias_installation.py
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
测试使用真实 SDK 请求/响应对象和 ACME 挑战对象,mock 云端调用,不修改真实 DNS 或申请证书。
|
|
106
|
+
兼容矩阵覆盖 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 插件发现。
|
|
107
|
+
GitHub Actions 执行相同检查,并在全新环境中仅以兼容包为安装目标,验证其自动安装核心依赖且 Certbot 只发现一个 `dns-teo` 插件。
|
|
108
|
+
两个包版本保持一致,兼容包的依赖固定为同版本核心包;升级时需同时修改根目录和 `packages/certbot-dns-tencent-edgeone/pyproject.toml` 中的版本及依赖,测试会检查一致性。
|
|
109
|
+
发布 `v1.0.0` 格式的正式 GitHub Release 后,经 CI 通过使用 PyPI Trusted Publishing 先发布核心包,再发布兼容包。两个 PyPI 项目均需配置此仓库的受信任发布者(`release.yml` 工作流、GitHub `pypi` environment)。预发布仅验证和构建。
|
|
110
|
+
|
|
111
|
+
参考实现:[certbot-dns-tencent](https://github.com/iDigimon/certbot-dns-tencent)。
|
|
112
|
+
接口文档:[站点列表](https://cloud.tencent.com/document/api/1552/80713)、[DNS 记录列表](https://cloud.tencent.com/document/api/1552/80716)、[创建记录](https://cloud.tencent.com/document/api/1552/80720)、[删除记录](https://cloud.tencent.com/document/api/1552/80718)。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Keep host compatibility in one place, using Certbot's public APIs.
|
|
2
|
+
|
|
3
|
+
DNSAuthenticator already handles the annotated-challenge API changes between
|
|
4
|
+
Certbot 3, 4 and 5. Inherit its public lifecycle instead of copying it or applying
|
|
5
|
+
the obsolete zope.interface decorators (removed from Certbot's dependencies).
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import sys
|
|
9
|
+
|
|
10
|
+
from certbot.plugins.dns_common import DNSAuthenticator
|
|
11
|
+
|
|
12
|
+
if sys.version_info < (3, 10):
|
|
13
|
+
# Python 3.9's stdlib entry_points() does not support the group keyword.
|
|
14
|
+
import importlib_metadata as metadata
|
|
15
|
+
else:
|
|
16
|
+
from importlib import metadata
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def certbot_major_version() -> int:
|
|
20
|
+
"""Return the actual installed host version, not a resolver assumption."""
|
|
21
|
+
return int(metadata.version("certbot").split(".", 1)[0])
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
__all__ = ["DNSAuthenticator", "certbot_major_version", "metadata"]
|