Compare commits
7 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79abf872f2 | ||
|
|
49f1229aca | ||
| 10e8af17e5 | |||
| 56c341805b | |||
| f38e1bda14 | |||
| bdb21e285a | |||
| 9772a479b6 |
3 changed files with 23 additions and 9 deletions
10
README.md
10
README.md
|
|
@ -5,12 +5,13 @@ It is intended to be used by ungleich engineers and skilled customers.
|
||||||
|
|
||||||
## Requirements / Installation
|
## Requirements / Installation
|
||||||
|
|
||||||
* ensure you have python3
|
* ensure you have **python3** and **pipenv**
|
||||||
* git clone this repo
|
* git clone this repo
|
||||||
* cd into this repo
|
* cd into this repo
|
||||||
* run the following command
|
* run the following command
|
||||||
```
|
```
|
||||||
sudo pip3 install -r requirements.txt
|
pipenv install
|
||||||
|
pipenv shell
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage general
|
## Usage general
|
||||||
|
|
@ -52,6 +53,11 @@ ungleich account --create-user <username> --name <firstname> --lastname <lastnam
|
||||||
|
|
||||||
### Usage: SSH Key
|
### 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
|
ungleich sshkey --key raul.ascencio --host dev.raul.ungleich.cloud
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
git+https://github.com/apixu/apixu-python.git@master#egg=apixu
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import requests
|
|
||||||
|
import urllib.request
|
||||||
import argparse
|
import argparse
|
||||||
|
import json
|
||||||
|
|
||||||
class ungleichDNS(object):
|
class ungleichDNS(object):
|
||||||
def __init__(self, parser, parents):
|
def __init__(self, parser, parents):
|
||||||
|
|
@ -20,14 +22,21 @@ class ungleichDNS(object):
|
||||||
|
|
||||||
def _handle_dns(self, args):
|
def _handle_dns(self, args):
|
||||||
"""Reverse dns endpoint."""
|
"""Reverse dns endpoint."""
|
||||||
r = requests.post(
|
url = 'https://dns.service.ungleich.ch'
|
||||||
'https://dns.service.ungleich.ch',
|
req = urllib.request.Request(
|
||||||
json={
|
url=url,
|
||||||
|
method='POST',
|
||||||
|
headers={
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
data=json.dumps({
|
||||||
'username': args.user,
|
'username': args.user,
|
||||||
'token': args.token,
|
'token': args.token,
|
||||||
'ipaddress': args.set_reverse,
|
'ipaddress': args.set_reverse,
|
||||||
'name': args.name,
|
'name': args.name,
|
||||||
'email': args.email,
|
'email': args.email,
|
||||||
'realm': args.realm
|
'realm': args.realm
|
||||||
})
|
}).encode('utf-8')
|
||||||
print(r.text)
|
)
|
||||||
|
response = urllib.request.urlopen(req).read()
|
||||||
|
print(json.loads(response))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue