Certbot plugin for authentication using Njalla
This is a plugin for Certbot that uses the Njalla API to allow customers to prove control of a domain name.
Installation
Python / pip
Use this method if you have also installed certbot via pip.
Install the plugin using
pip3 install certbot-dns-njalla
If you are using sudo with certbot use sudo -H pip3 install certbot-dns-njalla instead.
Snap
Use this method if you have also installed certbot via snap.
snap install certbot-dns-njalla
Now connect the certbot installation with the njalla plugin installation.
snap set certbot trust-plugin-with-root=ok
snap connect certbot:plugin certbot-dns-njalla
Usage
-
Make sure the plugin is installed and connected. You can verify this by running
certbot plugins. The list should containdns-njalla. -
Obtain an Njalla API token (found in the settings).
For optimal security you can set these token settings:Setting Value API Methods get-domain list-records add-record remove-recordAPI Record Prefixes _acme-challengeAPI Record Types TXT -
Create a
njalla.iniconfig file with the following contents:dns_njalla_token=<token>
Replace
<token>with your Njalla API key and ensure permissions are set to disallow access to other users by runningchmod 600 njalla.ini
-
Run
certbotand direct it to use the plugin for authentication and to use the config file previously created:certbot -a dns-njalla --dns-njalla-credentials njalla.ini -d your-domain.com
Use
*.your-domain.comif you want to generate it as a wildcard certificate.
Add additional options as required to specify an installation plugin etc.You can use
--dns-njalla-propagation-seconds 30to reduce the time it waits for DNS propagation to e.g. 30.Remember to use the
-iflag if you want to use an additional installer plugin, like-i apacheor-i nginx.
Development
Install local files as python package
Run the following command in the repository root (so you are in the folder containing the setup.py):
pip3 install -e .[test]
Build and publish to PyPi
Run the following command in the repository root (so you are in the folder containing the setup.py):
# Ensure latest versions of "build" and "twine" are installed
python3 -m pip install --upgrade build twine
python3 -m build
# Publish to PyPi
twine upload dist/*
Build snap locally
By default a snap is built automatically by snapcraft if there are changes in the git repo. But here is what to do to test the build locally.
Do the basic setup described in the certbot snap readme. (Mainly installing setting up lxd)
Run the following command in the repository root (so you are in the folder containing the setup.py):
sh generate-snapcraft.sh ./
snapcraft clean --use-lxd
snapcraft --debug --use-lxd
Run tests
Execute the following command inside the root-directory
python -m unittest discover -p '*_test.py'
Distribution
Release files for certbot-dns-njalla 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| certbot_dns_njalla-2.0.2.tar.gz | 13.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| certbot_dns_njalla-2.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.0 kB
Release files / certbot_dns_njalla-2.0.2.tar.gz
| Download URL | certbot_dns_njalla-2.0.2.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b771c6e55b6ecdaadd7a5dd88d3798aa39290414a8d2f916c89b8cb52b29eea8
|
|
BLAKE2b-256 checksum How to use checksums |
33d3c9bf06ebd8c9d63945cb419658f1b637f35a65234b886367c7bf0ed6edb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / certbot_dns_njalla-2.0.2-py3-none-any.whl
| Download URL | certbot_dns_njalla-2.0.2-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
668f91f3027edd4c4cbca99095fd5ec66d4ccefcb4b9366367873e25e624e1bd
|
|
BLAKE2b-256 checksum How to use checksums |
119b0772a3429d89e1bb192319eb8bbefffe732061d3f52a8b0bf0c7f74f752f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|