Developer guide¶
Thanks a lot for your involvement. You will find here some tips to quickly setup a suitable development environment,and useful tools to ensure code quality in the project.
General design principles¶
DNSroboCert is coded entirely in Python, and uses features available starting with Python 3.6+.
It sits on top ofCertbot andLexicon. Here are the repartition of the roles:
Certbot takes care of the actual certificate issuances and renewals against the ACME CA server, in a compliantand secured processing that respects theRFC-8555 protocol,
Lexicon provides the central interface to communicate with the DNS API providers, and inserts the required TXTentries for the DNS-01 challenges,
DNSroboCert
holds and validates the central configuration for users,
couplesCertbot andLexicon through the auth/cleanup hook system ofCertbot’s manual plugin,to issue/renew DNS-01 challenged based certificates,
orchestrates the post-deploy processing (
autocmd,autorestart, files rights…),executes a a cron job to trigger regularly theCertbot renewal process.
Setting up a development environment¶
DNSroboCert usesUV to manage the development environment & dependencies, build the project, and push wheel/sdist to PyPI.
First, installUV, following this guide:UV installation.
Now UV should be available in your command line. Check that the following command is displaying UV version:
uv --versionFork the upstreamGitHub project and clone your fork locally:
git clone https://github.com/myfork/dnsrobocert.gitNote
Setup the virtual environment for DNSroboCert using UV:
cd dnsrobocertuv sync
Activate the virtual environment:
For Linux/Mac OS X:
source .venv/bin/activateFor Windows (using Powershell):
.\.venv\Scripts\activateAt this point, you are ready to develop on the project. You can run the CLI that will use the local source code:
dnsrobocert --helpCode quality¶
The project DNSroboCert tries to follows the up-to-date recommended guideline in Python development:
DNSroboCert logic is tested with a pyramidal approach (unit tests + integration tests) usingPytest.
The code is formatted usingBlack andIsort to keep as possible unified and standardized writing conventions.
The code is linted withFlake8 and statically checked usingMyPy.
Please ensure that your code is compliant with this guideline before submitting a PR:
Ensure that tests are passing:
pytest testWarning
On Windows you must run the tests from an account with administrative privileges to make them pass.
Ensure that linting and static type checking are passing:
flake8 src test utilsmypy src
Reformat your code:
isort -rc src test utilsblack src test utils
Submitting a PR¶
Well, you know what to do ;)