feat: point plugin at api.yeil.app/v1/dns gateway (v3.1.0)
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
"""DNS-01 authenticator plugin for Certbot using the yeil public API.
|
"""DNS-01 authenticator plugin for Certbot using the yeil public API.
|
||||||
|
|
||||||
Authenticates to dns.yeil.app with a yeil App key (yk_...) sent as a
|
Authenticates to api.yeil.app/v1/dns with a yeil App key (yk_...) sent as a
|
||||||
Bearer token, then adds/removes TXT records via the public records API.
|
Bearer token, then adds/removes TXT records via the public records API.
|
||||||
Create an App with DNS record-write permission on your zone(s) in your
|
Create an App with DNS record-write permission on your zone(s) in your
|
||||||
yeil team settings (the Apps tab) and put its key in the credentials file.
|
yeil team settings (the Apps tab) and put its key in the credentials file.
|
||||||
|
|
||||||
The certbot host only needs HTTPS reachability to dns.yeil.app; no
|
The certbot host only needs HTTPS reachability to api.yeil.app/v1/dns; no
|
||||||
NetBird or shared admin key.
|
NetBird or shared admin key.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ from zope.interface import implementer
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_BASE_URL = "https://dns.yeil.app"
|
DEFAULT_BASE_URL = "https://api.yeil.app/v1/dns"
|
||||||
HTTP_TIMEOUT = 30
|
HTTP_TIMEOUT = 30
|
||||||
|
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||||||
def more_info(self):
|
def more_info(self):
|
||||||
return (
|
return (
|
||||||
"Configures Certbot to perform DNS-01 challenges by adding TXT "
|
"Configures Certbot to perform DNS-01 challenges by adding TXT "
|
||||||
"records via the yeil public DNS API at dns.yeil.app."
|
"records via the yeil public DNS API at api.yeil.app/v1/dns."
|
||||||
)
|
)
|
||||||
|
|
||||||
def _setup_credentials(self):
|
def _setup_credentials(self):
|
||||||
@@ -130,7 +130,7 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||||||
|
|
||||||
result = self._request(
|
result = self._request(
|
||||||
"GET",
|
"GET",
|
||||||
f"/api/v1/zones?suffix_of={quote(fqdn, safe='')}",
|
f"/zones?suffix_of={quote(fqdn, safe='')}",
|
||||||
)
|
)
|
||||||
if not isinstance(result, dict) or "id" not in result:
|
if not isinstance(result, dict) or "id" not in result:
|
||||||
raise errors.PluginError(
|
raise errors.PluginError(
|
||||||
@@ -162,7 +162,7 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||||||
rel_name = self._relative_name(validation_name, zone_name)
|
rel_name = self._relative_name(validation_name, zone_name)
|
||||||
result = self._request(
|
result = self._request(
|
||||||
"POST",
|
"POST",
|
||||||
f"/api/v1/zones/{zone_id}/records",
|
f"/zones/{zone_id}/records",
|
||||||
body={
|
body={
|
||||||
"name": rel_name,
|
"name": rel_name,
|
||||||
"type": "TXT",
|
"type": "TXT",
|
||||||
@@ -193,7 +193,7 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||||||
try:
|
try:
|
||||||
self._request(
|
self._request(
|
||||||
"DELETE",
|
"DELETE",
|
||||||
f"/api/v1/zones/{zone_id}/records/{record_id}",
|
f"/zones/{zone_id}/records/{record_id}",
|
||||||
)
|
)
|
||||||
except errors.PluginError as e:
|
except errors.PluginError as e:
|
||||||
# Don't fail the renewal because of a stale TXT we couldn't
|
# Don't fail the renewal because of a stale TXT we couldn't
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="certbot-dns-yeil",
|
name="certbot-dns-yeil",
|
||||||
version="3.0.0",
|
version="3.1.0",
|
||||||
description="yeil DNS Authenticator plugin for Certbot",
|
description="yeil DNS Authenticator plugin for Certbot",
|
||||||
url="https://git.eskimo.dev/Yeil/certbot-dns-yeil",
|
url="https://git.eskimo.dev/Yeil/certbot-dns-yeil",
|
||||||
author="yeil",
|
author="yeil",
|
||||||
|
|||||||
Reference in New Issue
Block a user