From 6f3d4a9890789f16ffa5f5580ce0e22035d5541a Mon Sep 17 00:00:00 2001 From: William Colmenares Date: Wed, 15 May 2019 18:49:00 -0400 Subject: [PATCH 1/4] fix and add the dev vm --- ungleich_dns.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/ungleich_dns.py b/ungleich_dns.py index cd47685..14c5349 100644 --- a/ungleich_dns.py +++ b/ungleich_dns.py @@ -14,10 +14,20 @@ class ungleichDNS(object): self.parser['dns'].add_argument('--user', help='Your ungleich username', metavar='', required=True) self.parser['dns'].add_argument('--token', help='Your ungleich 6 digit OTP generated token', metavar='', type=int, required=True) self.parser['dns'].add_argument('--name', help='Hostname', metavar='', required=True) + self.parser['dns'].add_argument('--email', help='registered email', metavar='', required=True) + self.parser['dns'].add_argument('--realm', help='Otp realm', metavar='', required=True) + self.parser['dns'].set_defaults(func=self._handle_dns) - def _handle_dns(self): - """A dummy endpoint, to check what endpoint will be reverse-dns service.""" + def _handle_dns(self, args): + """A dev endpoint for reverse-dns service.""" r = requests.post( - 'https://en53kfc0hydpg.x.pipedream.net', - json={'username': args.user, 'token': args.token, 'ipaddress': args.set_reverse, 'name': args.name}) - return r.text + 'https://dev.william.ungleich.cloud', + json={ + 'username': args.user, + 'token': args.token, + 'ipaddress': args.set_reverse, + 'name': args.name, + 'email': args.email, + 'realm': args.realm + }) + print(r.text) From 64f9e32e8c87a2f06615808c3b48ecd56a850b72 Mon Sep 17 00:00:00 2001 From: William Colmenares Date: Wed, 15 May 2019 18:49:22 -0400 Subject: [PATCH 2/4] Updated readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7138b3f..642dd42 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ ungleich --help ## Usage: DNS ``` -ungleich dns --set-reverse --user --token --name mirror.example.com +ungleich dns --set-reverse --user --token --realm --email --name mirror.example.com ``` ### Usage: RIPE From d4d03d6add1072196b9c48862da81a755c51303b Mon Sep 17 00:00:00 2001 From: William Colmenares Date: Wed, 15 May 2019 18:53:34 -0400 Subject: [PATCH 3/4] delete unnecesary files --- LICENSE | 9 --------- setup.cfg | 2 -- setup.py | 34 ---------------------------------- 3 files changed, 45 deletions(-) delete mode 100644 LICENSE delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 45e4486..0000000 --- a/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -LICENSE - -Copyright - -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. diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 224a779..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -description-file = README.md \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 9848154..0000000 --- a/setup.py +++ /dev/null @@ -1,34 +0,0 @@ -from setuptools import setup - - -def readme(): - with open('README.md') as f: - README = f.read() - return README - - -setup( - name='ungleich-cli', - version='1.0.0', - description="A Python package for ungleich dns administration.", - long_description=readme(), - long_description_content_type="text/markdown", - author="William Colmenares", - author_email="colmenares.william@gmail.com", - license="MIT", - classifiers=[ - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - ], - - py_modules=['ungleichcli'], - install_requires=[ - 'requests', - ], - entry_points={ - "console_scripts": [ - "ungleich-cli=ungleichcli:cli" - ] - }, -) From d6e29ead71760e241aa27ec079614e920a7e096d Mon Sep 17 00:00:00 2001 From: William Colmenares Date: Sat, 18 May 2019 12:39:28 -0400 Subject: [PATCH 4/4] remove metavar --- ungleich_dns.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ungleich_dns.py b/ungleich_dns.py index 14c5349..7552c99 100644 --- a/ungleich_dns.py +++ b/ungleich_dns.py @@ -10,12 +10,12 @@ class ungleichDNS(object): help="Manage DNS entries @ ungleich", parents=[parents]) - self.parser['dns'].add_argument('--set-reverse', help='REQUIRED: IPv6 Address of your VM', metavar='', required=True) - self.parser['dns'].add_argument('--user', help='Your ungleich username', metavar='', required=True) - self.parser['dns'].add_argument('--token', help='Your ungleich 6 digit OTP generated token', metavar='', type=int, required=True) - self.parser['dns'].add_argument('--name', help='Hostname', metavar='', required=True) - self.parser['dns'].add_argument('--email', help='registered email', metavar='', required=True) - self.parser['dns'].add_argument('--realm', help='Otp realm', metavar='', required=True) + self.parser['dns'].add_argument('--set-reverse', help='REQUIRED: IPv6 Address of your VM', required=True) + self.parser['dns'].add_argument('--user', help='Your ungleich username', required=True) + self.parser['dns'].add_argument('--token', help='Your ungleich 6 digit OTP generated token', type=int, required=True) + self.parser['dns'].add_argument('--name', help='Hostname', required=True) + self.parser['dns'].add_argument('--email', help='registered email', required=True) + self.parser['dns'].add_argument('--realm', help='Otp realm', required=True) self.parser['dns'].set_defaults(func=self._handle_dns) def _handle_dns(self, args):