Compare commits

..

No commits in common. "master" and "0.0.4" have entirely different histories.

3 changed files with 9 additions and 23 deletions

View file

@ -5,13 +5,12 @@ It is intended to be used by ungleich engineers and skilled customers.
## Requirements / Installation
* ensure you have **python3** and **pipenv**
* ensure you have python3
* git clone this repo
* cd into this repo
* run the following command
```
pipenv install
pipenv shell
sudo pip3 install -r requirements.txt
```
## Usage general
@ -53,11 +52,6 @@ ungleich account --create-user <username> --name <firstname> --lastname <lastnam
### Usage: SSH Key
Requires you to have
https://code.ungleich.ch/ungleich-public/ungleich-ssh-keys/ checked
out in ~/vcs/ungleich-ssh-keys
```
ungleich sshkey --key raul.ascencio --host dev.raul.ungleich.cloud
```

1
requirements.txt Normal file
View file

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

View file

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