Move preparation guides to sub-folder.

This commit is contained in:
David Mc Ken
2022-12-08 12:20:40 -04:00
parent 5f750d1bb8
commit d259a6494e
2 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
This guide will show you how to prepare a MySQL or MariaDB database for PowerDNS-Admin.
### Step-by-step instructions
1. ivan@ubuntu:~$ `mysql -u root -p` (then enter your MySQL/MariaDB root users password)
2. mysql> `CREATE DATABASE powerdnsadmin CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;`
3. mysql> `GRANT ALL PRIVILEGES ON powerdnsadmin.* TO 'pdnsadminuser'@'%' IDENTIFIED BY 'p4ssw0rd';`
4. mysql> `FLUSH PRIVILEGES;`
5. mysql> `quit`
**NOTE:**
If you plan to manage large zones, you may encounter some issues while applying changes.
This is due to PowerDNS-Admin trying to insert the entire modified zone into the column history.detail.
Using MySQL/MariaDB, this column is created by default as TEXT and thus limited to 65,535 characters.
_Solution_:
Convert the column to MEDIUMTEXT:
* `USE powerdnsadmin;`
* `ALTER TABLE history MODIFY detail MEDIUMTEXT;`

View File

@@ -0,0 +1,38 @@
If you would like to use PostgreSQL instead of MySQL or MariaDB, you have to install difference dependencies. Check the following instructions.
### Install dependencies
```
$ sudo yum install postgresql-libs
$ pip install psycopg2
```
### Create database
```
$ sudo su - postgres
$ createuser powerdnsadmin
$ createdb powerdnsadmindb
$ psql
postgres=# alter user powerdnsadmin with encrypted password '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:
- Please change the information above (db, user, password) to fit your setup.
- You might need to adjust your PostgreSQL's `pg_hba.conf` config file to allow password authentication for networks.
### Use Docker
```
docker run --name pdnsadmin-test -e BIND_ADDRESS=0.0.0.0
-e SECRET_KEY='a-very-secret-key'
-e PORT='9191'
-e SQLA_DB_USER='powerdns_admin_user'
-e SQLA_DB_PASSWORD='exceptionallysecure'
-e SQLA_DB_HOST='192.168.0.100'
-e SQLA_DB_NAME='powerdns_admin_test'
-v /data/node_modules:/var/www/powerdns-admin/node_modules -d -p 9191:9191 ixpict/powerdns-admin-pgsql:latest
```