From 1f21051e9361de9bfdf70f269c90c25cbdbe2b43 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 20 Jan 2013 19:22:16 +0100 Subject: nfc-login: add mrled --- minikrebs/profiles/instakrebs/customfiles/etc/rc.d/tinc | 1 - .../profiles/nfc-login/customfiles/usr/bin/login-manager | 14 +++++++------- minikrebs/profiles/nfc-login/customfiles/usr/bin/mrled | 4 ++++ 3 files changed, 11 insertions(+), 8 deletions(-) delete mode 120000 minikrebs/profiles/instakrebs/customfiles/etc/rc.d/tinc create mode 100755 minikrebs/profiles/nfc-login/customfiles/usr/bin/mrled diff --git a/minikrebs/profiles/instakrebs/customfiles/etc/rc.d/tinc b/minikrebs/profiles/instakrebs/customfiles/etc/rc.d/tinc deleted file mode 120000 index f08fe11d..00000000 --- a/minikrebs/profiles/instakrebs/customfiles/etc/rc.d/tinc +++ /dev/null @@ -1 +0,0 @@ -../init.d/tinc \ No newline at end of file diff --git a/minikrebs/profiles/nfc-login/customfiles/usr/bin/login-manager b/minikrebs/profiles/nfc-login/customfiles/usr/bin/login-manager index 63f35c74..f22a209e 100755 --- a/minikrebs/profiles/nfc-login/customfiles/usr/bin/login-manager +++ b/minikrebs/profiles/nfc-login/customfiles/usr/bin/login-manager @@ -1,18 +1,18 @@ #!/bin/sh -#!/bin/sh #LOGIN_HOST=heidi.shack #LOGIN_HOST=heidi:5000 LOGIN_HOST=10.42.10.38:5000 all_led(){ - for i in 3g wlan lan wps;do - led $i $1 - done + for i in 3g wlan lan wps;do + led $i $1 + + done } led(){ - LED="$1" - ACTION="$2" - echo $ACTION > /sys/class/leds/tp-link:green:$LED/trigger + /usr/bin/mrled $1 $2 } + +# fix for mr3020 weirdness while sleep 1; do uid=$(nfc-list | grep UID | cut -d: -f 2 | sed 's/ //g') if ! [ x"$uid" = x ];then diff --git a/minikrebs/profiles/nfc-login/customfiles/usr/bin/mrled b/minikrebs/profiles/nfc-login/customfiles/usr/bin/mrled new file mode 100755 index 00000000..7059edd1 --- /dev/null +++ b/minikrebs/profiles/nfc-login/customfiles/usr/bin/mrled @@ -0,0 +1,4 @@ +#!/bin/sh +LED="$1" +ACTION="$2" +echo $ACTION > /sys/class/leds/tp-link:green:$LED/trigger -- cgit v1.2.3 From 715b2e23b0cb347dbf6b6516e5811e45406324ac Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 20 Jan 2013 19:24:19 +0100 Subject: minikrebs: init_overlay now does the right thing --- minikrebs/profiles/init_overlay | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) mode change 100644 => 100755 minikrebs/profiles/init_overlay diff --git a/minikrebs/profiles/init_overlay b/minikrebs/profiles/init_overlay old mode 100644 new mode 100755 index 3b714c39..e71cd151 --- a/minikrebs/profiles/init_overlay +++ b/minikrebs/profiles/init_overlay @@ -1,10 +1,22 @@ -#!/bin/sh +#!/bin/bash +cd $(dirname $(readlink -f $0)) [ ! -e overlay/ ] && echo "profile data for external overlay does not exist, bailing out" -[ ! -e doc/overlay ] && echo "Profile demands the following partitioning of the overlay usb stick:" && cat doc/overlay +[ -e doc/overlay ] && echo "Profile demands the following partitioning of the overlay usb stick:" && cat doc/OVERLAY if grep -q $PWD/mnt/overlay /etc/mtab;then - + echo "overlay mounted" + echo "copying overlay data:" + find overlay/ -mindepth 1 -maxdepth 1 | while read data; do + echo " $data -> mnt/overlay/$(basename $data)" + rm -rf mnt/overlay/$(basename $data) + cp -r $data mnt/overlay + done + echo + echo "unmounting overlay" + umount mnt/overlay/ else - echo "please mount your overlay to $PWD/overlay" + mkdir -p $PWD/mnt/overlay + echo "please mount your overlay to $PWD/mnt/overlay" fi + -- cgit v1.2.3 From f8d90b443fb71597b7f47fb0026861fd028ffab2 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Jan 2013 17:46:19 +0000 Subject: add service template --- services/services.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/services/services.txt b/services/services.txt index a2b97670..dc88cbac 100644 --- a/services/services.txt +++ b/services/services.txt @@ -1,2 +1,7 @@ -# this is a comment -TODO declare proper services format +owner: +type: +mail: +expires: +location: +services://{{hostname}}:22/ +tinc://{{hostname}}/ -- cgit v1.2.3 From 60c0873b5e07c11a78f8e7ed3a3462026d47c987 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 29 Jan 2013 17:50:49 +0000 Subject: add hosts/rage see services://rage:22 for more info --- retiolum/hosts/rage | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 retiolum/hosts/rage diff --git a/retiolum/hosts/rage b/retiolum/hosts/rage new file mode 100644 index 00000000..dd9a70e2 --- /dev/null +++ b/retiolum/hosts/rage @@ -0,0 +1,11 @@ +Subnet = 10.243.211.81 +Subnet = 42:73d5:8402:f8f1:0250:0bc3:e2ec:850d + +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEA6dOSRjCwkdx/nOSQwiiCw889YBSlf0ZAymBSaWJ+XdLnktqqZIvQ ++1RMdfpTTsIaHoLDwvBI6gW9dhV5MEeP3AlWfKPZAMCWg8l3PkTERZILWGSLiizs +zCyJgLpsb2MP7rT3RlLlHyTNdx9QXxDX2K1Y/fJsjXuTTgwg3JPlPM2huGTZtWgM +GDFsRpfe37hIuIheYBgnP99OvEgx3rLyCDvd16kIMd2Pjx4SouVQqaBmvEmg+UEH +zD79GaO7c2xkqq6JggJw1q/xZnH+5CF8280kh/niXVqy8R/hP75FU1rvjHnMJvfo +nyPGC8ir2m6iy4CR07YBIYo1PRTXGDC1vwIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From 06740db126e23f91b1db1d9e5458a7f903cec452 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 29 Jan 2013 19:02:10 +0100 Subject: add external address --- retiolum/hosts/rage | 1 + 1 file changed, 1 insertion(+) diff --git a/retiolum/hosts/rage b/retiolum/hosts/rage index dd9a70e2..35da19f6 100644 --- a/retiolum/hosts/rage +++ b/retiolum/hosts/rage @@ -1,3 +1,4 @@ +Address = 192.40.56.122 Subnet = 10.243.211.81 Subnet = 42:73d5:8402:f8f1:0250:0bc3:e2ec:850d -- cgit v1.2.3 From c2070c71abfbe4ae10ee9d66c8af4d31bfc901c9 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Jan 2013 14:19:16 +0100 Subject: retiolum/hosts/ire: initial commit --- retiolum/hosts/ire | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 retiolum/hosts/ire diff --git a/retiolum/hosts/ire b/retiolum/hosts/ire new file mode 100644 index 00000000..724158cb --- /dev/null +++ b/retiolum/hosts/ire @@ -0,0 +1,12 @@ +Address = 198.147.23.143 +Subnet = 10.243.231.66 +Subnet = 42:b912:0f42:a82d:0d27:8610:e89b:490c + +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEAwofjmP/XBf5pwsJlWklkSzI+Bo0I0B9ONc7/j+zpbmMRkwbWk4X7 +rVLt1cWvTY15ujg2u8l0o6OgEbIkc6rslkD603fv1sEAd0KOv7iKLgRpE9qfSvAt +6YpiSv+mxEMTpH0g36OmBfOJ10uT+iHDB/FfxmgGJx//jdJADzLjjWC6ID+iGkGU +1Sf+yHXF7HRmQ29Yak8LYVCJpGC5bQfWIMSL5lujLq4NchY2d+NZDkuvh42Ayr0K +LPflnPBQ3XnKHKtSsnFR2vaP6q+d3Opsq/kzBnAkjL26jEuFK1v7P/HhNhJoPzwu +nKKWj/W/k448ce374k5ycjvKm0c6baAC/wIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From ea60224f28cf702053d8fd06ef32cc683ed4aff1 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Jan 2013 18:48:09 +0100 Subject: //services test.py -> test-server.py --- services/Makefile | 2 +- services/test-server.py | 108 ++++++++++++++++++++++++++++++++++++++++++++++++ services/test.py | 108 ------------------------------------------------ 3 files changed, 109 insertions(+), 109 deletions(-) create mode 100755 services/test-server.py delete mode 100644 services/test.py diff --git a/services/Makefile b/services/Makefile index 3ef670a3..61e0f529 100644 --- a/services/Makefile +++ b/services/Makefile @@ -32,7 +32,7 @@ test-client: ssh localhost -p 1337 2>/dev/null test-server: - python test.py + ./test-server.py $(host_key_file): ssh-keygen -t rsa -P '' -f $@ diff --git a/services/test-server.py b/services/test-server.py new file mode 100755 index 00000000..ce8fbaa4 --- /dev/null +++ b/services/test-server.py @@ -0,0 +1,108 @@ +#! /usr/bin/env python2 + +from os import environ as env + +authorized_keys_file = env.get('authorized_keys_file', '/dev/null') +services_file = env.get('services_file', '/dev/null') +host_key_file = env.get('host_key_file', '/dev/null') +host_key_pub_file = host_key_file + '.pub' + + +from checkers import PublicKeyChecker +from twisted.conch.avatar import ConchUser +from twisted.conch.ssh.connection import SSHConnection +from twisted.conch.ssh.factory import SSHFactory +from twisted.conch.ssh.keys import Key +from twisted.conch.ssh.session import SSHSession, ISession, wrapProtocol +from twisted.conch.ssh.userauth import SSHUserAuthServer +from twisted.cred.error import UnauthorizedLogin +from twisted.cred.portal import IRealm, Portal +from twisted.internet.protocol import Protocol +from twisted.internet.reactor import listenTCP, run +from twisted.python.components import registerAdapter +from zope.interface import implements + +from twisted.python.log import startLogging +from sys import stderr +startLogging(stderr) + + +class MyRealm: + implements(IRealm) + + def requestAvatar(self, avatarId, mind, *interfaces): + return interfaces[0], MyUser(), lambda: None + + +class MyUser(ConchUser): + def __init__(self): + ConchUser.__init__(self) + self.channelLookup.update({ 'session': SSHSession }) + + +class MySession: + + def __init__(self, avatar): + pass + + def getPty(self, term, windowSize, attrs): + pass + + def execCommand(self, proto, cmd): + raise Exception("no executing commands") + + def openShell(self, trans): + ep = MyProtocol() + ep.makeConnection(trans) + trans.makeConnection(wrapProtocol(ep)) + + def eofReceived(self): + pass + + def closed(self): + pass + + +registerAdapter(MySession, MyUser, ISession) + + +def slurpTextfile(filename): + file = open(filename, 'r') + try: + return file.read() + finally: + file.close() + +class MyProtocol(Protocol): + def connectionMade(self): + data = slurpTextfile(services_file).replace('\n', '\r\n') + self.transport.write(data) + self.transport.loseConnection() + + #def dataReceived(self, data): + # if data == '\r': + # data = '\r\n' + # elif data == '\x03': #^C + # self.transport.loseConnection() + # return + # self.transport.write(data) + + +class MyFactory(SSHFactory): + privateKeys = { + 'ssh-rsa': Key.fromFile(filename=host_key_file) + } + publicKeys = { + 'ssh-rsa': Key.fromFile(filename=host_key_pub_file) + } + services = { + 'ssh-userauth': SSHUserAuthServer, + 'ssh-connection': SSHConnection + } + +if __name__ == '__main__': + portal = Portal(MyRealm()) + portal.registerChecker(PublicKeyChecker(authorized_keys_file)) + MyFactory.portal = portal + listenTCP(1337, MyFactory()) + run() diff --git a/services/test.py b/services/test.py deleted file mode 100644 index 06340a54..00000000 --- a/services/test.py +++ /dev/null @@ -1,108 +0,0 @@ -#! /usr/bin/env python - -from os import environ as env - -authorized_keys_file = env.get('authorized_keys_file', '/dev/null') -services_file = env.get('services_file', '/dev/null') -host_key_file = env.get('host_key_file', '/dev/null') -host_key_pub_file = host_key_file + '.pub' - - -from checkers import PublicKeyChecker -from twisted.conch.avatar import ConchUser -from twisted.conch.ssh.connection import SSHConnection -from twisted.conch.ssh.factory import SSHFactory -from twisted.conch.ssh.keys import Key -from twisted.conch.ssh.session import SSHSession, ISession, wrapProtocol -from twisted.conch.ssh.userauth import SSHUserAuthServer -from twisted.cred.error import UnauthorizedLogin -from twisted.cred.portal import IRealm, Portal -from twisted.internet.protocol import Protocol -from twisted.internet.reactor import listenTCP, run -from twisted.python.components import registerAdapter -from zope.interface import implements - -from twisted.python.log import startLogging -from sys import stderr -startLogging(stderr) - - -class MyRealm: - implements(IRealm) - - def requestAvatar(self, avatarId, mind, *interfaces): - return interfaces[0], MyUser(), lambda: None - - -class MyUser(ConchUser): - def __init__(self): - ConchUser.__init__(self) - self.channelLookup.update({ 'session': SSHSession }) - - -class MySession: - - def __init__(self, avatar): - pass - - def getPty(self, term, windowSize, attrs): - pass - - def execCommand(self, proto, cmd): - raise Exception("no executing commands") - - def openShell(self, trans): - ep = MyProtocol() - ep.makeConnection(trans) - trans.makeConnection(wrapProtocol(ep)) - - def eofReceived(self): - pass - - def closed(self): - pass - - -registerAdapter(MySession, MyUser, ISession) - - -def slurpTextfile(filename): - file = open(filename, 'r') - try: - return file.read() - finally: - file.close() - -class MyProtocol(Protocol): - def connectionMade(self): - data = slurpTextfile(services_file).replace('\n', '\r\n') - self.transport.write(data) - self.transport.loseConnection() - - #def dataReceived(self, data): - # if data == '\r': - # data = '\r\n' - # elif data == '\x03': #^C - # self.transport.loseConnection() - # return - # self.transport.write(data) - - -class MyFactory(SSHFactory): - privateKeys = { - 'ssh-rsa': Key.fromFile(filename=host_key_file) - } - publicKeys = { - 'ssh-rsa': Key.fromFile(filename=host_key_pub_file) - } - services = { - 'ssh-userauth': SSHUserAuthServer, - 'ssh-connection': SSHConnection - } - -if __name__ == '__main__': - portal = Portal(MyRealm()) - portal.registerChecker(PublicKeyChecker(authorized_keys_file)) - MyFactory.portal = portal - listenTCP(1337, MyFactory()) - run() -- cgit v1.2.3 From 96d04da93bcbd42e8d1b419fea659e5eb8764437 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Jan 2013 18:49:05 +0100 Subject: //services test-server: add systemd configuration --- services/etc/conf.d/krebs-services-test-server | 3 +++ .../etc/systemd/system/krebs-services-test-server.service | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 services/etc/conf.d/krebs-services-test-server create mode 100644 services/etc/systemd/system/krebs-services-test-server.service diff --git a/services/etc/conf.d/krebs-services-test-server b/services/etc/conf.d/krebs-services-test-server new file mode 100644 index 00000000..243054f4 --- /dev/null +++ b/services/etc/conf.d/krebs-services-test-server @@ -0,0 +1,3 @@ +authorized_keys_file=/krebs/services/authorized_keys +services_file=/opt/services/services.txt +host_key_file=/opt/services/test.key diff --git a/services/etc/systemd/system/krebs-services-test-server.service b/services/etc/systemd/system/krebs-services-test-server.service new file mode 100644 index 00000000..99578cce --- /dev/null +++ b/services/etc/systemd/system/krebs-services-test-server.service @@ -0,0 +1,14 @@ +[Unit] +Description=services: provider +After=network.target + +[Service] +EnvironmentFile=/etc/conf.d/krebs-services-test-server +ExecStart=/krebs/services/test-server.py +KillMode=process +User=services +Group=services +Restart=no + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3 From c17d13380945c0909adeddd2375c1c9c8aa26782 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Jan 2013 18:57:49 +0100 Subject: //services test-server: log only if debug_log == 'true' --- services/Makefile | 1 + services/test-server.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/services/Makefile b/services/Makefile index 61e0f529..37931f47 100644 --- a/services/Makefile +++ b/services/Makefile @@ -1,5 +1,6 @@ help:;@cat Makefile export authorized_keys_file := authorized_keys +export debug_log := true export services_file := services.txt export host_key_file := test.key export services_home := /opt/services diff --git a/services/test-server.py b/services/test-server.py index ce8fbaa4..7838e0af 100755 --- a/services/test-server.py +++ b/services/test-server.py @@ -3,6 +3,7 @@ from os import environ as env authorized_keys_file = env.get('authorized_keys_file', '/dev/null') +debug_log = env.get('debug_log', 'false') services_file = env.get('services_file', '/dev/null') host_key_file = env.get('host_key_file', '/dev/null') host_key_pub_file = host_key_file + '.pub' @@ -22,9 +23,10 @@ from twisted.internet.reactor import listenTCP, run from twisted.python.components import registerAdapter from zope.interface import implements -from twisted.python.log import startLogging -from sys import stderr -startLogging(stderr) +if debug_log == 'true': + from twisted.python.log import startLogging + from sys import stderr + startLogging(stderr) class MyRealm: -- cgit v1.2.3 From 0c37512813f26c098e2c1d34c42e6b843009e9b2 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 30 Jan 2013 01:12:06 +0100 Subject: //service README: install test-server.py as systemd service on arch --- services/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 services/README.md diff --git a/services/README.md b/services/README.md new file mode 100644 index 00000000..eff94113 --- /dev/null +++ b/services/README.md @@ -0,0 +1,28 @@ +# //services + +## install and run test-server.py as systemd service + +### install dependencies + + pacman -S python2-pyasn1 twisted + +### install systemd service and configuration + + cp /krebs/services/etc/systemd/system/krebs-services-test-server.service \ + /etc/systemd/system/ + + cp /krebs/services/etc/conf.d/krebs-services-test-server \ + /etc/conf.d/ + +### create services user + + useradd -m -r -l -f -1 -d /opt/services -k /var/empty services + +### configure test-server.py + + $EDITOR /opt/services/services.txt + +### run + + systemctl enable krebs-services-test-server + systemctl start krebs-services-test-server -- cgit v1.2.3 From 9577db8e98c94e0b8e36fed70cfd246f98f0344a Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 30 Jan 2013 01:16:39 +0100 Subject: //services README: generate test.key --- services/README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/services/README.md b/services/README.md index eff94113..e0769bce 100644 --- a/services/README.md +++ b/services/README.md @@ -10,19 +10,16 @@ cp /krebs/services/etc/systemd/system/krebs-services-test-server.service \ /etc/systemd/system/ - cp /krebs/services/etc/conf.d/krebs-services-test-server \ /etc/conf.d/ -### create services user +### create services user and populate it's home useradd -m -r -l -f -1 -d /opt/services -k /var/empty services - -### configure test-server.py - + sudo -u services ssh-keygen -t rsa -P '' -f /opt/services/test.key $EDITOR /opt/services/services.txt -### run +### run now and every reboot - systemctl enable krebs-services-test-server systemctl start krebs-services-test-server + systemctl enable krebs-services-test-server -- cgit v1.2.3 From 46ba0880900d5696024a615ac393d485f9adfaba Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 30 Jan 2013 01:48:27 +0100 Subject: //services/bin/services: ControlMaster=no --- services/bin/services | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/bin/services b/services/bin/services index c142a363..957d197a 100755 --- a/services/bin/services +++ b/services/bin/services @@ -8,6 +8,8 @@ user=services hostname=${1-localhost} port=1337 +options="${options+$options }-o ControlMaster=no" + if test -n "${services_identity_file-}"; then options="${options+$options }-i $services_identity_file" fi -- cgit v1.2.3 From e282afbe09cc5d44b1b3329a9bc199a780be7300 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 30 Jan 2013 02:10:39 +0100 Subject: //services/bin/services: filter boring stderr --- services/bin/services | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/bin/services b/services/bin/services index 957d197a..113480ee 100755 --- a/services/bin/services +++ b/services/bin/services @@ -23,4 +23,11 @@ if echo $hostname | grep -q :; then hostname=`echo $hostname | cut -d: -f1` fi +exec 3>&1 +{ ssh $options $user@$hostname -p $port +} 2>&1 1>&3 | sed ' + /^Connection to '$hostname' closed/d + /^Shared connection to '$hostname' closed/d +' +exec 3>&- -- cgit v1.2.3 From 6da636908a84d1703932a5806f03301b4043a258 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 30 Jan 2013 02:13:50 +0100 Subject: //services/bin/services: fix indentation --- services/bin/services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/bin/services b/services/bin/services index 113480ee..e854cbcb 100755 --- a/services/bin/services +++ b/services/bin/services @@ -25,7 +25,7 @@ fi exec 3>&1 { -ssh $options $user@$hostname -p $port + ssh $options $user@$hostname -p $port } 2>&1 1>&3 | sed ' /^Connection to '$hostname' closed/d /^Shared connection to '$hostname' closed/d -- cgit v1.2.3 From 695a7acf30d0f6be1191a162fe147d4810210c52 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 30 Jan 2013 12:44:07 +0100 Subject: //ovh -> //ext/ovh --- ext/ovh/README | 31 + ext/ovh/soapi/Makefile | 25 + ext/ovh/soapi/README | 1 + ext/ovh/soapi/domainCapabilities | 29 + ext/ovh/soapi/domainInfo | 29 + ext/ovh/soapi/domainList | 28 + ext/ovh/soapi/soapi-re-1.24.wsdl | 20105 +++++++++++++++++++++++++++++++++++++ ext/ovh/soapi/zoneEntryAdd | 33 + ext/ovh/soapi/zoneEntryDel | 33 + ext/ovh/soapi/zoneEntryList | 29 + ext/ovh/soapi/zoneExport | 29 + ext/ovh/soapi/zoneImport | 33 + ovh/README | 31 - ovh/soapi/Makefile | 25 - ovh/soapi/README | 1 - ovh/soapi/domainCapabilities | 29 - ovh/soapi/domainInfo | 29 - ovh/soapi/domainList | 28 - ovh/soapi/soapi-re-1.24.wsdl | 20105 ------------------------------------- ovh/soapi/zoneEntryAdd | 33 - ovh/soapi/zoneEntryDel | 33 - ovh/soapi/zoneEntryList | 29 - ovh/soapi/zoneExport | 29 - ovh/soapi/zoneImport | 33 - 24 files changed, 20405 insertions(+), 20405 deletions(-) create mode 100644 ext/ovh/README create mode 100644 ext/ovh/soapi/Makefile create mode 100644 ext/ovh/soapi/README create mode 100755 ext/ovh/soapi/domainCapabilities create mode 100755 ext/ovh/soapi/domainInfo create mode 100755 ext/ovh/soapi/domainList create mode 100644 ext/ovh/soapi/soapi-re-1.24.wsdl create mode 100755 ext/ovh/soapi/zoneEntryAdd create mode 100755 ext/ovh/soapi/zoneEntryDel create mode 100755 ext/ovh/soapi/zoneEntryList create mode 100755 ext/ovh/soapi/zoneExport create mode 100755 ext/ovh/soapi/zoneImport delete mode 100644 ovh/README delete mode 100644 ovh/soapi/Makefile delete mode 100644 ovh/soapi/README delete mode 100755 ovh/soapi/domainCapabilities delete mode 100755 ovh/soapi/domainInfo delete mode 100755 ovh/soapi/domainList delete mode 100644 ovh/soapi/soapi-re-1.24.wsdl delete mode 100755 ovh/soapi/zoneEntryAdd delete mode 100755 ovh/soapi/zoneEntryDel delete mode 100755 ovh/soapi/zoneEntryList delete mode 100755 ovh/soapi/zoneExport delete mode 100755 ovh/soapi/zoneImport diff --git a/ext/ovh/README b/ext/ovh/README new file mode 100644 index 00000000..90b34108 --- /dev/null +++ b/ext/ovh/README @@ -0,0 +1,31 @@ +#? /bin/sh +# This is the project to use the SOAP connector of OVH to change zone +# entries for krebsco.de +set -euf + +# install ovh soapi + +cd /path/to/krebscode/painload + + +make -C ovh/soapi install +// if the command breaks, try: +// pip install soappy + +# edit the zone + +export PATH="$PWD/bin${PATH+:$PATH}" +export KREBS_OVH_USER=... +export KREBS_OVH_PASS=... +// Optional: +// export KREBS_OVH_DOMAIN=... + + +zoneEntryAdd "krebsco.de" "subdomain" "A" "a.b.c.d." + +# ZoneExport Broken since 2012-07-16 +# zoneExport > /tmp/foo +# $EDITOR /tmp/foo +# zoneImport < /tmp/foo + +# Have a nice day!^_^ diff --git a/ext/ovh/soapi/Makefile b/ext/ovh/soapi/Makefile new file mode 100644 index 00000000..15ef8f3f --- /dev/null +++ b/ext/ovh/soapi/Makefile @@ -0,0 +1,25 @@ +.PHONY: all install +all: select-target + +exes := $(shell \ + find . -mindepth 1 -maxdepth 1 -type f -executable -exec basename \{\} \;) + +target_exes := $(addprefix ../../bin/,$(exes)) + +install: $(target_exes) + +../../bin/%: % SOAPpy + ln -snf ../ovh/soapi/$* $@ + +src: + mkdir $@ + +src/SOAPpy: src + cd $< && \ + svn co https://pywebsvcs.svn.sourceforge.net/svnroot/pywebsvcs/trunk/SOAPpy + +src/SOAPpy/build/lib/SOAPpy: src/SOAPpy + cd $< && python setup.py build + +SOAPpy: src/SOAPpy/build/lib.linux-x86_64-2.6/SOAPpy + ln -snf $< diff --git a/ext/ovh/soapi/README b/ext/ovh/soapi/README new file mode 100644 index 00000000..42ad5ebf --- /dev/null +++ b/ext/ovh/soapi/README @@ -0,0 +1 @@ +https://www.ovh.com/soapi/en/ diff --git a/ext/ovh/soapi/domainCapabilities b/ext/ovh/soapi/domainCapabilities new file mode 100755 index 00000000..a438e0b8 --- /dev/null +++ b/ext/ovh/soapi/domainCapabilities @@ -0,0 +1,29 @@ +#!/usr/bin/python + +from os import environ +from os.path import dirname, realpath +from SOAPpy import WSDL +from json import dumps, JSONEncoder + +def default(o): + try: + iterable = iter(o) + except TypeError: + pass + else: + return list(iterable) + return JSONEncoder.default(o) + +wsdl = dirname(realpath(__file__)) + '/soapi-re-1.24.wsdl' +soap = WSDL.Proxy(wsdl) + +username = environ['KREBS_OVH_USER'] +password = environ['KREBS_OVH_PASS'] +domain = environ.get('KREBS_OVH_DOMAIN','krebsco.de') + +session = soap.login(username, password, 'de', 0) + +result = soap.domainCapabilities(session, domain) +print dumps(result, sort_keys=True, indent=2, default=default) + +soap.logout(session) diff --git a/ext/ovh/soapi/domainInfo b/ext/ovh/soapi/domainInfo new file mode 100755 index 00000000..35459d06 --- /dev/null +++ b/ext/ovh/soapi/domainInfo @@ -0,0 +1,29 @@ +#!/usr/bin/python + +from os import environ +from os.path import dirname, realpath +from SOAPpy import WSDL +from json import dumps, JSONEncoder + +def default(o): + try: + iterable = iter(o) + except TypeError: + pass + else: + return list(iterable) + return JSONEncoder.default(o) + +wsdl = dirname(realpath(__file__)) + '/soapi-re-1.24.wsdl' +soap = WSDL.Proxy(wsdl) + +username = environ['KREBS_OVH_USER'] +password = environ['KREBS_OVH_PASS'] +domain = environ.get('KREBS_OVH_DOMAIN','krebsco.de') + +session = soap.login(username, password, 'de', 0) + +result = soap.domainInfo(session, domain) +print dumps(result, sort_keys=True, indent=2, default=default) + +soap.logout(session) diff --git a/ext/ovh/soapi/domainList b/ext/ovh/soapi/domainList new file mode 100755 index 00000000..342eec72 --- /dev/null +++ b/ext/ovh/soapi/domainList @@ -0,0 +1,28 @@ +#!/usr/bin/python + +from os import environ +from os.path import dirname, realpath +from SOAPpy import WSDL +from json import dumps, JSONEncoder + +def default(o): + try: + iterable = iter(o) + except TypeError: + pass + else: + return list(iterable) + return JSONEncoder.default(o) + +wsdl = dirname(realpath(__file__)) + '/soapi-re-1.24.wsdl' +soap = WSDL.Proxy(wsdl) + +username = environ['KREBS_OVH_USER'] +password = environ['KREBS_OVH_PASS'] + +session = soap.login(username, password, 'de', 0) + +result = soap.domainList(session) +print dumps(result, sort_keys=True, indent=2, default=default) + +soap.logout(session) diff --git a/ext/ovh/soapi/soapi-re-1.24.wsdl b/ext/ovh/soapi/soapi-re-1.24.wsdl new file mode 100644 index 00000000..c628c564 --- /dev/null +++ b/ext/ovh/soapi/soapi-re-1.24.wsdl @@ -0,0 +1,20105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +