forked from McLive/DjangoPowerDNS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
165 changed files
with
283 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: "3.4" | ||
services: | ||
|
||
server: | ||
container_name: powerDNS | ||
restart: unless-stopped | ||
image: powerDNS:latest | ||
build: | ||
context: ./server | ||
dockerfile: dockerfile | ||
command: ["uwsgi"] | ||
volumes: | ||
healthcheck: | ||
test: ["CMD", "curl", "-sSG", "http://localhost:80"] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 15s | ||
ports: | ||
- "8080:80" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0
dpdns/migrations/__init__.py → server/.dockerignore
100644 → 100755
File renamed without changes.
0
DjangoPowerDNS/__init__.py → server/DjangoPowerDNS/__init__.py
100644 → 100755
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
# -- | ||
# DjangoPowerDNS - A PowerDNS web interface | ||
# Copyright (C) 2017 McLive | ||
# -- | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU AFFERO General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
# -- | ||
|
||
""" | ||
Django settings for DjangoPowerDNS project. | ||
|
||
Generated by 'django-admin startproject' using Django 1.11.4. | ||
|
||
For more information on this file, see | ||
https://docs.djangoproject.com/en/1.11/topics/settings/ | ||
|
||
For the full list of settings and their values, see | ||
https://docs.djangoproject.com/en/1.11/ref/settings/ | ||
""" | ||
|
||
import os | ||
|
||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | ||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
|
||
# Quick-start development settings - unsuitable for production | ||
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ | ||
|
||
# SECURITY WARNING: keep the secret key used in production secret! | ||
SECRET_KEY = 'soome-secret-key--please-change-me-now' | ||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = False | ||
|
||
ALLOWED_HOSTS = [ | ||
u'i.am.allowed.host' | ||
] | ||
|
||
# Application definition | ||
|
||
INSTALLED_APPS = [ | ||
'django.contrib.admin', | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.messages', | ||
'django.contrib.staticfiles', | ||
'dpdns.apps.DpdnsConfig', | ||
'django_activeurl', | ||
'bootstrap3', | ||
'bootstrap4', | ||
'dpdns.templatetags.tags', | ||
'rest_framework', | ||
#'rest_framework.authtoken', | ||
] | ||
|
||
MIDDLEWARE = [ | ||
'django.middleware.security.SecurityMiddleware', | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.common.CommonMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
] | ||
|
||
ROOT_URLCONF = 'DjangoPowerDNS.urls' | ||
|
||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [os.path.join(BASE_DIR, 'templates')] | ||
, | ||
'APP_DIRS': True, | ||
'OPTIONS': { | ||
'context_processors': [ | ||
'django.template.context_processors.debug', | ||
'django.template.context_processors.request', | ||
'django.contrib.auth.context_processors.auth', | ||
'django.contrib.messages.context_processors.messages', | ||
'dpdns.context_processors.enabled_record_types', | ||
], | ||
}, | ||
}, | ||
] | ||
|
||
REST_FRAMEWORK = { | ||
'DEFAULT_AUTHENTICATION_CLASSES': ( | ||
#'rest_framework.authentication.TokenAuthentication', | ||
#'dpdns.api.TokenAuthentication', | ||
), | ||
'DEFAULT_PERMISSION_CLASSES': ( | ||
#'dpdns.api_permissions.HasAPIAccess', | ||
) | ||
} | ||
|
||
WSGI_APPLICATION = 'DjangoPowerDNS.wsgi.application' | ||
|
||
# Database | ||
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.mysql', | ||
'NAME': 'powerdns', | ||
'USER': 'powerdns', | ||
'PASSWORD': 'powerdns-password', | ||
'HOST': 'localhost', | ||
'PORT': '3306', | ||
} | ||
} | ||
|
||
# Password validation | ||
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators | ||
|
||
AUTH_PASSWORD_VALIDATORS = [ | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', | ||
}, | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', | ||
}, | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', | ||
}, | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', | ||
}, | ||
] | ||
|
||
STATICFILES_DIRS = ( | ||
BASE_DIR + '/static/', | ||
) | ||
|
||
MEDIA_ROOT = BASE_DIR + '/media/' | ||
MEDIA_URL = '/media/' | ||
|
||
# Internationalization | ||
# https://docs.djangoproject.com/en/1.11/topics/i18n/ | ||
|
||
LANGUAGE_CODE = 'en-us' | ||
|
||
TIME_ZONE = 'UTC' | ||
|
||
USE_I18N = True | ||
|
||
USE_L10N = True | ||
|
||
USE_TZ = True | ||
|
||
# Static files (CSS, JavaScript, Images) | ||
# https://docs.djangoproject.com/en/1.11/howto/static-files/ | ||
|
||
STATIC_URL = '/static/' | ||
LOGIN_URL = '/login/' | ||
|
||
# PowerDNS Manager Settings | ||
|
||
PDNS_DEFAULT_ZONE_TYPE = 'NATIVE' | ||
|
||
PDNS_DEFAULT_RR_TTL = 3600 | ||
|
||
PDNS_ENABLED_RR_TYPES = [ | ||
'A', | ||
'AAAA', | ||
'CNAME', | ||
'SRV', | ||
'SOA', | ||
'NS', | ||
'MX', | ||
'PTR', | ||
'TXT', | ||
'SPF', | ||
'CERT', | ||
'DNSKEY', | ||
'DS', | ||
'KEY', | ||
'NSEC', | ||
'RRSIG', | ||
'HINFO', | ||
'LOC', | ||
'NAPTR', | ||
'RP', | ||
'AFSDB', | ||
'SSHFP', | ||
] | ||
|
||
PDNS_DEFAULT_SOA = { | ||
'PRIMARY_NS': "ns1.host.tld", | ||
'EMAIL': "[email protected]" | ||
} | ||
|
||
PDNS_EXCLUDE_RECORDS = [ | ||
{ | ||
'domain': 1, | ||
'regex': r'(vps)\d+' # example exclude vps654564734.yourdomain.tld from being shown in the web interface. | ||
} | ||
] |
0
DjangoPowerDNS/urls.py → server/DjangoPowerDNS/urls.py
100644 → 100755
File renamed without changes.
0
DjangoPowerDNS/wsgi.py → server/DjangoPowerDNS/wsgi.py
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM debian:latest | ||
# Metadata | ||
LABEL maintainer="[email protected]" | ||
# Pre-build | ||
WORKDIR /var/server | ||
RUN apt update -y | ||
RUN apt install -y uwsgi python-mysqldb libmariadbclient-dev | ||
RUN cp ./templates/uwsgi-config.ini /etc/uwsgi/apps-enabled/dpdns.ini | ||
RUN pip install virtualenv | ||
RUN virtualenv venv | ||
RUN source venv/bin/activate | ||
# Build data | ||
COPY ./* ./ | ||
RUN pip install -r requirements.txt | ||
RUN python manage.py migrate | ||
RUN python init_createsuperuser.py | ||
# Run on startup | ||
CMD uwsgi |
0
dpdns/__init__.py → server/dpdns/__init__.py
100644 → 100755
File renamed without changes.
0
dpdns/admin.py → server/dpdns/admin.py
100644 → 100755
File renamed without changes.
0
dpdns/api.py → server/dpdns/api.py
100644 → 100755
File renamed without changes.
0
dpdns/api_permissions.py → server/dpdns/api_permissions.py
100644 → 100755
File renamed without changes.
0
dpdns/apps.py → server/dpdns/apps.py
100644 → 100755
File renamed without changes.
0
dpdns/context_processors.py → server/dpdns/context_processors.py
100644 → 100755
File renamed without changes.
0
dpdns/forms.py → server/dpdns/forms.py
100644 → 100755
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
0
dpdns/models.py → server/dpdns/models.py
100644 → 100755
File renamed without changes.
0
dpdns/serializers.py → server/dpdns/serializers.py
100644 → 100755
File renamed without changes.
0
dpdns/signals.py → server/dpdns/signals.py
100644 → 100755
File renamed without changes.
File renamed without changes.
0
dpdns/templatetags/tags.py → server/dpdns/templatetags/tags.py
100644 → 100755
File renamed without changes.
0
dpdns/tests.py → server/dpdns/tests.py
100644 → 100755
File renamed without changes.
0
dpdns/views.py → server/dpdns/views.py
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django.contrib.auth.models import User; | ||
|
||
username = 'administrator'; | ||
password = 'administrator'; | ||
email = 'administrator@local'; | ||
|
||
if User.objects.filter(username=username).count()==0: | ||
User.objects.create_superuser(username, email, password); | ||
print('Superuser created.'); | ||
else: | ||
print('Superuser creation skipped.'); |
0
manage.py → server/manage.py
100644 → 100755
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
0
static/css/animate.css → server/static/css/animate.css
100644 → 100755
File renamed without changes.
0
static/css/toastr-2.1.3.min.css → server/static/css/toastr-2.1.3.min.css
100644 → 100755
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
0
static/img/brillant.png → server/static/img/brillant.png
100644 → 100755
File renamed without changes
0
static/img/[email protected] → server/static/img/[email protected]
100644 → 100755
File renamed without changes
File renamed without changes
0
static/img/cream_dust.png → server/static/img/cream_dust.png
100644 → 100755
File renamed without changes
0
static/img/[email protected] → server/static/img/[email protected]
100644 → 100755
File renamed without changes
0
static/img/crossword.png → server/static/img/crossword.png
100644 → 100755
File renamed without changes
0
static/img/cubes.png → server/static/img/cubes.png
100644 → 100755
File renamed without changes
0
static/img/[email protected] → server/static/img/[email protected]
100644 → 100755
File renamed without changes
File renamed without changes
0
static/img/geometry2.png → server/static/img/geometry2.png
100644 → 100755
File renamed without changes
0
static/img/grey.png → server/static/img/grey.png
100644 → 100755
File renamed without changes
0
static/img/[email protected] → server/static/img/[email protected]
100644 → 100755
File renamed without changes
0
static/img/ticks.png → server/static/img/ticks.png
100644 → 100755
File renamed without changes
File renamed without changes.
File renamed without changes.
0
static/js/knockout-3.4.2.js → server/static/js/knockout-3.4.2.js
100644 → 100755
File renamed without changes.
0
static/js/navigo-226.min.js → server/static/js/navigo-226.min.js
100644 → 100755
File renamed without changes.
File renamed without changes.
0
static/loader/Ellipsis.gif → server/static/loader/Ellipsis.gif
100644 → 100755
File renamed without changes
0
static/loader/Ellipsis.svg → server/static/loader/Ellipsis.svg
100644 → 100755
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
0
templates/base.html → server/templates/base.html
100644 → 100755
File renamed without changes.
0
templates/domain-add.html → server/templates/domain-add.html
100644 → 100755
File renamed without changes.
0
templates/domain-api.html → server/templates/domain-api.html
100644 → 100755
File renamed without changes.
0
templates/domain-claim.html → server/templates/domain-claim.html
100644 → 100755
File renamed without changes.
File renamed without changes.
0
templates/domain-users.html → server/templates/domain-users.html
100644 → 100755
File renamed without changes.
0
templates/domain.html → server/templates/domain.html
100644 → 100755
File renamed without changes.
0
templates/domains.html → server/templates/domains.html
100644 → 100755
File renamed without changes.
0
templates/index.html → server/templates/index.html
100644 → 100755
File renamed without changes.
0
templates/login.html → server/templates/login.html
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[uwsgi] | ||
base = /var/server/DjangoPowerDNS | ||
chdir = /var/server/ | ||
|
||
master = true | ||
wsgi-file = %(base)/wsgi.py | ||
touch-reload = %(wsgi-file) | ||
app = wsgi | ||
|
||
virtualenv = %(chdir)/venv | ||
|
||
socket = 127.0.0.1:7077 | ||
plugins-dir = /etc/uwsgi/apps-enabled/ | ||
processes = 1 | ||
threads = 100 | ||
harakiri = 30 | ||
|
||
logto = /var/log/uwsgi/app/djangopowerdns.log | ||
pidfile2 = /tmp/djangopowerdns.pid | ||
|
||
uid = www-data | ||
gid = www-data |