2015-12-13 09:34:12 +00:00
|
|
|
import os
|
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
|
|
# BASIC APP CONFIG
|
|
|
|
WTF_CSRF_ENABLED = True
|
|
|
|
SECRET_KEY = 'We are the world'
|
2016-04-13 04:13:59 +00:00
|
|
|
BIND_ADDRESS = '127.0.0.1'
|
2018-03-30 06:49:35 +00:00
|
|
|
PORT = 9191
|
2016-04-28 15:53:50 +00:00
|
|
|
LOGIN_TITLE = "PDNS"
|
2015-12-13 09:34:12 +00:00
|
|
|
|
2016-03-17 04:59:33 +00:00
|
|
|
# TIMEOUT - for large zones
|
|
|
|
TIMEOUT = 10
|
|
|
|
|
2016-08-12 08:15:38 +00:00
|
|
|
# LOG CONFIG
|
2015-12-13 09:34:12 +00:00
|
|
|
LOG_LEVEL = 'DEBUG'
|
|
|
|
LOG_FILE = 'logfile.log'
|
2016-08-31 21:11:04 +00:00
|
|
|
# For Docker, leave empty string
|
|
|
|
#LOG_FILE = ''
|
2015-12-13 09:34:12 +00:00
|
|
|
|
2015-12-16 17:50:28 +00:00
|
|
|
# Upload
|
|
|
|
UPLOAD_DIR = os.path.join(basedir, 'upload')
|
|
|
|
|
2015-12-13 09:34:12 +00:00
|
|
|
# DATABASE CONFIG
|
2016-08-16 16:54:07 +00:00
|
|
|
#You'll need MySQL-python
|
|
|
|
SQLA_DB_USER = 'powerdnsadmin'
|
|
|
|
SQLA_DB_PASSWORD = 'powerdnsadminpassword'
|
|
|
|
SQLA_DB_HOST = 'mysqlhostorip'
|
|
|
|
SQLA_DB_NAME = 'powerdnsadmin'
|
|
|
|
|
|
|
|
#MySQL
|
2017-11-02 01:32:51 +00:00
|
|
|
#SQLALCHEMY_DATABASE_URI = 'mysql://'+SQLA_DB_USER+':'\
|
|
|
|
# +SQLA_DB_PASSWORD+'@'+SQLA_DB_HOST+'/'+SQLA_DB_NAME
|
2016-08-16 16:54:07 +00:00
|
|
|
#SQLite
|
2017-11-02 01:32:51 +00:00
|
|
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///pdns.db'
|
2015-12-13 09:34:12 +00:00
|
|
|
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
|
|
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = True
|
|
|
|
|
|
|
|
# LDAP CONFIG
|
2018-04-02 06:38:53 +00:00
|
|
|
LDAP_ENABLED = False
|
2016-08-16 15:21:29 +00:00
|
|
|
LDAP_TYPE = 'ldap'
|
2015-12-13 09:34:12 +00:00
|
|
|
LDAP_URI = 'ldaps://your-ldap-server:636'
|
2017-09-03 18:31:50 +00:00
|
|
|
# with LDAP_BIND_TYPE you can specify 'direct' or 'search' to use user credentials
|
|
|
|
# for binding or a predefined LDAP_USERNAME and LDAP_PASSWORD, binding with non-DN only works with AD
|
|
|
|
LDAP_BIND_TYPE= 'direct' # direct or search
|
2015-12-13 09:34:12 +00:00
|
|
|
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'
|
2017-11-02 22:23:36 +00:00
|
|
|
LDAP_GROUP_SECURITY = False
|
2016-04-11 12:11:02 +00:00
|
|
|
LDAP_ADMIN_GROUP = 'CN=PowerDNS-Admin Admin,OU=Custom,DC=ivan,DC=local'
|
|
|
|
LDAP_USER_GROUP = 'CN=PowerDNS-Admin User,OU=Custom,DC=ivan,DC=local'
|
2016-04-28 15:53:50 +00:00
|
|
|
# Additional options only if LDAP_TYPE=ldap
|
|
|
|
LDAP_USERNAMEFIELD = 'uid'
|
|
|
|
LDAP_FILTER = '(objectClass=inetorgperson)'
|
2017-09-03 18:23:18 +00:00
|
|
|
# enable LDAP_GROUP_SECURITY to allow Admin and User roles based on LDAP groups
|
|
|
|
#LDAP_GROUP_SECURITY = True # True or False
|
|
|
|
#LDAP_ADMIN_GROUP = 'CN=DnsAdmins,CN=Users,DC=example,DC=me'
|
|
|
|
#LDAP_USER_GROUP = 'CN=Domain Admins,CN=Users,DC=example,DC=me'
|
2015-12-13 09:34:12 +00:00
|
|
|
|
2016-08-16 15:21:29 +00:00
|
|
|
## 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'
|
|
|
|
|
2016-08-05 08:20:41 +00:00
|
|
|
# Github Oauth
|
|
|
|
GITHUB_OAUTH_ENABLE = False
|
2018-04-01 00:05:57 +00:00
|
|
|
GITHUB_OAUTH_KEY = ''
|
|
|
|
GITHUB_OAUTH_SECRET = ''
|
2016-08-05 08:20:41 +00:00
|
|
|
GITHUB_OAUTH_SCOPE = 'email'
|
2018-04-01 00:05:57 +00:00
|
|
|
GITHUB_OAUTH_URL = 'http://127.0.0.1:9191/api/v3/'
|
|
|
|
GITHUB_OAUTH_TOKEN = 'http://127.0.0.1:9191/oauth/token'
|
|
|
|
GITHUB_OAUTH_AUTHORIZE = 'http://127.0.0.1:9191/oauth/authorize'
|
2016-08-05 08:20:41 +00:00
|
|
|
|
2017-11-01 21:18:43 +00:00
|
|
|
|
2017-09-22 14:28:09 +00:00
|
|
|
# Google OAuth
|
|
|
|
GOOGLE_OAUTH_ENABLE = False
|
|
|
|
GOOGLE_OAUTH_CLIENT_ID = ' '
|
|
|
|
GOOGLE_OAUTH_CLIENT_SECRET = ' '
|
2017-09-28 14:05:52 +00:00
|
|
|
GOOGLE_REDIRECT_URI = '/user/authorized'
|
2017-09-22 14:28:09 +00:00
|
|
|
GOOGLE_TOKEN_URL = 'https://accounts.google.com/o/oauth2/token'
|
|
|
|
GOOGLE_TOKEN_PARAMS = {
|
|
|
|
'scope': 'email profile'
|
|
|
|
}
|
|
|
|
GOOGLE_AUTHORIZE_URL='https://accounts.google.com/o/oauth2/auth'
|
|
|
|
GOOGLE_BASE_URL='https://www.googleapis.com/oauth2/v1/'
|
|
|
|
|
2017-10-31 18:21:22 +00:00
|
|
|
# SAML Authnetication
|
2017-10-31 22:45:24 +00:00
|
|
|
SAML_ENABLED = False
|
2017-11-01 16:31:51 +00:00
|
|
|
SAML_DEBUG = True
|
|
|
|
SAML_PATH = os.path.join(os.path.dirname(__file__), 'saml')
|
|
|
|
##Example for ADFS Metadata-URL
|
|
|
|
SAML_METADATA_URL = 'https://<hostname>/FederationMetadata/2007-06/FederationMetadata.xml'
|
|
|
|
#Cache Lifetime in Seconds
|
|
|
|
SAML_METADATA_CACHE_LIFETIME = 1
|
|
|
|
SAML_SP_ENTITY_ID = 'http://<SAML SP Entity ID>'
|
|
|
|
SAML_SP_CONTACT_NAME = '<contact name>'
|
|
|
|
SAML_SP_CONTACT_MAIL = '<contact mail>'
|
2018-01-20 16:17:02 +00:00
|
|
|
#Cofigures if SAML tokens should be encrypted.
|
|
|
|
#If enabled a new app certificate will be generated on restart
|
|
|
|
SAML_SIGN_REQUEST = False
|
2017-12-04 23:14:31 +00:00
|
|
|
#Use SAML standard logout mechanism retreived from idp metadata
|
|
|
|
#If configured false don't care about SAML session on logout.
|
|
|
|
#Logout from PowerDNS-Admin only and keep SAML session authenticated.
|
|
|
|
SAML_LOGOUT = False
|
|
|
|
#Configure to redirect to a different url then PowerDNS-Admin login after SAML logout
|
|
|
|
#for example redirect to google.com after successful saml logout
|
|
|
|
#SAML_LOGOUT_URL = 'https://google.com'
|
2017-10-31 18:21:22 +00:00
|
|
|
|
2016-04-26 20:04:33 +00:00
|
|
|
#Default Auth
|
|
|
|
BASIC_ENABLED = True
|
|
|
|
SIGNUP_ENABLED = True
|
|
|
|
|
2015-12-13 09:34:12 +00:00
|
|
|
# POWERDNS CONFIG
|
|
|
|
PDNS_STATS_URL = 'http://172.16.214.131:8081/'
|
|
|
|
PDNS_API_KEY = 'you never know'
|
2018-04-01 00:05:57 +00:00
|
|
|
PDNS_VERSION = '4.1.1'
|
2015-12-13 09:34:12 +00:00
|
|
|
|
|
|
|
# RECORDS ALLOWED TO EDIT
|
2018-02-18 10:03:09 +00:00
|
|
|
RECORDS_ALLOW_EDIT = ['SOA', 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'PTR', 'SPF', 'SRV', 'TXT', 'LOC', 'NS', 'PTR']
|
2018-02-16 19:02:16 +00:00
|
|
|
FORWARD_RECORDS_ALLOW_EDIT = ['A', 'AAAA', 'CAA', 'CNAME', 'MX', 'PTR', 'SPF', 'SRV', 'TXT', 'LOC' 'NS']
|
|
|
|
REVERSE_RECORDS_ALLOW_EDIT = ['TXT', 'LOC', 'NS', 'PTR']
|
2016-08-19 23:04:20 +00:00
|
|
|
|
|
|
|
# EXPERIMENTAL FEATURES
|
|
|
|
PRETTY_IPV6_PTR = False
|