Metadata-Version: 2.4
Name: certbot-dns-nicmanager
Version: 1.1.3
Summary: Certbot DNS-01 plugin for nicmanager AnycastDNS: wildcard Let's Encrypt certificates, 2FA (TOTP) support
Author: jp1337
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/jp1337/certbot-dns-nicmanager
Project-URL: Repository, https://github.com/jp1337/certbot-dns-nicmanager
Project-URL: Issues, https://github.com/jp1337/certbot-dns-nicmanager/issues
Project-URL: Changelog, https://github.com/jp1337/certbot-dns-nicmanager/blob/main/CHANGELOG.md
Project-URL: Documentation, https://github.com/jp1337/certbot-dns-nicmanager/blob/main/docs/README.md
Project-URL: Security, https://github.com/jp1337/certbot-dns-nicmanager/security/policy
Keywords: certbot,certbot-plugin,letsencrypt,acme,dns-01,wildcard,nicmanager,anycastdns,internexum,dns,ssl,tls,certbot-dns
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Plugins
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Internet :: Name Service (DNS)
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Security
Classifier: Topic :: System :: Installation/Setup
Classifier: Topic :: System :: Networking
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
License-File: NOTICE
Requires-Dist: certbot>=2.0.0
Requires-Dist: requests>=2.32.0
Requires-Dist: pyotp>=2.12.1
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: requests-mock; extra == "test"
Requires-Dist: setuptools>=77; extra == "test"
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: types-requests; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Dynamic: license-file

<!-- markdownlint-disable MD033 MD041 -->
<!-- Every link and image is absolute: PyPI renders this file too, and it cannot
     resolve a path relative to the repository. -->
<p align="center">
  <img src="https://raw.githubusercontent.com/jp1337/certbot-dns-nicmanager/main/.github/icon.svg" alt="" width="88" height="88">
</p>

<h1 align="center">certbot-dns-nicmanager</h1>

<p align="center"><em>Wildcard certificates for nicmanager domains. Issued and renewed without you.</em></p>

<!-- One badge service, so the set shares a shape, a typeface and a logo
     treatment. Every badge reads from the workflows, PyPI or the repository,
     so none of them can drift the way a hand-written version number could. -->
<!-- markdownlint-disable MD013 -->
<p align="center">
  <a href="https://github.com/jp1337/certbot-dns-nicmanager/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/jp1337/certbot-dns-nicmanager/ci.yml?branch=main&label=tests&logo=github&logoColor=white" alt="Tests"></a>
  <a href="https://github.com/jp1337/certbot-dns-nicmanager/actions/workflows/publish.yml"><img src="https://img.shields.io/github/actions/workflow/status/jp1337/certbot-dns-nicmanager/publish.yml?label=publish&logo=pypi&logoColor=white" alt="Publish"></a>
  <a href="https://pypi.org/project/certbot-dns-nicmanager/"><img src="https://img.shields.io/pypi/v/certbot-dns-nicmanager?logo=pypi&logoColor=white&label=pypi" alt="PyPI version"></a>
  <a href="https://pypistats.org/packages/certbot-dns-nicmanager"><img src="https://img.shields.io/pypi/dm/certbot-dns-nicmanager?logo=pypi&logoColor=white&label=downloads" alt="Downloads per month"></a>
</p>

<p align="center">
  <a href="https://github.com/jp1337/certbot-dns-nicmanager/releases/latest"><img src="https://img.shields.io/github/v/release/jp1337/certbot-dns-nicmanager?logo=github&logoColor=white&label=release" alt="Latest release"></a>
  <a href="https://pypi.org/project/certbot-dns-nicmanager/"><img src="https://img.shields.io/pypi/pyversions/certbot-dns-nicmanager?logo=python&logoColor=white&label=python" alt="Python versions"></a>
  <a href="https://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/github/license/jp1337/certbot-dns-nicmanager?logo=opensourceinitiative&logoColor=white&label=license&color=blue" alt="Apache-2.0"></a>
  <a href="https://ko-fi.com/jp1337"><img src="https://img.shields.io/badge/ko--fi-support-13C3FF?logo=kofi&logoColor=white" alt="Support on Ko-fi"></a>
</p>

<p align="center">
  <a href="https://pypi.org/project/certbot-dns-nicmanager/"><strong>PyPI</strong></a> ·
  <a href="https://github.com/jp1337/certbot-dns-nicmanager/blob/main/docs/TROUBLESHOOTING.md"><strong>Troubleshooting</strong></a> ·
  <a href="https://github.com/jp1337/certbot-dns-nicmanager/blob/main/CHANGELOG.md">Changelog</a>
</p>
<!-- markdownlint-enable MD013 -->

A [Certbot](https://certbot.eff.org/) plugin for
[nicmanager](https://www.nicmanager.com/) **AnycastDNS**. It answers the `dns-01`
challenge through the [nicmanager API](https://api.nicmanager.com/docs/v1/):
**`*.example.com` certificates, with an account that can touch nothing but the
challenge record.**

> 🇩🇪 Let's-Encrypt-Wildcard-Zertifikate für Domains bei nicmanager (InterNexum):
> Certbot-Plugin für die AnycastDNS-API, mit eingeschränktem API-ACME-Account und
> Zwei-Faktor-Authentifizierung.

## Quick start

```bash
pip install certbot-dns-nicmanager      # into the same environment as Certbot
certbot certonly --authenticator dns-nicmanager \
  --dns-nicmanager-credentials ~/.secrets/certbot/nicmanager.ini \
  -d 'example.com' -d '*.example.com'
```

`certbot plugins` should list `dns-nicmanager`. There is no `snap` package: if your
Certbot came from `snap`, run Certbot from a `pip` environment with both packages.

## ✨ Features

- **Wildcard certificates** — `dns-01` is the only ACME challenge that issues them,
  and it needs no inbound port
- **Least privilege** — works with nicmanager's restricted API-ACME account; it does
  not even need to read the zone
- **Two-factor authentication** — a fresh TOTP code with every request
- **Cleanup by id** — the challenge record is deleted by the id the API returned; if
  that fails, zone and id are logged for manual removal
- **The only nicmanager plugin that needs no zone read access** — see
  [compared to lego](https://github.com/jp1337/certbot-dns-nicmanager#compared-to-lego)
- **Fewer hostnames in public logs** — one wildcard instead of a certificate per
  host keeps service names out of
  [Certificate Transparency](https://certificate.transparency.dev/)
- **Small and tested** — three runtime dependencies, typed, ~95 % test coverage,
  Python 3.10 to 3.15, in production since June 2026

## Credentials

1. In nicmanager, create an **API-ACME account** (rights: Nameserver view + manage,
   nothing else) and make sure API access is enabled for it.
2. Write `/etc/letsencrypt/nicmanager.ini` and `chmod 600` it:

```ini
# login.username — or the email, if the account logs in with "E-Mail + Passwort"
dns_nicmanager_username = mylogin.acmeuser
# Quote the password if it contains '#' (the plugin stops otherwise).
dns_nicmanager_password = "0123456789abcdef0123456789abcdef"
# Only if the account has 2FA:
# dns_nicmanager_totp_secret = JBSWY3DPEHPK3PXP
```

Details: [account setup](https://github.com/jp1337/certbot-dns-nicmanager/blob/main/docs/ACCOUNT.md) ·
[all options, renewal](https://github.com/jp1337/certbot-dns-nicmanager/blob/main/docs/CONFIGURATION.md) ·
[troubleshooting](https://github.com/jp1337/certbot-dns-nicmanager/blob/main/docs/TROUBLESHOOTING.md)

## How it works

<img src="https://raw.githubusercontent.com/jp1337/certbot-dns-nicmanager/main/docs/assets/challenge-flow.drawio.svg" alt="Sequence: Certbot asks the plugin to create _acme-challenge.www.example.com. The plugin posts the record to the candidate zone www.example.com (404), then to example.com (202 with the record id). After the propagation wait Let's Encrypt queries the TXT record. On cleanup the plugin deletes the record by its id." width="100%">

The zone is found by **trying the create**, most specific candidate first — the
API-ACME account cannot read zones. Cleanup deletes by the id the API returned.

## Compared to lego

[lego](https://go-acme.github.io/lego/dns/nicmanager/) (also inside
[certbot-dns-multi](https://github.com/alexzorin/certbot-dns-multi) and Traefik)
supports the same API and 2FA. The difference is the account it needs:

| | certbot-dns-nicmanager | lego `nicmanager` |
| --- | --- | --- |
| Reads the zone before writing | no | yes (`GET /anycast/{zone}`) |
| Works with the restricted API-ACME account | yes | no: that account cannot read zones |
| Cleanup | by the id the API returned | looks the record up by name and value |

The lego column is read from its
[source](https://github.com/go-acme/lego/blob/master/providers/dns/nicmanager/nicmanager.go),
not tested against a live API-ACME account.

## Troubleshooting

| Response | Fix |
| --- | --- |
| `401 Authentication error` | Wrong username form: **email** for "E-Mail + Passwort" accounts, `login.username` otherwise |
| `401 Missing 2FA token header` | Set `dns_nicmanager_totp_secret` |
| `403 API usage not allowed` | Ask nicmanager support to enable API access |
| `401 Too many invalid attempts`, or no response | IP blocked after failed logins: **stop and wait**, never loop over credential variants |

Everything else: [docs/TROUBLESHOOTING.md](https://github.com/jp1337/certbot-dns-nicmanager/blob/main/docs/TROUBLESHOOTING.md).

## Contributing

Issues and pull requests are welcome; see
[CONTRIBUTING.md](https://github.com/jp1337/certbot-dns-nicmanager/blob/main/CONTRIBUTING.md).
Security issues go through
[private vulnerability reporting](https://github.com/jp1337/certbot-dns-nicmanager/security/advisories/new).
The design and its decisions are in
[docs-tech/](https://github.com/jp1337/certbot-dns-nicmanager/tree/main/docs-tech).

```bash
pip install -e '.[test,dev]' && pytest && ruff check . && mypy certbot_dns_nicmanager
```

## License

[Apache License 2.0](https://github.com/jp1337/certbot-dns-nicmanager/blob/main/LICENSE.txt).
An independent plugin, not affiliated with or endorsed by InterNexum GmbH /
nicmanager or the EFF / Certbot project.
