certbot-dns-gyro 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- certbot_dns_gyro-0.1.0/PKG-INFO +46 -0
- certbot_dns_gyro-0.1.0/README.md +26 -0
- certbot_dns_gyro-0.1.0/certbot_dns_gyro/__init__.py +1 -0
- certbot_dns_gyro-0.1.0/certbot_dns_gyro/_internal/__init__.py +1 -0
- certbot_dns_gyro-0.1.0/certbot_dns_gyro/_internal/dns_gyro.py +89 -0
- certbot_dns_gyro-0.1.0/certbot_dns_gyro.egg-info/PKG-INFO +46 -0
- certbot_dns_gyro-0.1.0/certbot_dns_gyro.egg-info/SOURCES.txt +11 -0
- certbot_dns_gyro-0.1.0/certbot_dns_gyro.egg-info/dependency_links.txt +1 -0
- certbot_dns_gyro-0.1.0/certbot_dns_gyro.egg-info/entry_points.txt +2 -0
- certbot_dns_gyro-0.1.0/certbot_dns_gyro.egg-info/requires.txt +2 -0
- certbot_dns_gyro-0.1.0/certbot_dns_gyro.egg-info/top_level.txt +1 -0
- certbot_dns_gyro-0.1.0/pyproject.toml +28 -0
- certbot_dns_gyro-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: certbot-dns-gyro
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Gyro DNS authenticator plugin for Certbot (DNS-01, wildcard certificates)
|
|
5
|
+
Author: Gyro Hosting
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Gyro-Hosting/gyro-acme
|
|
8
|
+
Project-URL: Documentation, https://www.gyrohosting.com/en/knowledgebase/article/gyro-dns-lets-encrypt-wildcard-certificate
|
|
9
|
+
Project-URL: API documentation, https://www.gyrohosting.com/developers
|
|
10
|
+
Project-URL: Issues, https://github.com/Gyro-Hosting/gyro-acme/issues
|
|
11
|
+
Keywords: certbot,letsencrypt,acme,dns-01,wildcard,gyro
|
|
12
|
+
Classifier: Environment :: Plugins
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Security
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: certbot>=2.0
|
|
19
|
+
Requires-Dist: requests>=2.20
|
|
20
|
+
|
|
21
|
+
# certbot-dns-gyro
|
|
22
|
+
|
|
23
|
+
Gyro DNS authenticator plugin for [Certbot](https://certbot.eff.org): DNS-01 challenges, wildcard certificates.
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
```sh
|
|
27
|
+
pip install "certbot-dns-gyro @ git+https://github.com/Gyro-Hosting/gyro-acme@v0.1.0#subdirectory=certbot-dns-gyro"
|
|
28
|
+
```
|
|
29
|
+
(Install into the same Python environment as Certbot. Snap Certbot users: use `pip` Certbot or acme.sh.)
|
|
30
|
+
|
|
31
|
+
## Credentials
|
|
32
|
+
```ini
|
|
33
|
+
# /etc/letsencrypt/gyro.ini (chmod 600)
|
|
34
|
+
dns_gyro_token = wck_...
|
|
35
|
+
# dns_gyro_api = https://www.gyrohosting.com/api/v1/client/ (optional)
|
|
36
|
+
```
|
|
37
|
+
## Use
|
|
38
|
+
```sh
|
|
39
|
+
certbot certonly --authenticator dns-gyro --dns-gyro-credentials /etc/letsencrypt/gyro.ini \
|
|
40
|
+
-d example.com -d '*.example.com'
|
|
41
|
+
```
|
|
42
|
+
The plugin waits until both Gyro DNS name servers publish the record; the default
|
|
43
|
+
`--dns-gyro-propagation-seconds` is 10.
|
|
44
|
+
|
|
45
|
+
Türkçe: Gyro DNS ACME anahtarını `dns_gyro_token` olarak bir ini dosyasına yazın (izin 600) ve
|
|
46
|
+
`--authenticator dns-gyro` ile kullanın. Joker sertifika için hem `ornek.com` hem `*.ornek.com` isteyin.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# certbot-dns-gyro
|
|
2
|
+
|
|
3
|
+
Gyro DNS authenticator plugin for [Certbot](https://certbot.eff.org): DNS-01 challenges, wildcard certificates.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
```sh
|
|
7
|
+
pip install "certbot-dns-gyro @ git+https://github.com/Gyro-Hosting/gyro-acme@v0.1.0#subdirectory=certbot-dns-gyro"
|
|
8
|
+
```
|
|
9
|
+
(Install into the same Python environment as Certbot. Snap Certbot users: use `pip` Certbot or acme.sh.)
|
|
10
|
+
|
|
11
|
+
## Credentials
|
|
12
|
+
```ini
|
|
13
|
+
# /etc/letsencrypt/gyro.ini (chmod 600)
|
|
14
|
+
dns_gyro_token = wck_...
|
|
15
|
+
# dns_gyro_api = https://www.gyrohosting.com/api/v1/client/ (optional)
|
|
16
|
+
```
|
|
17
|
+
## Use
|
|
18
|
+
```sh
|
|
19
|
+
certbot certonly --authenticator dns-gyro --dns-gyro-credentials /etc/letsencrypt/gyro.ini \
|
|
20
|
+
-d example.com -d '*.example.com'
|
|
21
|
+
```
|
|
22
|
+
The plugin waits until both Gyro DNS name servers publish the record; the default
|
|
23
|
+
`--dns-gyro-propagation-seconds` is 10.
|
|
24
|
+
|
|
25
|
+
Türkçe: Gyro DNS ACME anahtarını `dns_gyro_token` olarak bir ini dosyasına yazın (izin 600) ve
|
|
26
|
+
`--authenticator dns-gyro` ile kullanın. Joker sertifika için hem `ornek.com` hem `*.ornek.com` isteyin.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Gyro DNS Authenticator plugin for Certbot."""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""DNS Authenticator for Gyro DNS (ACME key: may only write _acme-challenge TXT records)."""
|
|
2
|
+
import logging
|
|
3
|
+
import time
|
|
4
|
+
from typing import Any, Callable, Optional
|
|
5
|
+
|
|
6
|
+
import requests
|
|
7
|
+
from certbot import errors
|
|
8
|
+
from certbot.plugins import dns_common
|
|
9
|
+
from certbot.plugins.dns_common import CredentialsConfiguration
|
|
10
|
+
|
|
11
|
+
logger = logging.getLogger(__name__)
|
|
12
|
+
|
|
13
|
+
DEFAULT_API = "https://www.gyrohosting.com/api/v1/client/"
|
|
14
|
+
USER_AGENT = "certbot-dns-gyro/0.1.0"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Authenticator(dns_common.DNSAuthenticator):
|
|
18
|
+
"""Gyro DNS Authenticator: fulfils dns-01 challenges with the Gyro DNS API."""
|
|
19
|
+
|
|
20
|
+
description = "Obtain certificates using a DNS TXT record (if you are using Gyro DNS)."
|
|
21
|
+
|
|
22
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
23
|
+
super().__init__(*args, **kwargs)
|
|
24
|
+
self.credentials: Optional[CredentialsConfiguration] = None
|
|
25
|
+
|
|
26
|
+
@classmethod
|
|
27
|
+
def add_parser_arguments(cls, add: Callable[..., None], default_propagation_seconds: int = 10) -> None:
|
|
28
|
+
super().add_parser_arguments(add, default_propagation_seconds)
|
|
29
|
+
add("credentials", help="Gyro DNS credentials INI file (dns_gyro_token = <ACME key>).")
|
|
30
|
+
|
|
31
|
+
def more_info(self) -> str:
|
|
32
|
+
return "This plugin configures a DNS TXT record to respond to a dns-01 challenge using the Gyro DNS API."
|
|
33
|
+
|
|
34
|
+
def _setup_credentials(self) -> None:
|
|
35
|
+
self.credentials = self._configure_credentials(
|
|
36
|
+
"credentials", "Gyro DNS credentials INI file",
|
|
37
|
+
{"token": "ACME key created in the Gyro DNS service page (ACME / Let's Encrypt)."})
|
|
38
|
+
|
|
39
|
+
def _client(self) -> "_GyroClient":
|
|
40
|
+
assert self.credentials is not None
|
|
41
|
+
return _GyroClient(self.credentials.conf("token"), self.credentials.conf("api") or DEFAULT_API)
|
|
42
|
+
|
|
43
|
+
def _perform(self, domain: str, validation_name: str, validation: str) -> None:
|
|
44
|
+
self._client().add(validation_name, validation)
|
|
45
|
+
|
|
46
|
+
def _cleanup(self, domain: str, validation_name: str, validation: str) -> None:
|
|
47
|
+
try:
|
|
48
|
+
self._client().remove(validation_name, validation)
|
|
49
|
+
except errors.PluginError as e:
|
|
50
|
+
logger.warning("Could not remove the TXT record %s: %s", validation_name, e)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class _GyroClient:
|
|
54
|
+
def __init__(self, token: str, api: str) -> None:
|
|
55
|
+
self.api = api if api.endswith("/") else api + "/"
|
|
56
|
+
self.s = requests.Session()
|
|
57
|
+
self.s.headers.update({"Authorization": "Bearer " + token, "Accept": "application/json", "User-Agent": USER_AGENT})
|
|
58
|
+
|
|
59
|
+
def _call(self, method: str, name: str, value: str) -> dict:
|
|
60
|
+
url = self.api + "cloud/dns/acme-challenge"
|
|
61
|
+
try:
|
|
62
|
+
if method == "POST":
|
|
63
|
+
r = self.s.post(url, json={"name": name, "value": value}, timeout=60)
|
|
64
|
+
else:
|
|
65
|
+
r = self.s.request(method, url, params={"name": name, "value": value}, timeout=60)
|
|
66
|
+
except requests.RequestException as e:
|
|
67
|
+
raise errors.PluginError("Gyro DNS API unreachable: %s" % e)
|
|
68
|
+
try:
|
|
69
|
+
j = r.json()
|
|
70
|
+
except ValueError:
|
|
71
|
+
j = {}
|
|
72
|
+
if r.status_code >= 300:
|
|
73
|
+
err = (j.get("error") or {}) if isinstance(j, dict) else {}
|
|
74
|
+
raise errors.PluginError("Gyro DNS API error %s: %s (%s)" % (r.status_code, err.get("message", r.text[:200]), err.get("code", "")))
|
|
75
|
+
return j.get("data") or {}
|
|
76
|
+
|
|
77
|
+
def add(self, name: str, value: str) -> None:
|
|
78
|
+
self._call("POST", name, value)
|
|
79
|
+
# wait until both authoritative name servers publish the value
|
|
80
|
+
deadline = time.time() + 180
|
|
81
|
+
while time.time() < deadline:
|
|
82
|
+
if self._call("GET", name, value).get("ready"):
|
|
83
|
+
logger.info("Gyro DNS: %s is live on both name servers", name)
|
|
84
|
+
return
|
|
85
|
+
time.sleep(5)
|
|
86
|
+
logger.warning("Gyro DNS: name servers have not confirmed %s yet; continuing", name)
|
|
87
|
+
|
|
88
|
+
def remove(self, name: str, value: str) -> None:
|
|
89
|
+
self._call("DELETE", name, value)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: certbot-dns-gyro
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Gyro DNS authenticator plugin for Certbot (DNS-01, wildcard certificates)
|
|
5
|
+
Author: Gyro Hosting
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Gyro-Hosting/gyro-acme
|
|
8
|
+
Project-URL: Documentation, https://www.gyrohosting.com/en/knowledgebase/article/gyro-dns-lets-encrypt-wildcard-certificate
|
|
9
|
+
Project-URL: API documentation, https://www.gyrohosting.com/developers
|
|
10
|
+
Project-URL: Issues, https://github.com/Gyro-Hosting/gyro-acme/issues
|
|
11
|
+
Keywords: certbot,letsencrypt,acme,dns-01,wildcard,gyro
|
|
12
|
+
Classifier: Environment :: Plugins
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Security
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: certbot>=2.0
|
|
19
|
+
Requires-Dist: requests>=2.20
|
|
20
|
+
|
|
21
|
+
# certbot-dns-gyro
|
|
22
|
+
|
|
23
|
+
Gyro DNS authenticator plugin for [Certbot](https://certbot.eff.org): DNS-01 challenges, wildcard certificates.
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
```sh
|
|
27
|
+
pip install "certbot-dns-gyro @ git+https://github.com/Gyro-Hosting/gyro-acme@v0.1.0#subdirectory=certbot-dns-gyro"
|
|
28
|
+
```
|
|
29
|
+
(Install into the same Python environment as Certbot. Snap Certbot users: use `pip` Certbot or acme.sh.)
|
|
30
|
+
|
|
31
|
+
## Credentials
|
|
32
|
+
```ini
|
|
33
|
+
# /etc/letsencrypt/gyro.ini (chmod 600)
|
|
34
|
+
dns_gyro_token = wck_...
|
|
35
|
+
# dns_gyro_api = https://www.gyrohosting.com/api/v1/client/ (optional)
|
|
36
|
+
```
|
|
37
|
+
## Use
|
|
38
|
+
```sh
|
|
39
|
+
certbot certonly --authenticator dns-gyro --dns-gyro-credentials /etc/letsencrypt/gyro.ini \
|
|
40
|
+
-d example.com -d '*.example.com'
|
|
41
|
+
```
|
|
42
|
+
The plugin waits until both Gyro DNS name servers publish the record; the default
|
|
43
|
+
`--dns-gyro-propagation-seconds` is 10.
|
|
44
|
+
|
|
45
|
+
Türkçe: Gyro DNS ACME anahtarını `dns_gyro_token` olarak bir ini dosyasına yazın (izin 600) ve
|
|
46
|
+
`--authenticator dns-gyro` ile kullanın. Joker sertifika için hem `ornek.com` hem `*.ornek.com` isteyin.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
certbot_dns_gyro/__init__.py
|
|
4
|
+
certbot_dns_gyro.egg-info/PKG-INFO
|
|
5
|
+
certbot_dns_gyro.egg-info/SOURCES.txt
|
|
6
|
+
certbot_dns_gyro.egg-info/dependency_links.txt
|
|
7
|
+
certbot_dns_gyro.egg-info/entry_points.txt
|
|
8
|
+
certbot_dns_gyro.egg-info/requires.txt
|
|
9
|
+
certbot_dns_gyro.egg-info/top_level.txt
|
|
10
|
+
certbot_dns_gyro/_internal/__init__.py
|
|
11
|
+
certbot_dns_gyro/_internal/dns_gyro.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
certbot_dns_gyro
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "certbot-dns-gyro"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Gyro DNS authenticator plugin for Certbot (DNS-01, wildcard certificates)"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
authors = [{name = "Gyro Hosting"}]
|
|
12
|
+
requires-python = ">=3.8"
|
|
13
|
+
dependencies = ["certbot>=2.0", "requests>=2.20"]
|
|
14
|
+
classifiers = ["Environment :: Plugins", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Security"]
|
|
15
|
+
|
|
16
|
+
keywords = ["certbot", "letsencrypt", "acme", "dns-01", "wildcard", "gyro"]
|
|
17
|
+
|
|
18
|
+
[project.urls]
|
|
19
|
+
Homepage = "https://github.com/Gyro-Hosting/gyro-acme"
|
|
20
|
+
Documentation = "https://www.gyrohosting.com/en/knowledgebase/article/gyro-dns-lets-encrypt-wildcard-certificate"
|
|
21
|
+
"API documentation" = "https://www.gyrohosting.com/developers"
|
|
22
|
+
Issues = "https://github.com/Gyro-Hosting/gyro-acme/issues"
|
|
23
|
+
|
|
24
|
+
[project.entry-points."certbot.plugins"]
|
|
25
|
+
dns-gyro = "certbot_dns_gyro._internal.dns_gyro:Authenticator"
|
|
26
|
+
|
|
27
|
+
[tool.setuptools.packages.find]
|
|
28
|
+
include = ["certbot_dns_gyro*"]
|