From f6bc5bc9e9b8b78531ac51b0b29410285e9aa2c1 Mon Sep 17 00:00:00 2001 From: helgeerbe Date: Fri, 18 Dec 2020 23:17:19 +0100 Subject: [PATCH] renamings --- .gitignore | 186 ++++++++++++++++++ .../__init__.py | 36 ++-- .../dns_ionos.py | 0 .../dns_ionos_test.py | 14 +- setup.py | 12 +- 5 files changed, 217 insertions(+), 31 deletions(-) create mode 100644 .gitignore rename {certbot_dns_ispconfig => certbot_dns_ionos}/__init__.py (69%) rename certbot_dns_ispconfig/dns_ispconfig.py => certbot_dns_ionos/dns_ionos.py (100%) rename certbot_dns_ispconfig/dns_ispconfig_test.py => certbot_dns_ionos/dns_ionos_test.py (93%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d0dbff2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,186 @@ +# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig + +# Created by https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,python +# Edit at https://www.toptal.com/developers/gitignore?templates=windows,visualstudiocode,python + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +pytestdebug.log + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ +doc/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +pythonenv* + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# profiling data +.prof + +### VisualStudioCode ### +.vscode/* +!.vscode/tasks.json +!.vscode/launch.json +*.code-workspace + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,python + +# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) + diff --git a/certbot_dns_ispconfig/__init__.py b/certbot_dns_ionos/__init__.py similarity index 69% rename from certbot_dns_ispconfig/__init__.py rename to certbot_dns_ionos/__init__.py index 242e914..bac4615 100644 --- a/certbot_dns_ispconfig/__init__.py +++ b/certbot_dns_ionos/__init__.py @@ -1,16 +1,16 @@ """ -The `~certbot_dns_ispconfig.dns_ispconfig` plugin automates the process of +The `~certbot_dns_ionos.dns_ionos` plugin automates the process of completing a ``dns-01`` challenge (`~acme.challenges.DNS01`) by creating, and -subsequently removing, TXT records using the ISPConfig REST API. +subsequently removing, TXT records using the ionos REST API. Named Arguments --------------- ======================================== ===================================== -``--dns-ispconfig-credentials`` ISPConfig Remote API credentials_ +``--dns-ionos-credentials`` ionos Remote API credentials_ INI file. (Required) -``--dns-ispconfig-propagation-seconds`` The number of seconds to wait for DNS +``--dns-ionos-propagation-seconds`` The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (Default: 120) @@ -20,21 +20,21 @@ Credentials ----------- -Use of this plugin requires a configuration file containing ISPConfig Remote API -credentials, obtained from your DNSimple +Use of this plugin requires a configuration file containing ionos Remote API +credentials, obtained from your DNS provider `System > Remote Users`. .. code-block:: ini :name: credentials.ini :caption: Example credentials file: - # ISPCONFIG API credentials used by Certbot - dns_ispconfig_username = myispremoteuser - dns_ispconfig_password = mysecretpassword - dns_ispconfig_endpoint = https://localhost:8080 + # ionos API credentials used by Certbot + dns_ionos_username = myispremoteuser + dns_ionos_password = mysecretpassword + dns_ionos_endpoint = https://localhost:8080 The path to this file can be provided interactively or using the -``--dns-ispconfig-credentials`` command-line argument. Certbot records the path +``--dns-ionos-credentials`` command-line argument. Certbot records the path to this file for use during renewal, but does not store the file's contents. .. caution:: @@ -59,8 +59,8 @@ :caption: To acquire a certificate for ``example.com`` certbot certonly \\ - --dns-ispconfig \\ - --dns-ispconfig-credentials ~/.secrets/certbot/ispconfig.ini \\ + --dns-ionos \\ + --dns-ionos-credentials ~/.secrets/certbot/ionos.ini \\ -d example.com .. code-block:: bash @@ -68,8 +68,8 @@ ``www.example.com`` certbot certonly \\ - --dns-ispconfig \\ - --dns-ispconfig-credentials ~/.secrets/certbot/ispconfig.ini \\ + --dns-ionos \\ + --dns-ionos-credentials ~/.secrets/certbot/ionos.ini \\ -d example.com \\ -d www.example.com @@ -78,9 +78,9 @@ for DNS propagation certbot certonly \\ - --dns-ispconfig \\ - --dns-ispconfig-credentials ~/.secrets/certbot/ispconfig.ini \\ - --dns-ispconfig-propagation-seconds 240 \\ + --dns-ionos \\ + --dns-ionos-credentials ~/.secrets/certbot/ionos.ini \\ + --dns-ionos-propagation-seconds 240 \\ -d example.com """ diff --git a/certbot_dns_ispconfig/dns_ispconfig.py b/certbot_dns_ionos/dns_ionos.py similarity index 100% rename from certbot_dns_ispconfig/dns_ispconfig.py rename to certbot_dns_ionos/dns_ionos.py diff --git a/certbot_dns_ispconfig/dns_ispconfig_test.py b/certbot_dns_ionos/dns_ionos_test.py similarity index 93% rename from certbot_dns_ispconfig/dns_ispconfig_test.py rename to certbot_dns_ionos/dns_ionos_test.py index 7c5839a..68c2814 100644 --- a/certbot_dns_ispconfig/dns_ispconfig_test.py +++ b/certbot_dns_ionos/dns_ionos_test.py @@ -13,8 +13,8 @@ from certbot.plugins.dns_test_common import DOMAIN from certbot.tests import util as test_util -FAKE_USER = "remoteuser" -FAKE_PW = "password" +FAKE_PREFIX = "prefix" +FAKE_SECRET = "secret" FAKE_ENDPOINT = "mock://endpoint" @@ -29,8 +29,8 @@ def setUp(self): path = os.path.join(self.tempdir, "file.ini") dns_test_common.write( { - "ispconfig_username": FAKE_USER, - "ispconfig_password": FAKE_PW, + "ispconfig_prefix": FAKE_PREFIX, + "ispconfig_secret": FAKE_SECRET, "ispconfig_endpoint": FAKE_ENDPOINT, }, path, @@ -80,7 +80,7 @@ def setUp(self): self.adapter = requests_mock.Adapter() - self.client = _ISPConfigClient(FAKE_ENDPOINT, FAKE_USER, FAKE_PW) + self.client = _ISPConfigClient(FAKE_ENDPOINT, FAKE_PREFIX, FAKE_SECRET) self.client.session.mount("mock", self.adapter) def _register_response( @@ -98,8 +98,8 @@ def add_matcher(request): return ( ( - ("username" in data and data["username"] == FAKE_USER) - and ("username" in data and data["password"] == FAKE_PW) + ("prefix" in data and data["prefix"] == FAKE_PREFIX) + and ("prefix" in data and data["secret"] == FAKE_SECRET) ) or data["session_id"] == "FAKE_SESSION" ) and add_result diff --git a/setup.py b/setup.py index f100835..1e5d84c 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup from setuptools import find_packages -version = "0.2.0" +version = "0.0.1" install_requires = [ "acme>=0.29.0", @@ -20,14 +20,14 @@ long_description = f.read() setup( - name="certbot-dns-ispconfig", + name="certbot-dns-ionos", version=version, - description="ispconfig DNS Authenticator plugin for Certbot", + description="IONOS DNS Authenticator plugin for Certbot", long_description=long_description, long_description_content_type="text/x-rst", - url="https://github.com/m42e/certbot-dns-ispconfig", - author="Matthias Bilger", - author_email="matthias@bilger.info", + url="https://github.com/helgeerbe/certbot-dns-ionos", + author="Helge Erbe", + author_email="helge@erbehome.de", license="Apache License 2.0", python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", classifiers=[