Skip to content

Commit

Permalink
Version 3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adferrand committed Jun 14, 2020
1 parent 34cb8ae commit 8c4ea69
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## master - CURRENT

## 3.4.0 - 14/06/2020
### Added
* DNS challenges are now all run before any wait or check happens. This is useful for certificates that
contains lot of domains, because DNSroboCert will wait only once the provided `sleep_time`, instead
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "poetry.masonry.api"

[tool.poetry]
name = "dnsrobocert"
version = "3.3.4"
version = "3.4.0"
description = "A tool to manage your DNS-challenged TLS certificates"
license = "MIT"
keywords = [
Expand Down
19 changes: 11 additions & 8 deletions src/dnsrobocert/core/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@ def main(args: List[str] = None) -> int:
print(
"Error occured while loading the configuration file, aborting the `{0}` hook.".format(
parsed_args.type
), file=sys.stderr
),
file=sys.stderr,
)
return 1

try:
globals()[parsed_args.type](dnsrobocert_config, parsed_args.lineage)
except BaseException as e:
print("Error while executing the `{0}` hook:".format(parsed_args.type), file=sys.stderr)
print(
"Error while executing the `{0}` hook:".format(parsed_args.type),
file=sys.stderr,
)
print(e, file=sys.stderr)
traceback.print_exc(file=sys.stderr)
return 1
Expand All @@ -55,7 +59,7 @@ def auth(dnsrobocert_config: Dict[str, Any], lineage: str):
domain = os.environ["CERTBOT_DOMAIN"]
token = os.environ["CERTBOT_VALIDATION"]

print('Executing auth hook for domain {0}, lineage {1}.'.format(domain, lineage))
print("Executing auth hook for domain {0}, lineage {1}.".format(domain, lineage))

_txt_challenge(profile, token, domain, action="create")

Expand Down Expand Up @@ -85,7 +89,8 @@ def auth(dnsrobocert_config: Dict[str, Any], lineage: str):
print(
"All challenges were not propagated after the maximum tries of {0}".format(
max_checks
), file=sys.stderr
),
file=sys.stderr,
)
raise RuntimeError("Auth hook failed.")

Expand Down Expand Up @@ -140,9 +145,7 @@ def _check_one_challenge(challenge: str, token: Optional[str]) -> bool:
]

if not validation_answers:
print(
"TXT {0} does not have the expected token value.".format(challenge)
)
print("TXT {0} does not have the expected token value.".format(challenge))
return False

print("TXT {0} has the expected token value.")
Expand All @@ -155,7 +158,7 @@ def cleanup(dnsrobocert_config: Dict[str, str], lineage: str):
domain = os.environ["CERTBOT_DOMAIN"]
token = os.environ["CERTBOT_VALIDATION"]

print('Executing cleanup hook for domain {0}, lineage {1}.'.format(domain, lineage))
print("Executing cleanup hook for domain {0}, lineage {1}.".format(domain, lineage))

_txt_challenge(profile, token, domain, action="delete")

Expand Down

0 comments on commit 8c4ea69

Please sign in to comment.