Metadata-Version: 2.4
Name: certbot-dns-baidu-bcd
Version: 2.0.0
Summary: Baidu Cloud DNS (BCD) authenticator plugin for Certbot
Author: certbot-dns-baidu-bcd contributors
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/NginxProxyManager/nginx-proxy-manager
Project-URL: Source, https://github.com/NginxProxyManager/nginx-proxy-manager
Keywords: certbot,letsencrypt,acme,dns,baidu,bcd,bce
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Plugins
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: certbot
Requires-Dist: requests
Requires-Dist: zope.interface
Dynamic: license-file

# certbot-dns-baidu-bcd

Certbot 的百度智能云 DNS（BCD，`bcd.baidubce.com`）DNS-01 认证插件。

PyPI 上的 `certbot-dns-baidu` 0.1.1 自 2021 年起停更，调用的是已废弃的百度云加速
（`api.su.baidu.com/v3/yjs/...`）接口，在 Nginx Proxy Manager 里已经不可用。本包是
它的替代实现：改用百度智能云 BCD 接口 + `bce-auth-v1` 签名。

## 安装

```bash
pip install certbot-dns-baidu-bcd
```

## 使用

凭据文件：

```ini
dns_baidu_access_key = <AccessKeyId>
dns_baidu_secret_key = <SecretAccessKey>
```

```bash
certbot certonly \
  --authenticator dns-baidu \
  --dns-baidu-credentials /etc/letsencrypt/baidu.ini \
  -d example.com
```

## 与 Nginx Proxy Manager 集成

插件注册名是 `dns-baidu`（与旧包一致），所以 NPM 的 `--dns-baidu-credentials`、
凭据键 `dns_baidu_access_key` / `dns_baidu_secret_key`、以及已有证书 renewal conf
里的 `dns_baidu_credentials` 全部不用改。只需把 `backend/certbot/dns-plugins.json`
里 baidu 一项的 `package_name` 指向本包：

```json
"package_name": "certbot-dns-baidu-bcd",
"version": "~=2.0.0"
```

NPM 随后会在签发/续期前自动 `pip install` 它，与其它 87 个 provider 完全一致。

## 端点与签名

| 用途 | 请求 |
|---|---|
| 探测主域名 | `GET /v1/domain/detail?domain=<zone>` |
| 列记录 | `POST /v1/domain/resolve/list` |
| 增 TXT | `POST /v1/domain/resolve/add` |
| 删 TXT | `POST /v1/domain/resolve/delete` |

签名 `bce-auth-v1`：`signingKey = hex_hmac_sha256(SK, "bce-auth-v1/AK/ts/1800")`，
`signature = hex_hmac_sha256(signingKey, canonicalRequest)`，签名头
`content-type;host;x-bce-date`。

## License

GPL-3.0-or-later，衍生自 `github.com/chaoers/certbot-dns-baidu`（原作者 Asterisk）。
