Add PostgreSQL install documentation.

This commit is contained in:
David Mc Ken 2022-12-12 22:50:26 -04:00
parent 94ce26eaad
commit dcbc4c3f7e

View File

@ -1,8 +1,15 @@
# Setup Postgres database for PowerDNS-Admin # Setup Postgres database for PowerDNS-Admin
We assume you already have a postgres database software installed for your platform. This guide will show you how to prepare a PostgreSQL database for PowerDNS-Admin.
### Create database We assume the database is installed per your platform's directions (apt, yum, etc). Directions to do this can be found below:
- https://www.postgresql.org/download/
- https://www.digitalocean.com/community/tutorials/how-to-install-postgresql-on-ubuntu-22-04-quickstart
We assume a default configuration and only the postgres user existing.
## Setup database
The below will create a database called powerdnsadmindb and a user of powerdnsadmin. The below will create a database called powerdnsadmindb and a user of powerdnsadmin.
``` ```
@ -42,19 +49,6 @@ On debian based systems these files are located in:
/etc/postgresql/<version>/main/ /etc/postgresql/<version>/main/
``` ```
## Docker
TODO: Setup a local Docker postgres database ready to go (should probably move to the top).
```
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
```
## Install required packages: ## Install required packages:
### Red-hat based systems: ### Red-hat based systems:
``` ```
@ -74,3 +68,17 @@ pip3 install psycopg2
## Known Issues: ## Known Issues:
** To fill in ** ** To fill in **
## Docker (TODO: to move to docker docs)
TODO: Setup a local Docker postgres database ready to go (should probably move to the top).
```
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
```