Skip to content

Commit 95c593c

Browse files
committedNov 30, 2024
Fixes generation of certificates for subdomains
1 parent 512ef81 commit 95c593c

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed
 

‎.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ dist
44
*.egg-info
55
__pycache__
66
*.snap
7-
snap-constraints.txt
7+
snap-constraints.txt
8+
njalla.ini
9+
tmp/

‎README.md

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ snap connect certbot:plugin certbot-dns-njalla
4848

4949
```
5050
get-domain
51+
list-records
5152
add-record
5253
remove-record
5354
```
@@ -96,6 +97,8 @@ snap connect certbot:plugin certbot-dns-njalla
9697
Use `*.your-domain.com` if you want to generate it as a wildcard certificate.
9798
Add additional options as required to specify an installation plugin etc.
9899

100+
You can use `--dns-njalla-propagation-seconds 30` to reduce the time it waits for DNS propagation to e.g. 30.
101+
99102
Remember to use the `-i` flag if you want to use an additional installer plugin, like `-i apache` or `-i nginx`.
100103

101104
## Development

‎certbot_dns_njalla/dns_njalla.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,20 @@ def _provider_name(self) -> str:
3838
return 'njalla'
3939

4040
def _handle_http_error(self, e, domain_name: str) -> errors.PluginError:
41+
# HTTP Errors are incorrectly thrown as a general error, so we need to handle both the same way
42+
return self._handle_all_errors(e, domain_name)
43+
44+
def _handle_general_error(self, e, domain_name: str) -> errors.PluginError:
45+
# HTTP Errors are incorrectly thrown as a general error, so we need to handle both the same way
46+
return self._handle_all_errors(e, domain_name)
47+
48+
def _handle_all_errors(self, e, domain_name: str) -> errors.PluginError:
49+
if str(e).startswith('403: Permission denied'):
50+
return # Expected errors when zone name guess is wrong
51+
4152
hint = None
42-
if str(e).startswith('401 Client Error: Unauthorized for url:'):
43-
hint = 'Is your API token value correct?'
53+
if str(e).startswith('401:'):
54+
hint = 'Does your token have the right permissions?'
4455

4556
hint_disp = f' ({hint})' if hint else ''
4657

‎pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "certbot-dns-njalla"
3-
version = "2.0.1"
3+
version = "2.0.2"
44
authors = [{ name = "chaptergy" }]
55
license = {file = "LICENSE"}
66
description = "Njalla DNS Authenticator plugin for Certbot"

0 commit comments

Comments
 (0)
Please sign in to comment.