Skip to content

Commit

Permalink
Merge branch 'master' of github.com:adferrand/dnsrobocert
Browse files Browse the repository at this point in the history
  • Loading branch information
adferrand committed Sep 30, 2023
2 parents 1803040 + 60e8b00 commit e833085
Show file tree
Hide file tree
Showing 13 changed files with 719 additions and 368 deletions.
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
post_create_environment:
- pip install poetry
- poetry config virtualenvs.create false
post_install:
- poetry install --no-root --only docs
sphinx:
configuration: docs/conf.py
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## master - CURRENT

## 3.24.2 - 18/09/2023
### Modified
* Fix TXT record cleanup actions

## 3.24.1 - 13/08/2023
### Modified
* Fix compatibility issue with Python 3.8
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
:target: https://pypi.org/project/dnsrobocert/
.. |docker| image:: https://img.shields.io/docker/pulls/adferrand/dnsrobocert
:target: https://hub.docker.com/r/adferrand/dnsrobocert
.. |ci| image:: https://img.shields.io/github/workflow/status/adferrand/dnsrobocert/main/master
.. |ci| image:: https://img.shields.io/github/actions/workflow/status/adferrand/dnsrobocert/main.yml?branch=master
:target: https://github.com/adferrand/dnsrobocert/actions/workflows/main.yml
.. |coverage| image:: https://img.shields.io/codecov/c/github/adferrand/dnsrobocert/master
:target: https://app.codecov.io/gh/adferrand/dnsrobocert/branch/master
Expand Down
1 change: 0 additions & 1 deletion docs/_config.yml

This file was deleted.

9 changes: 6 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import toml

pyproject_toml = toml.load(join(dirname(dirname(abspath(__file__))), "pyproject.toml"))
poetry_lock = toml.load(join(dirname(dirname(abspath(__file__))), "poetry.lock"))
root_path = dirname(dirname(abspath(__file__)))
pyproject_toml = toml.load(join(root_path, "pyproject.toml"))

master_doc = "index"
project = "DNSroboCert"
Expand All @@ -13,8 +13,11 @@

extensions = [
"sphinx.ext.intersphinx",
"sphinx_rtd_theme",
]

intersphinx_mapping = {
'lexicon': ('https://dns-lexicon.readthedocs.io/en/latest', None),
"lexicon": ("https://dns-lexicon.readthedocs.io/en/latest", None),
}

html_theme = "sphinx_rtd_theme"
9 changes: 5 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
.. |logo| image:: images/dnsrobocert.svg
:alt: DNSroboCert

.. include:: ../README.rst
:start-after: tag:intro-begin
:end-before: tag:intro-end

.. toctree::
:caption: Table of Contents
:name: mastertoc
:maxdepth: 2
:hidden:

introduction
user_guide
configuration_reference
providers_options
Expand Down
7 changes: 0 additions & 7 deletions docs/introduction.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/requirements.txt

This file was deleted.

1,009 changes: 669 additions & 340 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "dnsrobocert"
version = "3.24.1"
version = "3.24.2"
description = "A tool to manage your DNS-challenged TLS certificates"
license = "MIT"
keywords = [
Expand Down Expand Up @@ -62,11 +62,12 @@ coloredlogs = ">=14"
colorama = ">=0"
tldextract = ">=3"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
black = "*"
flake8 = "*"
flake8-pyproject = "*"
mypy = "*"
packaging= "*"
pytest = "*"
pytest-cov = "*"
isort = "*"
Expand All @@ -76,6 +77,11 @@ types-pyOpenSSL = "*"
types-requests = "*"
types-setuptools = "*"

[tool.poetry.group.docs.dependencies]
sphinx = "*"
sphinx_rtd_theme = "*"
toml = "*"

[tool.poetry.scripts]
dnsrobocert = "dnsrobocert.core.main:main"

Expand Down
4 changes: 2 additions & 2 deletions src/dnsrobocert/core/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def txt_challenge(

with Client(ConfigResolver().with_dict(config_dict)) as operations:
if action == "create":
operations.create_record("TXT", challenge_name, token)
operations.create_record(rtype="TXT", name=challenge_name, content=token)
elif action == "delete":
operations.delete_record("TXT", challenge_name, token)
operations.delete_record(rtype="TXT", name=challenge_name, content=token)


def check_one_challenge(challenge: str, token: str | None = None) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions test/unit_tests/hooks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_auth_cli(client, fake_config):
assert resolver.resolve("lexicon:dummy:auth_token") == "TOKEN"

operations.create_record.assert_called_with(
"TXT", f"_acme-challenge.{LINEAGE}.", "VALIDATION"
rtype="TXT", name=f"_acme-challenge.{LINEAGE}.", content="VALIDATION"
)


Expand All @@ -113,7 +113,7 @@ def test_cleanup_cli(client, fake_config):
assert resolver.resolve("lexicon:dummy:auth_token") == "TOKEN"

operations.delete_record.assert_called_with(
"TXT", f"_acme-challenge.{LINEAGE}.", "VALIDATION"
rtype="TXT", name=f"_acme-challenge.{LINEAGE}.", content="VALIDATION"
)


Expand Down
14 changes: 9 additions & 5 deletions utils/create_release.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python3
import datetime
import subprocess
from distutils.version import StrictVersion

from packaging import version


def main():
Expand All @@ -21,11 +22,14 @@ def main():
print("Please insert new version:")
new_version = str(input())

if StrictVersion(new_version) <= StrictVersion(current_version):
try:
parsed_new_version = version.parse(new_version)
except version.InvalidVersion:
raise RuntimeError(f"Error, invalid version provided: {new_version}")

if parsed_new_version <= version.parse(current_version):
raise RuntimeError(
"Error new version is below current version: {0} < {1}".format(
new_version, current_version
)
f"Error new version is below current version: {new_version} < {current_version}"
)

try:
Expand Down

0 comments on commit e833085

Please sign in to comment.