summaryrefslogtreecommitdiffstats
path: root/server/master.py
diff options
context:
space:
mode:
Diffstat (limited to 'server/master.py')
-rw-r--r--server/master.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/server/master.py b/server/master.py
index bcb3076..e9be8b1 100644
--- a/server/master.py
+++ b/server/master.py
@@ -1,24 +1,26 @@
import flask
from flask import request
-from backends import OVHBackend
+from backends import PowerDNSBackend
from utils import verify_token
app = flask.Flask(__name__)
app.config.from_pyfile('config.cfg')
-app.backend = OVHBackend(app.config)
+app.backend = PowerDNSBackend(app.config)
@app.route('/api/1/add')
@verify_token
def add():
- app.backend.add('_acme-challenge.'+request.args['record'], request.args['value'])
+ name, type_ = request.args['record'].rsplit(':', 1)
+ app.backend.add(name, request.args['value'], type_)
return 'ok'
-@app.route('/api/1/remove')
+@app.route('/api/1/delete')
@verify_token
-def remove():
- app.backend.remove('_acme-challenge.'+request.args['record'])
+def delete():
+ name, type_ = request.args['record'].rsplit(':', 1)
+ app.backend.delete(name, type_)
return 'ok'