Browse Source

Now using Pipenv, requirements.txt removed

master^2^2
_ahmedbilal 3 years ago
parent
commit
bdb21e285a
  1. 12
      Pipfile
  2. 25
      Pipfile.lock
  3. 2
      README.md
  4. 1
      requirements.txt
  5. 21
      ungleich_dns.py

12
Pipfile

@ -0,0 +1,12 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
apixu-python = {git = "https://github.com/apixu/apixu-python.git"}
[requires]
python_version = "3.7"

25
Pipfile.lock generated

@ -0,0 +1,25 @@
{
"_meta": {
"hash": {
"sha256": "e84e3c15d8fea5745b66f0970337d98fef35d6898635ea849162932e1dabd55a"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.7"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {
"apixu-python": {
"git": "https://github.com/apixu/apixu-python.git",
"ref": "4beb003c71c0213720e930350f46e5fa6af9ef12"
}
},
"develop": {}
}

2
README.md

@ -10,7 +10,7 @@ It is intended to be used by ungleich engineers and skilled customers.
* cd into this repo
* run the following command
```
sudo pip3 install -r requirements.txt
sudo pip3 install pipenv
```
## Usage general

1
requirements.txt

@ -1 +0,0 @@
git+https://github.com/apixu/apixu-python.git@master

21
ungleich_dns.py

@ -1,5 +1,7 @@
import requests
import urllib.request
import argparse
import json
class ungleichDNS(object):
def __init__(self, parser, parents):
@ -20,14 +22,21 @@ class ungleichDNS(object):
def _handle_dns(self, args):
"""Reverse dns endpoint."""
r = requests.post(
'https://dns.service.ungleich.ch',
json={
url = 'https://dns.service.ungleich.ch'
req = urllib.request.Request(
url=url,
method='POST',
headers={
"Content-Type": "application/json"
},
data=json.dumps({
'username': args.user,
'token': args.token,
'ipaddress': args.set_reverse,
'name': args.name,
'email': args.email,
'realm': args.realm
})
print(r.text)
}).encode('utf-8')
)
response = urllib.request.urlopen(req).read()
print(json.loads(response))

Loading…
Cancel
Save