Users could use SQLite instead of MySQL

This commit is contained in:
Zhuoyun Wei 2016-08-12 16:15:38 +08:00
parent 68dc4f4148
commit 635cc8c3b3
3 changed files with 8 additions and 4 deletions

View File

@ -37,11 +37,15 @@ This will enable API access in PowerDNS so PowerDNS-Admin can intergrate with Po
### Create Database
We will create a database which used by this web application. Please note that this database is difference from pdns database itself.
You could use any database that SQLAlchemy supports. For example MySQL (you will need to `pip install MySQL-python` to use MySQL backend):
```
MariaDB [(none)]> CREATE DATABASE powerdnsadmin;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON powerdnsadmin.* TO powerdnsadmin@'%' IDENTIFIED BY 'your-password';
```
For testing purpose, you could also use SQLite as backend. This way you do not have to install `MySQL-python` dependency.
### PowerDNS-Admin

View File

@ -11,7 +11,7 @@ LOGIN_TITLE = "PDNS"
# TIMEOUT - for large zones
TIMEOUT = 10
# LOG CONFIG
# LOG CONFIG
LOG_LEVEL = 'DEBUG'
LOG_FILE = 'logfile.log'
@ -19,12 +19,13 @@ LOG_FILE = 'logfile.log'
UPLOAD_DIR = os.path.join(basedir, 'upload')
# DATABASE CONFIG
SQLALCHEMY_DATABASE_URI = 'mysql://root:123456@192.168.59.103/pdns'
SQLALCHEMY_DATABASE_URI = 'mysql://root:123456@192.168.59.103/pdns' # You'll need MySQL-python
#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' # use 'ad' for MS Active Directory
LDAP_TYPE = 'ldap' # use 'ad' for MS Active Directory
LDAP_URI = 'ldaps://your-ldap-server:636'
LDAP_USERNAME = 'cn=dnsuser,ou=users,ou=services,dc=duykhanh,dc=me'
LDAP_PASSWORD = 'dnsuser'

View File

@ -2,7 +2,6 @@ Flask>=0.10
Flask-WTF>=0.11
Flask-Login>=0.2.11
configobj==5.0.5
MySQL-python==1.2.5
py-bcrypt==0.4
requests==2.7.0
python-ldap==2.4.21