pax_global_header00006660000000000000000000000064134000074260014506gustar00rootroot0000000000000052 comment=c8e8631a34afa50ff90efcf0f0f5c194a6fdee90 thinkl33t-mb-ddns-c8e8631/000077500000000000000000000000001340000742600152165ustar00rootroot00000000000000thinkl33t-mb-ddns-c8e8631/.gitignore000066400000000000000000000022631340000742600172110ustar00rootroot00000000000000# 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/ *.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/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/ .pytest_cache/ # Translations *.mo *.pot # Django stuff: *.log local_settings.py db.sqlite3 # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # pyenv .python-version # celery beat schedule file celerybeat-schedule # SageMath parsed files *.sage.py # Environments .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ thinkl33t-mb-ddns-c8e8631/LICENSE000066400000000000000000000020531340000742600162230ustar00rootroot00000000000000MIT License Copyright (c) 2018 Bob Clough Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. thinkl33t-mb-ddns-c8e8631/README.md000066400000000000000000000000541340000742600164740ustar00rootroot00000000000000# mb-ddns Mythic Beasts Dynamic Dns Updater thinkl33t-mb-ddns-c8e8631/mbddns/000077500000000000000000000000001340000742600164655ustar00rootroot00000000000000thinkl33t-mb-ddns-c8e8631/mbddns/__init__.py000066400000000000000000000021241340000742600205750ustar00rootroot00000000000000import asyncio import aiohttp import logging _LOGGER = logging.getLogger(__name__) async def update(domain, password, host, ttl=60, session=None): data = { 'domain': domain, 'password': password, 'command': "REPLACE {} {} A DYNAMIC_IP".format(host, ttl) } async with session or aiohttp.ClientSession() as session: try: resp = await asyncio.gather(session.post('https://dnsapi4.mythic-beasts.com/',data=data)) body = await resp[0].text() if body.startswith("REPLACE"): _LOGGER.debug("Updating Mythic Beasts successful: %s", body) return True if body.startswith("ERR"): _LOGGER.error("Updating Mythic Beasts failed: %s", body.partition(' ')[2]) if body.startswith("NREPLACE"): _LOGGER.warning("Updating Mythic Beasts failed: %s", body.partition(';')[2]) except Exception as e: _LOGGER.error("Updating Mythic Beasts failed: %s", e) return False thinkl33t-mb-ddns-c8e8631/setup.py000066400000000000000000000005571340000742600167370ustar00rootroot00000000000000from setuptools import setup setup(name='mbddns', version='0.1.2', description='Mythic Beasts Dynamic DNS updater', url='https://github.com/thinkl33t/mb-ddns', author='Bob Clough', author_email='bob@clough.me', license='MIT', packages=['mbddns'], install_requires=[ 'aiohttp', ], zip_safe=False)