Created
May 17, 2019 13:08
-
-
Save takumaw/02a0f80492f2033648862e58db7c96ba to your computer and use it in GitHub Desktop.
PowerDNS with Docker Compose
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
import os | |
basedir = os.path.abspath(os.path.dirname(__file__)) | |
# BASIC APP CONFIG | |
WTF_CSRF_ENABLED = True | |
SECRET_KEY = 'We are the world' | |
BIND_ADDRESS = '0.0.0.0' | |
PORT = 9393 | |
LOGIN_TITLE = "PDNS" | |
# TIMEOUT - for large zones | |
TIMEOUT = 10 | |
# LOG CONFIG | |
LOG_LEVEL = 'DEBUG' | |
LOG_FILE = '' | |
# For Docker, leave empty string | |
#LOG_FILE = '' | |
# Upload | |
UPLOAD_DIR = os.path.join(basedir, 'upload') | |
# DATABASE CONFIG | |
#You'll need MySQL-python | |
SQLA_DB_USER = 'root' | |
SQLA_DB_PASSWORD = 'root' | |
SQLA_DB_HOST = 'mysql' | |
SQLA_DB_NAME = 'pda' | |
#MySQL | |
SQLALCHEMY_DATABASE_URI = 'mysql://'+SQLA_DB_USER+':'\ | |
+SQLA_DB_PASSWORD+'@'+SQLA_DB_HOST+'/'+SQLA_DB_NAME | |
#SQLite | |
#SQLALCHEMY_DATABASE_URI = 'sqlite:////path/to/your/pdns.db' | |
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository') | |
SQLALCHEMY_TRACK_MODIFICATIONS = True | |
# LDAP CONFIG | |
#LDAP_TYPE = 'ldap' | |
#LDAP_URI = 'ldaps://your-ldap-server:636' | |
#LDAP_USERNAME = 'cn=dnsuser,ou=users,ou=services,dc=duykhanh,dc=me' | |
#LDAP_PASSWORD = 'dnsuser' | |
#LDAP_SEARCH_BASE = 'ou=System Admins,ou=People,dc=duykhanh,dc=me' | |
# Additional options only if LDAP_TYPE=ldap | |
#LDAP_USERNAMEFIELD = 'uid' | |
#LDAP_FILTER = '(objectClass=inetorgperson)' | |
## AD CONFIG | |
#LDAP_TYPE = 'ad' | |
#LDAP_URI = 'ldaps://your-ad-server:636' | |
#LDAP_USERNAME = 'cn=dnsuser,ou=Users,dc=domain,dc=local' | |
#LDAP_PASSWORD = 'dnsuser' | |
#LDAP_SEARCH_BASE = 'dc=domain,dc=local' | |
## You may prefer 'userPrincipalName' instead | |
#LDAP_USERNAMEFIELD = 'sAMAccountName' | |
## AD Group that you would like to have accesss to web app | |
#LDAP_FILTER = 'memberof=cn=DNS_users,ou=Groups,dc=domain,dc=local' | |
# Github Oauth | |
#GITHUB_OAUTH_ENABLE = False | |
#GITHUB_OAUTH_KEY = 'G0j1Q15aRsn36B3aD6nwKLiYbeirrUPU8nDd1wOC' | |
#GITHUB_OAUTH_SECRET = '0WYrKWePeBDkxlezzhFbDn1PBnCwEa0vCwVFvy6iLtgePlpT7WfUlAa9sZgm' | |
#GITHUB_OAUTH_SCOPE = 'email' | |
#GITHUB_OAUTH_URL = 'http://127.0.0.1:5000/api/v3/' | |
#GITHUB_OAUTH_TOKEN = 'http://127.0.0.1:5000/oauth/token' | |
#GITHUB_OAUTH_AUTHORIZE = 'http://127.0.0.1:5000/oauth/authorize' | |
#Default Auth | |
BASIC_ENABLED = True | |
SIGNUP_ENABLED = True | |
# POWERDNS CONFIG | |
PDNS_STATS_URL = 'http://host.docker.internal:8081' | |
PDNS_API_KEY = 'changeme' | |
PDNS_VERSION = '4.0.4' | |
# RECORDS ALLOWED TO EDIT | |
RECORDS_ALLOW_EDIT = ['A', 'AAAA', 'CNAME', 'SPF', 'PTR', 'MX', 'TXT'] | |
# EXPERIMENTAL FEATURES | |
PRETTY_IPV6_PTR = True |
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
version: '3' | |
services: | |
powerdns-admin: | |
image: really/powerdns-admin | |
restart: unless-stopped | |
network_mode: bridge | |
ports: | |
- "9393:9393" | |
volumes: | |
- ./config/config.py:/app/config.py:ro | |
environment: | |
- TZ=Asia/Tokyo | |
links: | |
- mysql | |
mysql: | |
image: mysql:5.7 | |
restart: unless-stopped | |
network_mode: bridge | |
volumes: | |
- ./mysql:/var/lib/mysql | |
environment: | |
- TZ=Asia/Tokyo | |
- MYSQL_DATABASE=pda | |
- MYSQL_ROOT_PASSWORD=root |
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
version: '3' | |
services: | |
powerdns: | |
image: psitrax/powerdns | |
restart: unless-stopped | |
network_mode: bridge | |
ports: | |
- "53:53/tcp" | |
- "53:53/udp" | |
- "8081:8081" | |
volumes: | |
- ./conf/pdns.conf:/etc/pdns/conf.d/pdns.conf:ro | |
environment: | |
- MYSQL_HOST=mysql | |
- MYSQL_USER=root | |
- MYSQL_PASS=root | |
- MYSQL_DB=pdns | |
links: | |
- mysql | |
mysql: | |
image: mysql:5.7 | |
restart: unless-stopped | |
network_mode: bridge | |
volumes: | |
- ./mysql:/var/lib/mysql | |
environment: | |
- TZ=Asia/Tokyo | |
- MYSQL_DATABASE=pdns | |
- MYSQL_ROOT_PASSWORD=root |
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
receiver-threads = 3 | |
webserver = yes | |
webserver-address = 0.0.0.0 | |
webserver-allow-from = 0.0.0.0/0 | |
webserver-port = 8081 | |
api = yes | |
api-key = changeme |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment