1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-09 16:37:23 +01:00

allow overriding the second nameserver with a secondary/slave server

fixes #151
fixes #223
This commit is contained in:
Joshua Tauberer
2014-10-05 14:53:42 +00:00
parent 092c842a87
commit f42a1c5a74
4 changed files with 135 additions and 12 deletions

View File

@@ -180,6 +180,22 @@ def dns_update():
except Exception as e:
return (str(e), 500)
@app.route('/dns/secondary-nameserver')
@authorized_personnel_only
def dns_get_secondary_nameserver():
from dns_update import get_custom_dns_config
return json_response({ "hostname": get_custom_dns_config(env).get("_secondary_nameserver") })
@app.route('/dns/secondary-nameserver', methods=['POST'])
@authorized_personnel_only
def dns_set_secondary_nameserver():
from dns_update import set_secondary_dns
try:
return set_secondary_dns(request.form.get('hostname'), env)
except ValueError as e:
return (str(e), 400)
@app.route('/dns/set/<qname>', methods=['POST'])
@app.route('/dns/set/<qname>/<rtype>', methods=['POST'])
@app.route('/dns/set/<qname>/<rtype>/<value>', methods=['POST'])