From dc495ce4265ab467a9a179759abfb21a4223acad Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:44:52 -0400 Subject: [PATCH] Move preparation to database-setup. --- .../Setup-MySQL-or-MariaDB.md} | 2 ++ .../Setup-PostgreSQL.md} | 19 +++++++------------ 2 files changed, 9 insertions(+), 12 deletions(-) rename docs/wiki/{preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md => database-setup/Setup-MySQL-or-MariaDB.md} (93%) rename docs/wiki/{preparation/Using-PowerDNS-Admin-with-PostgreSQL.md => database-setup/Setup-PostgreSQL.md} (68%) diff --git a/docs/wiki/preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md similarity index 93% rename from docs/wiki/preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md rename to docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md index 774d3e3..139e515 100644 --- a/docs/wiki/preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md +++ b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md @@ -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. ### Step-by-step instructions diff --git a/docs/wiki/preparation/Using-PowerDNS-Admin-with-PostgreSQL.md b/docs/wiki/database-setup/Setup-PostgreSQL.md similarity index 68% rename from docs/wiki/preparation/Using-PowerDNS-Admin-with-PostgreSQL.md rename to docs/wiki/database-setup/Setup-PostgreSQL.md index 04155e9..2af39a0 100644 --- a/docs/wiki/preparation/Using-PowerDNS-Admin-with-PostgreSQL.md +++ b/docs/wiki/database-setup/Setup-PostgreSQL.md @@ -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 -``` -$ sudo yum install postgresql-libs -$ pip install psycopg2 -``` +We assume you already have a postgres database software installed for your platform. ### Create database ``` @@ -16,16 +12,15 @@ 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. + +### 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. -### Use Docker +## Docker ``` docker run --name pdnsadmin-test -e BIND_ADDRESS=0.0.0.0 -e SECRET_KEY='a-very-secret-key'