Update for modern Python compatibility

This commit is contained in:
2025-11-20 02:47:11 +01:00
parent 06924213d2
commit edc55a5b0d
13 changed files with 1422 additions and 348 deletions

View File

@@ -1,124 +1,159 @@
Metadata-Version: 2.1
Metadata-Version: 2.4
Name: certbot-dns-corenetworks
Version: 0.2.0
Version: 1.0.0
Summary: Core Networks DNS Authenticator plugin for Certbot
Home-page: https://github.com/MasinAD/certbot-dns-corenetworks
Author: Masin Al-Dujaili
Author-email: masin.aldujaili@googlemail.com
Author-email: Hendrik Hogertz <info@hogertz.eu>
License: Apache License 2.0
Description: certbot-dns-corenetworks
=====================
Core_Networks_ DNS Authenticator plugin for Certbot
This plugin automates the process of completing a ``dns-01`` challenge by
creating, and subsequently removing, TXT records using the Core Networks beta API.
Configuration of Core Networks
---------------------------
In the `Allgemein -> Profil -> API-Benutzer` you have to have a user with a login name and password
.. _Core_Networks: https://beta.api.core-networks.de/doc/
.. _certbot: https://certbot.eff.org/
Installation
------------
::
pip install certbot-dns-corenetworks
Named Arguments
---------------
To start using DNS authentication for Core Networks, pass the following arguments on
certbot's command line:
============================================================= ==============================================
``--authenticator certbot-dns-corenetworks:dns-corenetworks`` select the authenticator plugin (Required)
``--certbot-dns-corenetworks:dns-corenetworks-credentials`` Core Networks Remote User credentials
INI file. (Required)
``--certbot-dns-corenetworks:dns-corenetworks-propagation-seconds`` | waiting time for DNS to propagate before asking
| the ACME server to verify the DNS record.
| (Default: 10, Recommended: >= 600)
============================================================= ==============================================
(Note that the verbose and seemingly redundant ``certbot-dns-corenetworks:``
prefix is currently imposed by certbot for external plugins.)
Credentials
-----------
An example ``credentials.ini`` file:
.. code-block:: ini
certbot_dns_corenetworks:dns_corenetworks_username = myremoteuser
certbot_dns_corenetworks:dns_corenetworks_password = verysecureremoteuserpassword
The path to this file can be provided interactively or using the
``--certbot-dns-corenetworks:dns-corenetworks-credentials`` command-line argument. Certbot
records the path to this file for use during renewal, but does not store the
file's contents.
**CAUTION:** You should protect these API credentials as you would the
password to your Core Networks account. Users who can read this file can use these
credentials to issue arbitrary API calls on your behalf. Users who can cause
Certbot to run using these credentials can complete a ``dns-01`` challenge to
acquire new certificates or revoke existing certificates for associated
domains, even if those domains aren't being managed by this server.
Certbot will emit a warning if it detects that the credentials file can be
accessed by other users on your system. The warning reads "Unsafe permissions
on credentials configuration file", followed by the path to the credentials
file. This warning will be emitted each time Certbot uses the credentials file,
including for renewal, and cannot be silenced except by addressing the issue
(e.g., by using a command like ``chmod 600`` to restrict access to the file).
Examples
--------
To acquire a single certificate for both ``example.com`` and
``*.example.com``, waiting 900 seconds for DNS propagation:
.. code-block:: bash
certbot certonly \
--authenticator certbot-dns-corenetworks:dns-corenetworks \
--certbot-dns-corenetworks:dns-corenetworks-credentials /etc/letsencrypt/.secrets/domain.tld.ini \
--certbot-dns-corenetworks:dns-corenetworks-propagation-seconds 900 \
--server https://acme-v02.api.letsencrypt.org/directory \
--agree-tos \
--rsa-key-size 4096 \
-d 'example.com' \
-d '*.example.com'
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Project-URL: Homepage, https://git.hogertz.eu/hendrik-hog/certbot-dns-corenetworks
Project-URL: Repository, https://git.hogertz.eu/hendrik-hog/certbot-dns-corenetworks
Keywords: certbot,dns,corenetworks,letsencrypt
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Plugins
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
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: 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: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
Description-Content-Type: text/x-rst
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: certbot>=2.0.0
Requires-Dist: acme>=2.0.0
Requires-Dist: requests>=2.20.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Dynamic: license-file
# certbot-dns-corenetworks
Core Networks DNS Authenticator plugin for Certbot
This plugin automates the process of completing a `dns-01` challenge by creating, and subsequently removing, TXT records using the Core Networks beta API.
## Requirements
- Python >= 3.10
- certbot >= 2.0.0
## Configuration of Core Networks
In the `Allgemein -> Profil -> API-Benutzer` you have to have a user with a login name and password.
See [Core Networks API Documentation](https://beta.api.core-networks.de/doc/) for more information.
## Installation
### Using pip
```bash
pip install certbot-dns-corenetworks
```
### From source
```bash
git clone https://git.hogertz.eu/hendrik-hog/certbot-dns-corenetworks.git
cd certbot-dns-corenetworks
uv sync
```
## Named Arguments
To start using DNS authentication for Core Networks, pass the following arguments on certbot's command line:
| Argument | Description |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `--authenticator dns-corenetworks` | Select the authenticator plugin (Required) |
| `--dns-corenetworks-credentials` | Core Networks credentials INI file (Required) |
| `--dns-corenetworks-propagation-seconds` | Waiting time for DNS to propagate before asking the ACME server to verify the DNS record (Default: 30, Recommended: >= 60) |
## Credentials
An example `credentials.ini` file:
```ini
dns_corenetworks_login = myremoteuser
dns_corenetworks_password = verysecureremoteuserpassword
```
The path to this file can be provided interactively or using the `--dns-corenetworks-credentials` command-line argument. Certbot records the path to this file for use during renewal, but does not store the file's contents.
**CAUTION:** You should protect these API credentials as you would the password to your Core Networks account. Users who can read this file can use these credentials to issue arbitrary API calls on your behalf. Users who can cause Certbot to run using these credentials can complete a `dns-01` challenge to acquire new certificates or revoke existing certificates for associated domains, even if those domains aren't being managed by this server.
Certbot will emit a warning if it detects that the credentials file can be accessed by other users on your system. The warning reads "Unsafe permissions on credentials configuration file", followed by the path to the credentials file. This warning will be emitted each time Certbot uses the credentials file, including for renewal, and cannot be silenced except by addressing the issue (e.g., by using a command like `chmod 600` to restrict access to the file).
## Examples
### Acquire a certificate for a domain
To acquire a single certificate for `example.com`:
```bash
certbot certonly \
--authenticator dns-corenetworks \
--dns-corenetworks-credentials /etc/letsencrypt/.secrets/corenetworks.ini \
--dns-corenetworks-propagation-seconds 60 \
--server https://acme-v02.api.letsencrypt.org/directory \
--agree-tos \
--rsa-key-size 4096 \
-d example.com
```
### Acquire a wildcard certificate
To acquire a certificate for both `example.com` and `*.example.com`, waiting 60 seconds for DNS propagation:
```bash
certbot certonly \
--authenticator dns-corenetworks \
--dns-corenetworks-credentials /etc/letsencrypt/.secrets/corenetworks.ini \
--dns-corenetworks-propagation-seconds 60 \
--server https://acme-v02.api.letsencrypt.org/directory \
--agree-tos \
--rsa-key-size 4096 \
-d 'example.com' \
-d '*.example.com'
```
## Development
### Setup development environment
```bash
# Clone the repository
git clone https://git.hogertz.eu/hendrik-hog/certbot-dns-corenetworks.git
cd certbot-dns-corenetworks
# Install in development mode with dev dependencies
uv pip install -e ".[dev]"
```
### Running tests
```bash
# Run tests with pytest
pytest
# Run tests with coverage
pytest --cov=certbot_dns_corenetworks --cov-report=html
```
## License
Apache License 2.0 - See LICENSE.txt for details
## Credits
Original author: Masin Al-Dujaili
Maintainer: Hendrik Hogertz

View File

@@ -1,4 +1,6 @@
README.rst
LICENSE.txt
README.md
pyproject.toml
setup.cfg
setup.py
certbot_dns_corenetworks/__init__.py

View File

@@ -1,3 +1,2 @@
[certbot.plugins]
dns-corenetworks = certbot_dns_corenetworks.dns_corenetworks:Authenticator

View File

@@ -1,7 +1,7 @@
acme>=0.29.0
certbot>=0.34.0
setuptools
requests
mock
requests-mock
dns-lexicon
certbot>=2.0.0
acme>=2.0.0
requests>=2.20.0
[dev]
pytest>=7.0.0
pytest-cov>=4.0.0