Move preparation to database-setup.

This commit is contained in:
David Mc Ken 2022-12-08 21:44:52 -04:00
parent 2dec2ad204
commit dc495ce426
2 changed files with 9 additions and 12 deletions

View File

@ -1,3 +1,5 @@
# Setup MySQL database for PowerDNS-Admin
This guide will show you how to prepare a MySQL or MariaDB database for PowerDNS-Admin. This guide will show you how to prepare a MySQL or MariaDB database for PowerDNS-Admin.
### Step-by-step instructions ### Step-by-step instructions

View File

@ -1,10 +1,6 @@
If you would like to use PostgreSQL instead of MySQL or MariaDB, you have to install difference dependencies. Check the following instructions. # Setup Postgres database for PowerDNS-Admin
### Install dependencies We assume you already have a postgres database software installed for your platform.
```
$ sudo yum install postgresql-libs
$ pip install psycopg2
```
### Create database ### Create database
``` ```
@ -16,16 +12,15 @@ postgres=# alter user powerdnsadmin with encrypted password 'powerdnsadmin';
postgres=# grant all privileges on database powerdnsadmindb to powerdnsadmin; postgres=# grant all privileges on database powerdnsadmindb to powerdnsadmin;
``` ```
In your `config.py` file, make sure you have
```
SQLALCHEMY_DATABASE_URI = 'postgresql://powerdnsadmin:powerdnsadmin@127.0.0.1/powerdnsadmindb'
```
Note: Note:
- Please change the information above (db, user, password) to fit your setup. - Please change the information above (db, user, password) to fit your setup.
### Setup Remote access to database:
If your database is on a different server
- You might need to adjust your PostgreSQL's `pg_hba.conf` config file to allow password authentication for networks. - You might need to adjust your PostgreSQL's `pg_hba.conf` config file to allow password authentication for networks.
### Use Docker ## Docker
``` ```
docker run --name pdnsadmin-test -e BIND_ADDRESS=0.0.0.0 docker run --name pdnsadmin-test -e BIND_ADDRESS=0.0.0.0
-e SECRET_KEY='a-very-secret-key' -e SECRET_KEY='a-very-secret-key'