Coder Social home page Coder Social logo

allegro / django-powerdns-dnssec Goto Github PK

View Code? Open in Web Editor NEW
27.0 11.0 17.0 734 KB

Django application managing PowerDNS database

Home Page: http://django-powerdns-dnssec.readthedocs.org

License: BSD 2-Clause "Simplified" License

Python 76.45% HTML 7.45% Makefile 0.07% JavaScript 1.24% TypeScript 14.52% CSS 0.27%

django-powerdns-dnssec's Introduction

django-powerdns-dnssec

Welcome to the PowerDNS app for Django.

This application allows easy administration of PowerDNS records stored in an SQL database by leveraging the standard Django Admin app. You may also use the Django PowerDNS application as part of a larger project to programatically modify your DNS records.

Note: This is an updated and enhanced fork of django-powerdns which looks abandoned as of November 2012.

Project status

This project is deprecated and not maintained anymore.

Authors

Application written by Peter Nixon and Łukasz Langa. NSEC3 code based on George Notaras' work with django-powerdns-manager. The application is now developed by Allegro pyLabs <[email protected]>

ReadTheDocs

https://travis-ci.org/allegro/django-powerdns-dnssec.svg?branch=develop

django-powerdns-dnssec's People

Contributors

ambv avatar andrzej-jankowski avatar ar4s avatar blag avatar dominik-kowalski avatar dominikkowalski avatar iavael avatar mkurek avatar mzdeb avatar peternixon avatar quamilek avatar szok avatar zefciu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-powerdns-dnssec's Issues

Tutorial is missing

Tutorial is a detailed list of steps/interactions with the system, which result in achieving some particular goal.

Current project is missing this.

PyPi

Unable to install whit PyPi.

Default values for fields in records table

The application does not define default MySQL values for fields in the "records" table, preventing PowerDNS from working as a slave of another DNS server and writing to this table.

CI link

CI badge/link is missing in the main readme file.

Any authenticated user can add/mod/del records in any zone

in powerdns/models/powerdns.py permissions to work with record are granted to every authenticated user

rules.add_perm('powerdns.add_record', rules.is_authenticated)
rules.add_perm('powerdns.change_record', rules.is_authenticated)
rules.add_perm('powerdns.delete_record', rules.is_authenticated)

settings_local.py (just in case)

import ldap
from django_auth_ldap.config import LDAPSearch

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'powerdns',
        'USER': 'powerdns',
        'PASSWORD': 'powerdns',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

AUTHENTICATION_BACKENDS = (
    'rules.permissions.ObjectPermissionBackend',
    'django.contrib.auth.backends.ModelBackend',
    'django_auth_ldap.backend.LDAPBackend',
)

AUTH_LDAP_SERVER_URI = "ldap://ldap.example.com"

AUTH_LDAP_AUTHORIZE_ALL_USERS = True
AUTH_LDAP_BIND_DN = "cn=reader,dc=example,dc=com"
AUTH_LDAP_BIND_PASSWORD = "VERYSECRET"
AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=example,dc=com",
    ldap.SCOPE_SUBTREE, "(&(uid=%(user)s)(objectClass=posixAccount))")

AUTH_LDAP_CONNECTION_OPTIONS = {
        ldap.OPT_DEBUG_LEVEL: 0,
        ldap.OPT_REFERRALS: 0,
}


LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'stream_to_console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler'
        },
    },
    'loggers': {
        'django_auth_ldap': {
            'handlers': ['stream_to_console'],
            'level': 'DEBUG',
            'propagate': True,
        },
    }
}

Migration 0007 doesn't work with separate powerdns database

The bundled database router (powerdns/routers.py) puts all models from the powerdns app in the powerdns database, leading me to expect this as supported functionality.

But Domain.owner and Record.owner are both ForeignKeys to settings.AUTH_USER_MODEL, which is weird, because Django doesn't support foreign keys between databases at all.

If you try to initialize powerdns on a non-default (and empty) powerdns database with python manage.py migrate powerdns --database powerdns, the migrations error out on migrations 0007 - where the owner field is created:

Operations to perform:
  Apply all migrations: powerdns
Running migrations:
  Rendering model states... DONE
  Applying powerdns.0007_auto_20150710_0507...Traceback (most recent call last):
  File ".../lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: relation "<settings.AUTH_USER_MODEL>" does not exist


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File ".../lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File ".../lib/python3.5/site-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ".../lib/python3.5/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File ".../lib/python3.5/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File ".../lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 200, in handle
    executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
  File ".../lib/python3.5/site-packages/django/db/migrations/executor.py", line 92, in migrate
    self._migrate_all_forwards(plan, full_plan, fake=fake, fake_initial=fake_initial)
  File ".../lib/python3.5/site-packages/django/db/migrations/executor.py", line 121, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File ".../lib/python3.5/site-packages/django/db/migrations/executor.py", line 198, in apply_migration
    state = migration.apply(state, schema_editor)
  File ".../lib/python3.5/site-packages/django/db/backends/base/schema.py", line 90, in __exit__
    self.execute(sql)
  File ".../lib/python3.5/site-packages/django/db/backends/base/schema.py", line 110, in execute
    cursor.execute(sql, params)
  File ".../lib/python3.5/site-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File ".../lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File ".../lib/python3.5/site-packages/django/db/utils.py", line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File ".../lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File ".../lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "<setting.AUTH_USER_MODEL>" does not exist

However, on both the Domain and Record models there is an account CharField, which I think may have been used to tie domains and records to user accounts via usernames.

Is the separate powerdns database supported by this app?

AttributeError: module 'dal.autocomplete' has no attribute 'ModelSelect2' when doing python manage.py migrate

Full traceback:

$ python manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\Michael\projects\bosnet\bosnetvenv\lib\site-packages\django\core\management\__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "C:\Users\Michael\projects\bosnet\bosnetvenv\lib\site-packages\django\core\management\__init__.py", line 337, in execute
    django.setup()
  File "C:\Users\Michael\projects\bosnet\bosnetvenv\lib\site-packages\django\__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\Michael\projects\bosnet\bosnetvenv\lib\site-packages\django\apps\registry.py", line 116, in populate
    app_config.ready()
  File "C:\Users\Michael\projects\bosnet\bosnetvenv\lib\site-packages\django\contrib\admin\apps.py", line 23, in ready
    self.module.autodiscover()
  File "C:\Users\Michael\projects\bosnet\bosnetvenv\lib\site-packages\django\contrib\admin\__init__.py", line 26, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "C:\Users\Michael\projects\bosnet\bosnetvenv\lib\site-packages\django\utils\module_loading.py", line 50, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "C:\Python36\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\Michael\projects\bosnet\bosnetvenv\lib\site-packages\powerdns\admin.py", line 6, in <module>
    from powerdns.forms import (
  File "C:\Users\Michael\projects\bosnet\bosnetvenv\lib\site-packages\powerdns\forms.py", line 13, in <module>
    class RecordForm(forms.ModelForm):
  File "C:\Users\Michael\projects\bosnet\bosnetvenv\lib\site-packages\powerdns\forms.py", line 14, in RecordForm
    class Meta:
  File "C:\Users\Michael\projects\bosnet\bosnetvenv\lib\site-packages\powerdns\forms.py", line 21, in Meta
    'owner': autocomplete.ModelSelect2(
AttributeError: module 'dal.autocomplete' has no attribute 'ModelSelect2'

Tried installing different versions of django-autocomplete-light, and downgrading Django from 2.0.2, no avail

Any help here?

Merge domain and name field in UI

Domain and name field should be merged into one UI field with regular input for record name, and select with autocomplete (using for example select2) for domain name - for example when you want to create api.github.com record, you should select github.com domain in select box and type api in input.

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.