GithubHelp home page GithubHelp logo

powerdns-admin / powerdns-admin Goto Github PK

View Code? Open in Web Editor NEW
2.4K 87.0 633.0 35.34 MB

A PowerDNS web interface with advanced features

License: MIT License

Python 50.48% HTML 44.53% Shell 0.16% Mako 0.04% Dockerfile 0.44% CSS 0.93% JavaScript 3.36% Batchfile 0.05%
powerdns powerdns-web-gui powerdns-admin pdns

powerdns-admin's Issues

Show warning if different TTL for records with same name + type

As per #74, we should show a warning if trying to "Apply" where records of same name and type has different TTL's.

For example;

example.com IN NS 3600 ns1.example.com
example.com IN NS 86400 ns2.example.com

Should yield a warning. Currently one of the records would be deleted when hitting "Apply".

Suggestion: Add the option to increment SOA serial on update

Setting kind to SOA-EDIT-API and content to INCEPTION-INCREMENT in the domainmetadata table in PDNS allows API edits to trigger an increment in the SOA serial.

This metadata entry can be enabled via the API by passing in the below JSON during domain creation.
"soa_edit_api": "INCEPTION-INCREMENT"

This is also editable after domain creation.

Suggestion: add a check-box to allow the user to enable this option during domain creation, or add the ability to modify domain metadata.

Suggestion: dyndns2 support

I'd like to suggest adding 'dyndns2' protocol support. This will allow dynamic updates of DNS entries via third-party software (ddclient and many consumer routers).

I've created a branch here that adds this support. I've tested it with ddclient 3.8.1 using the 'dyndns2' protocol and it works well. I'll be rolling this out to replace a portion of my current custom Poweradmin + dynds2 setup to see how well it works with more use.

Current functionality mirrors the DynDNS RA-API described here except for:

  • Only 'Authorization:' header based authentication is supported. The RA-API supports both header and URL based authentication.
  • Only one record can be updated per request. The RA-API allows up to 20 records per request.

The return codes have been reduced for simplicity, here is the RA-API reference. The only return codes used by the new code are:

  • noauth: user could not authenticate against the powerdns-admin database
  • good: the record was updated successfully
  • nochg: the current content of the record matches the proposed update
  • 911: error

@ngoduykhanh please review the branch when you have a moment, and if it meets your intentions for this software let me know and I can submit a pull request. I'd prefer not to maintain it separately from the mainline PowerDNS-Admin, but I will as long as I still have a need for it. :)

Software licence

Hi,

Could you include licence for your code? We are interested in forking this repo as a base for our own DNS admin panel!

  • mattirk

Make width 100%

It would be great, if you could change the width to 100%. Else the space is not used.

Fonts from google are getting blocked if requested from http when PdnsAd. is run via https

When running PowerDNS-Admin via https, and using Chrome, one gets the following error:

Mixed Content: The page at 'https://dnsadmin.net/pdnsadmin/domain/example.com' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all'. This request has been blocked; the content must be served over HTTPS.

That is because of the links in the head:

<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css"/>
 <link href='http://fonts.googleapis.com/css?family=Roboto+Mono:400,300,700' rel='stylesheet' type='text/css'>

The files in question are:

app/templates/base.html
app/templates/login.html

Related: #30

Enable/disable DNSSEC

Hi,

Slightly relevant to #2 -- is PowerDNS-Admin supposed to automatically detect if a zone is DNSSEC-enabled?

Currently I have a zone that I have DNSSEC-enabled (via the proper PowerDNS utilities), and the different keys are present. The domain is still listed as "Disabled" within PowerDNS-Admin. However, clicking the "Disabled"-button, it shows the relevant DNSSEC-information.

I looked at the code, and I can't find anywhere where the dnssec option would be set to true. The only place I could find, was in Domain.update(), but since there are no place to set true/false within the GUI, this option is never set (regardless if Domain.get_domain_dnssec() is called when clicking on the "Disabled" button).

Can't apply changes - loginKey 'priority' not an Integer or not present

Running powerdns 3.4.1-4+deb8u3 on Debian 8 and latest version for PowerDNS-Admin console. I can login but when trying to apply changes (add record) I get this error: loginKey 'priority' not an Integer or not present. I noticed something about 'priority' in https://doc.powerdns.com/md/authoritative/upgrading/ but that's only in 3.4.2. Any idea what's going on? Logs show:

[INFO] 10.168.100.2 - - [20/Jan/2016 17:16:38] "POST /domain/mydomain.io/apply HTTP/1.1" 200 -
[ERROR] Cannot apply record changes.
[DEBUG] Key 'priority' not an Integer or not present

Thanks in advance, it looks like a really nice web ui so I hope we can use it!

EDIT: Exact frontend error: '{ "msg": "Key 'priority' not an Integer or not present", "status": "error" }'

Add wsgi example

Just a small suggestion to add an example configuration for running PowerDNS-Admin in apache.

I managed to get it to work on a debian 8.3 machine as follows:

My PowerDNS-Admin files are located under /opt/powerdnsadmin and I've created a user called pdnsadmin and a group called pdnsadmin.

change the owner of /opt/powerdnsadmin and everything within it:

sudo chown -R pdnsadmin:pdnsadmin /opt/powerdnsadmin

install libapache2-mod-wsgi:

sudo apt-get install libapache2-mod-wsgi

create /opt/powerdnsadmin/powerdnsadmin.wsgi with the following content:

#!flask/bin/python

import sys
sys.path.insert(0, '/opt/powerdnsadmin')

from app import app as application
from config import PORT

(I'm not sure if the line from config import PORT is needed in the wsgi file.)

add the following to your apache virtualhost:

WSGIDaemonProcess pdnsadmin user=pdnsadmin group=pdnsadmin threads=5
WSGIScriptAlias / /opt/powerdnsadmin/powerdnsadmin.wsgi

<Directory /opt/powerdnsadmin>
    WSGIProcessGroup pdnsadmin
    WSGIApplicationGroup %{GLOBAL}
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

Restart apache.

This setup is working for me.

Break lines when displaying records, which are very long

When you have a long record, f.e. a dkim key which can go up to 254 chars, PowerDNS-Admin does not break the lines in order to be more compact.

This affects how all the records are displayed, that is that the 'Data' field becomes unnecessary long.

Wrong record is deleted

Hi,

I've setup a domain with the following records (domain names and ip addresses have been changed here for the example of course)

@       A       Active       3600       192.168.0.1
@       MX      Active       3600       10 mx1.example.com 
@       MX      Active       3600       40 mx2.example.com 
@       NS      Active       3600       ns1.example.com 
@       NS      Active       3600       ns2.example.com
@       SPF     Active       3600       "v=spf1 a mx ptr mx:mail.example.com ~all" 
@       TXT     Active       3600       "v=spf1 a mx ptr mx:mail.example.com ~all" 
www     CNAME   Active       3600       web.example.com

When I then try to delete a record it's always deleting the topmost record instead of the selected record.

I am using Powerdns 3.4.7

dpkg -l | grep pdns
ii  pdns-backend-mysql                   3.4.7-1~bpo8+1              amd64        generic MySQL backend for PowerDNS
ii  pdns-server                          3.4.7-1~bpo8+1              amd64        extremely powerful and versatile nameserver

I did a git pull origin earlier today.
Is this something in my setup or could this be a bug?

Doc add-on: how-to run via uwsgi and nginx

Hello,

maybe it can be of some use for you:

.ini for uwsgi:
(Be advised to change the plugins = python27 to whatever is correspondent with your setup of uwsgi)

[uwsgi]
plugins = python27

uid=nginx
gid=nginx

pythonpath = /the_place_of/PowerDNS-Admin/
virtualenv = /the_place_of/PowerDNS-Admin/flask

module = app
callable = app

master = true
vacuum = true
harakiri = 20
#lazy-apps = true
max-requests = 2500
buffer-size = 32768
post-buffering = 8192
socket = /run/%n.socket
chown-socket = nginx

#workers = 4
#threads = 2

daemonize = /var/log/uwsgi/%n.log

# set cheaper algorithm to use, if not set default will be used
cheaper-algo = spare
# minimum number of workers to keep at all times
cheaper = 2
# number of workers to spawn at startup
cheaper-initial = 2
# maximum number of workers that can be spawned
workers = 15
# how many workers should be spawned at a time
cheaper-step = 1

enable-threads


route-run = fixpathinfo:

thunder-lock

nginx:

        location /pdns/ {
                include uwsgi_params;
                uwsgi_pass unix:/run/THE_PART_BEFORE_ini_of_your_uwsgi.ini_file.socket;
                uwsgi_param UWSGI_SCHEME https;
                uwsgi_param SCRIPT_NAME /pdns;
        }

        location /pdns/static/ {
               alias /the_place_of/PowerDNS-Admin/app/static/;
        }

Sorting of records

Hi,

Sorting of records should probably take numbers into account. Specially for IPv4 PTR zones.

In the below example, I would expect the first page to be filled with 0-14 (and not 0,1,100-109,11,110).

Sorting

Error 500...

Somehow I cannot get PowerDNS-Admin to work under uwsgi.
The latest errors I get are like this one:

2016-06-26 15:23:13,887 - app - ERROR - Exception on /error/500 [GET]
Traceback (most recent call last):
  File "/PowerDNS-Admin/flask/lib/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/PowerDNS-Admin/flask/lib/python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/PowerDNS-Admin/flask/lib/python2.7/site-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/PowerDNS-Admin/flask/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/PowerDNS-Admin/flask/lib/python2.7/site-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/PowerDNS-Admin/app/views.py", line 122, in error
    return render_template('errors/%s.html' % code, msg=msg), int(code)
  File "/PowerDNS-Admin/flask/lib/python2.7/site-packages/flask/templating.py", line 132, in render_template
    ctx.app.update_template_context(context)
  File "/PowerDNS-Admin/flask/lib/python2.7/site-packages/flask/app.py", line 765, in update_template_context
    context.update(func())
  File "/PowerDNS-Admin/app/views.py", line 27, in inject_fullscreen_layout_setting
    return dict(fullscreen_layout_setting=strtobool(fullscreen_layout_setting.value))
AttributeError: 'NoneType' object has no attribute 'value'

Official systemd support

Hi,

It would be great to get official systemd support with a powerdns-admin.service file.
Really nice WebUI btw.

Thanks in advance,
HLFH

current version cannot insert/update any records with PDNS 4.0.0

Hi,

It seems that I cannot make any changes to records with pdns 4.0.0 (rc2).
Is this a known issue (as there seems to be support for 4.0.0)?

I'm willing to work on this issue if it's known to be broken with 4.0.0 (and someone else isn't doing that already)

Thanks,
Alex.

Gravatar

Hi,

Could Gravatar-support be added, as an alternative to uploading avatars?

Auto PTR

Please, add support for ptr records auto generation, probably with "Create PTR" checkbox

ie if i added "foo.bla.com. A 10.0.0.1" record and have domain "0.0.10.in-addr.arpa" configured,
then create "1.0.0.10.in-addr.arpa PTR foo.bla.com" too

Can't change MX record

Hi, when edit an MX record I get a popup with a dialog asking for Server Name and Priority, like you would expect. The server name that is already in the record that I'm editing isn't pre-filled in, instead the "Server Name" field says 'undefined'.
Then, when I fill in my server name and a priority of 10 it will add a record for it like so:
@ MX Active 3600 10 mx1.example.com

but when I then click 'Apply Changes' I get the following message:
{ "msg": "Record example.com/MX 10 mx1.example.com: All data was not consumed", "status": "error" }

Not sure if this is an issue with PowerDNS or with PowerDNS-Admin.

default_domain_table_size

Hi,

Should add default_domain_table_size that defines the default number of domains to show. Currently this can only be changed by manually adding pageLength to app/templates/dashboard.html.

postgresql?

Hello,

could you please provide install instructions for use with postgresql?

I got the app running (via uwsgi/nginx), also I got it to run under postgresql, unfortunately it does not show any dns records at all. I have to assume that the db setup I did is somehow wrong.

pdns logs say it transmits the json data.

Many thanks

When trying to login with a user after the first user is created it fails.

When trying to login with a user after the first user is created it fails.
If I delete the first user from the DB (after ldap login created it), I can login with a different user and it will create this user in the DB. I cannot however login with another user where it would be the second user in the DB. Please advise.

PSQL Support?

Do I need to install MySQL or is there a flag or something I can use to use postgres?

GitHub Wiki

Hi @ngoduykhanh!

I've started a wiki in my fork, but I'm not sure how to set up a wiki PR to the main repo (based on my quick search, it might not even be possible...). Take a look to see if you'd like to integrate it into the main repo. I'd like to fill it up with guides about installation on various systems, integrating AD, LDAP, DynDns, etc.

The wiki is here.

Support for PowerDNS 4.x

Hi,

Will you be supporting PowerDNS 4.x? I got it to work nicely on version 3 but on 4 I can only see the domains, not the records under a domain (I get a 500 error then).

Cheers,
Taco

Minify JS / CSS

Hey @ngoduykhanh

Not sure if you would want a PR or not but on my fork I have minified the JS/CSS in efforts to increase the speed on large deployments.

Let me know if you want it and ill send a PR

Feature: Add local Users

The WebUI has a section "manage users", which is great but it lacks the option to add new users. This would be a great additional feature. I disabled registration after I created the first admin user, so nobody can register and mess with my dns records.

Master & Slave NS Setup

Hello All,

I followed the DigitalOcean tutorial to set up master and slave servers. In order for the domain to replicate, there must be 2 NS records in the domain. I don't see an option to add NS records. Am I missing something?

Default admin user?

When I try to sign up I get:

(_mysql_exceptions.IntegrityError) (1452, 'Cannot add or update a child row: a foreign key constraint fails (powerdnsadmin.user, CONSTRAINT user_ibfk_1 FOREIGN KEY (role_id) REFERENCES role (id))') [SQL: u'INSERT INTO user (username, password, firstname, lastname, email, avatar, role_id) VALUES (%s, %s, %s, %s, %s, %s, %s)'] [parameters: ('bryan_seitz', 'hash was here, 'Bryan', 'Seitz', '[email protected], None, 1)]

Is there a default admin user ?

Dyndns - /nic/checkip.html doesn't seem to work

All I get is "None" as a response when I call it. Am I missing something? I thought this was supposed to return the IP you're coming from.

mine:~ tren$ curl -v "http://10.21.4.1:9393/nic/checkip.html"
*   Trying 10.21.4.1...
* Connected to 10.21.4.1 (10.21.4.1) port 9393 (#0)
> GET /nic/checkip.html HTTP/1.1
> Host: 10.21.4.1:9393
> User-Agent: curl/7.48.0
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Content-Type: text/html; charset=utf-8
< Content-Length: 4
< Server: Werkzeug/0.11.10 Python/2.7.5
< Date: Fri, 01 Jul 2016 21:17:19 GMT
<
* Closing connection 0
None

Thank you!

Setting up a domain

Ok so I have a dummy domain, adivix.org where my registrar points to my IP address as the place to check for all DNS records. So how do I properly setup the records where the DNS records are setup to point to specific servers on the local network.

Let's take this for example:

192.168.1.100 - IP Address of my DNS server
192.168.1.101 - IP Address of my website host (A record)
192.168.1.102 - IP Address of my mail server (MX record)

So how would I properly set this up so it would properly resolve to local servers on my network (all this is behind a NAT/Firewall/Router) in PowerDNS-Admin?

template for new domains

A thought for a new feature:

Having an editable template to be applied when adding a new domain. Application of the template should be optional.

Password reset option

Hi,

I'm missing an option to reset the password for a user when logged in as administrator.

I think it would be nice to have an option where an administrator can send an email with new (generated) password to a user.

Also would be nice to have a 'forgot password' option on the login page so that a user can have a password reset url sent to his email address.

Under uwsgi, some actions lead to 404 errors.

When I want to toggle the fullscreen_layout f.e. I get the following error message inside my logs:

2016/06/27 15:54:35 [error] 2287#0: *7603 open() "/var/www/admin/setting/fullscreen_layout/toggle" failed (2: No such file or directory), client: XX.XX.XX.XX, server: mememe.tld, request: "POST /admin/setting/fullscreen_layout/toggle HTTP/2.0", host: "host.tld", referrer: "https://host.tld/admin/settings"

Nothing happens thereafter. Basically all the new settings are affected by this.

Ubuntu

I am interested in using this on Ubuntu 14.04 and the upcoming version of Ubuntu. Would this software be supported on that distro or this up in the air?

Login does not complete behind a reverse proxy

For example, my BIND_ADDRESS is 10.0.0.1, and I've got a reverse proxy serving it. When login happens and the user is redirected, for some reason, it redirects to 10.0.0.1:9393. Is there a way to override this behaviour?

TTL for NS-records is "stuck"

Hi,

Trying to change the NS-records for my domains. They are defaulted to 3600 (1 hour). Trying to change these to 86400 (24 hours). I set the value (for all the NS-records), hit "Save", then "Apply". Update successful. Refresh domain/page, old values are displayed (and is also what resides in the DB).

PowerDNS 4.0.0rc2 + PostgreSQL DB backend.

LDAP as default on login.html

Hi,

When LDAP is enabled; could it also be the default in the authentication-dropdown list? Or at least configurable to be the default choice?

I could of course just edit app/templates/login.html and alter it there, but would be nice if it was configurable in some way.

Unable to Delete Domain

During PDNS setup, I created the test entries for example.com (see powerdns documentation).
After I installed PowerDNS-Admin, I created all my domains and their DNS records and resolution works fine.

However, I can't delete the example.com domain. I was able to delete all records for the domain, using the web UI, but when I go to manage -> delete domain and accept the permanent deletion, I get redirected to the domain overview and example.com is still there. There's no log entry in the GUI logfile, and only the following in uwsgi/app/powerdnsadmin.log

GET /admin/domain/example.com/manage => generated 19857 bytes in 23 msecs (HTTP/1.1 200) 3 headers in 416 bytes (1 switches on core 0)
/ => generated 227 bytes in 9 msecs (HTTP/1.1 302) 4 headers in 472 bytes (1 switches on core 0)
GET /admin/domain/example.com/manage => generated 19857 bytes in 23 msecs (HTTP/1.1 200) 3 headers in 416 bytes (1 switches on core 0)

The same goes for domains I created directly in the WebUI.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.