From 9a4acf53058b698f2e4089fe9ac8e5fd73685048 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 20:33:57 -0400 Subject: [PATCH 01/39] Move configure Active directory auth to config folder. --- ...figure-Active-Directory-Authentication-using-Group-Security.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/wiki/{ => configuration}/Configure-Active-Directory-Authentication-using-Group-Security.md (100%) diff --git a/docs/wiki/Configure-Active-Directory-Authentication-using-Group-Security.md b/docs/wiki/configuration/Configure-Active-Directory-Authentication-using-Group-Security.md similarity index 100% rename from docs/wiki/Configure-Active-Directory-Authentication-using-Group-Security.md rename to docs/wiki/configuration/Configure-Active-Directory-Authentication-using-Group-Security.md From fc01be4cad625db83106ec0164fdfb6c908fca9a Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 20:34:29 -0400 Subject: [PATCH 02/39] Move systemd service to install folder. --- .../Running-PowerDNS-Admin-as-a-service-(Systemd).md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/wiki/{ => install}/Running-PowerDNS-Admin-as-a-service-(Systemd).md (100%) diff --git a/docs/wiki/Running-PowerDNS-Admin-as-a-service-(Systemd).md b/docs/wiki/install/Running-PowerDNS-Admin-as-a-service-(Systemd).md similarity index 100% rename from docs/wiki/Running-PowerDNS-Admin-as-a-service-(Systemd).md rename to docs/wiki/install/Running-PowerDNS-Admin-as-a-service-(Systemd).md From c5524dc9098b89ef3eaa45ad5dc5d9927ac9a46e Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 20:36:55 -0400 Subject: [PATCH 03/39] Fix link to gunicorn and nginx setup. --- docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md b/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md index acc5858..b5df090 100644 --- a/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md +++ b/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md @@ -91,4 +91,4 @@ Now you can run PowerDNS-Admin by command Open your web browser and go to `http://localhost:9191` to visit PowerDNS-Admin web interface. Register a user. The first user will be in the Administrator role. -This is good for testing, but for production usage, you should use gunicorn or uwsgi. See [Running PowerDNS Admin with Systemd, Gunicorn and Nginx](web-server/Running-PowerDNS-Admin-with-Systemd,-Gunicorn--and--Nginx) for instructions. \ No newline at end of file +This is good for testing, but for production usage, you should use gunicorn or uwsgi. See [Running PowerDNS Admin with Systemd, Gunicorn and Nginx](web-server/Running-PowerDNS-Admin-with-Systemd,-Gunicorn--and--Nginx.md) for instructions. \ No newline at end of file From 1ced360e5fec0efc08bcb0a5e91e169bd9d1bd4a Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 20:39:25 -0400 Subject: [PATCH 04/39] Fixed links to gunicorn docs. --- docs/wiki/README.md | 8 ++++++-- .../install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md | 2 +- ...ing-PowerDNS-Admin-with-Systemd-Gunicorn-and-Nginx.md} | 0 3 files changed, 7 insertions(+), 3 deletions(-) rename docs/wiki/web-server/{Running-PowerDNS-Admin-with-Systemd,-Gunicorn--and--Nginx.md => Running-PowerDNS-Admin-with-Systemd-Gunicorn-and-Nginx.md} (100%) diff --git a/docs/wiki/README.md b/docs/wiki/README.md index 8010cc1..b7d2f3d 100644 --- a/docs/wiki/README.md +++ b/docs/wiki/README.md @@ -5,16 +5,20 @@ - [Using PowerDNS-Admin with PostgreSQL](preparation/Using-PowerDNS-Admin-with-PostgreSQL.md) ## Installation guides -- [Running PowerDNS Admin on Ubuntu or Debian](install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md) +- [Running PowerDNS-Admin on Ubuntu or Debian](install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md) - [Running PowerDNS-Admin on Centos 7](install/Running-PowerDNS-Admin-on-Centos-7.md) - [Running PowerDNS-Admin on Fedora 23](install/Running-PowerDNS-Admin-on-Fedora-23.md) - [Running PowerDNS-Admin on Fedora 30](install/Running-PowerDNS-Admin-on-Fedora-30.md) - [Running PowerDNS-Admin on FreeBSD 12.1-RELEASE](install/Running-on-FreeBSD.md) +### Post install Setup: +- [Running PowerDNS-Admin as a service using Systemd](install/Running-PowerDNS-Admin-as-a-service-(Systemd).md) + + ## Web Server configuration - [Supervisord](web-server/Supervisord-example.md) - [Systemd](web-server/Systemd-example.md) -- [Systemd + Gunicorn + Nginx](web-server/Running-PowerDNS-Admin-with-Systemd,-Gunicorn--and--Nginx.md) +- [Systemd + Gunicorn + Nginx](web-server/Running-PowerDNS-Admin-with-Systemd-Gunicorn-and-Nginx.md) - [Systemd + Gunicorn + Apache](web-server/Running-PowerDNS-Admin-with-Systemd,-Gunicorn-and-Apache.md) - [uWSGI](web-server/uWSGI-example.md) - [WSGI-Apache](web-server/WSGI-Apache-example.md) diff --git a/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md b/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md index b5df090..b4e3b66 100644 --- a/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md +++ b/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md @@ -91,4 +91,4 @@ Now you can run PowerDNS-Admin by command Open your web browser and go to `http://localhost:9191` to visit PowerDNS-Admin web interface. Register a user. The first user will be in the Administrator role. -This is good for testing, but for production usage, you should use gunicorn or uwsgi. See [Running PowerDNS Admin with Systemd, Gunicorn and Nginx](web-server/Running-PowerDNS-Admin-with-Systemd,-Gunicorn--and--Nginx.md) for instructions. \ No newline at end of file +This is good for testing, but for production usage, you should use gunicorn or uwsgi. See [Running PowerDNS Admin with Systemd, Gunicorn and Nginx](../web-server/Running-PowerDNS-Admin-with-Systemd-Gunicorn-and-Nginx.md) for instructions. \ No newline at end of file diff --git a/docs/wiki/web-server/Running-PowerDNS-Admin-with-Systemd,-Gunicorn--and--Nginx.md b/docs/wiki/web-server/Running-PowerDNS-Admin-with-Systemd-Gunicorn-and-Nginx.md similarity index 100% rename from docs/wiki/web-server/Running-PowerDNS-Admin-with-Systemd,-Gunicorn--and--Nginx.md rename to docs/wiki/web-server/Running-PowerDNS-Admin-with-Systemd-Gunicorn-and-Nginx.md From 3bcda68df9947733e9d5c09d147db5167153485b Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 20:43:10 -0400 Subject: [PATCH 05/39] Add placeholders for environment variables and Docker. --- docs/wiki/install/Running-PowerDNS-Admin-on-Docker.md | 1 + docs/wiki/preparation/Environment-variables.md | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 docs/wiki/install/Running-PowerDNS-Admin-on-Docker.md create mode 100644 docs/wiki/preparation/Environment-variables.md diff --git a/docs/wiki/install/Running-PowerDNS-Admin-on-Docker.md b/docs/wiki/install/Running-PowerDNS-Admin-on-Docker.md new file mode 100644 index 0000000..6af7286 --- /dev/null +++ b/docs/wiki/install/Running-PowerDNS-Admin-on-Docker.md @@ -0,0 +1 @@ +# Installation on docker \ No newline at end of file diff --git a/docs/wiki/preparation/Environment-variables.md b/docs/wiki/preparation/Environment-variables.md new file mode 100644 index 0000000..d83b744 --- /dev/null +++ b/docs/wiki/preparation/Environment-variables.md @@ -0,0 +1,2 @@ +# Supported environment variables + From 254c00ae92181f5414a015e3c2698f79c6146ab2 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 20:43:54 -0400 Subject: [PATCH 06/39] Add placeholder for getting started. --- docs/wiki/configuration/Getting-started.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/wiki/configuration/Getting-started.md diff --git a/docs/wiki/configuration/Getting-started.md b/docs/wiki/configuration/Getting-started.md new file mode 100644 index 0000000..44bd3c6 --- /dev/null +++ b/docs/wiki/configuration/Getting-started.md @@ -0,0 +1 @@ +# Getting started with PowerDNS-Admin \ No newline at end of file From 59ab3dcecd124bd03ffbbb8fb46ad572d3d91215 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 20:44:10 -0400 Subject: [PATCH 07/39] Add link to getting started. --- docs/wiki/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/wiki/README.md b/docs/wiki/README.md index b7d2f3d..779951c 100644 --- a/docs/wiki/README.md +++ b/docs/wiki/README.md @@ -12,7 +12,9 @@ - [Running PowerDNS-Admin on FreeBSD 12.1-RELEASE](install/Running-on-FreeBSD.md) ### Post install Setup: -- [Running PowerDNS-Admin as a service using Systemd](install/Running-PowerDNS-Admin-as-a-service-(Systemd).md) +- [Getting started](configuration/Getting-started.md) +- SystemD: + - [Running PowerDNS-Admin as a service using Systemd](install/Running-PowerDNS-Admin-as-a-service-(Systemd).md) ## Web Server configuration From 16fbf412d874c14b6fa5ca27ee181c4b108e417b Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 20:53:14 -0400 Subject: [PATCH 08/39] Fill in DB URI and secret key. --- docs/wiki/preparation/Environment-variables.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/wiki/preparation/Environment-variables.md b/docs/wiki/preparation/Environment-variables.md index d83b744..3dc0ea0 100644 --- a/docs/wiki/preparation/Environment-variables.md +++ b/docs/wiki/preparation/Environment-variables.md @@ -1,2 +1,9 @@ # Supported environment variables +| Variable | Description | Default value | +| -------------- | ----------- | --------------- | +| SQLALCHEMY_DATABASE_URI | SQL Alchemy URI to connect to database | | +| SECRET_KEY | Flask secret key [^1] | | + + +[^1]: Flask secret key (see https://flask.palletsprojects.com/en/2.0.x/config/#SECRET_KEY for how to generate) From 5a58e70e8cdb1ce54dcce07f40f7a17e41f07572 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 20:53:30 -0400 Subject: [PATCH 09/39] Add link to environment variables docs. --- docs/wiki/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/wiki/README.md b/docs/wiki/README.md index 779951c..d775273 100644 --- a/docs/wiki/README.md +++ b/docs/wiki/README.md @@ -3,6 +3,7 @@ ## Preparation guides - [Prepare MySQL or MariaDB Database for PowerDNS-Admin](preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md) - [Using PowerDNS-Admin with PostgreSQL](preparation/Using-PowerDNS-Admin-with-PostgreSQL.md) +- [Environment Variables](preparation/Environment-variables.md) ## Installation guides - [Running PowerDNS-Admin on Ubuntu or Debian](install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md) From 57b092771827932ed18a087b833519dd78886398 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 20:56:40 -0400 Subject: [PATCH 10/39] Minor formatting changes to README. --- docs/wiki/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/wiki/README.md b/docs/wiki/README.md index d775273..b853d87 100644 --- a/docs/wiki/README.md +++ b/docs/wiki/README.md @@ -1,9 +1,8 @@ # Welcome to the PowerDNS-Admin wiki! -## Preparation guides +## Database Setup guides - [Prepare MySQL or MariaDB Database for PowerDNS-Admin](preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md) - [Using PowerDNS-Admin with PostgreSQL](preparation/Using-PowerDNS-Admin-with-PostgreSQL.md) -- [Environment Variables](preparation/Environment-variables.md) ## Installation guides - [Running PowerDNS-Admin on Ubuntu or Debian](install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md) @@ -13,11 +12,11 @@ - [Running PowerDNS-Admin on FreeBSD 12.1-RELEASE](install/Running-on-FreeBSD.md) ### Post install Setup: +- [Environment Variables](preparation/Environment-variables.md) - [Getting started](configuration/Getting-started.md) - SystemD: - [Running PowerDNS-Admin as a service using Systemd](install/Running-PowerDNS-Admin-as-a-service-(Systemd).md) - ## Web Server configuration - [Supervisord](web-server/Supervisord-example.md) - [Systemd](web-server/Systemd-example.md) From 2c34307365c9be8dec8481ea30e35e4053ec0a0b Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 20:59:35 -0400 Subject: [PATCH 11/39] Move environment vars to configuration --- docs/wiki/README.md | 16 ++++++++-------- .../Environment-variables.md | 0 2 files changed, 8 insertions(+), 8 deletions(-) rename docs/wiki/{preparation => configuration}/Environment-variables.md (100%) diff --git a/docs/wiki/README.md b/docs/wiki/README.md index b853d87..340b63a 100644 --- a/docs/wiki/README.md +++ b/docs/wiki/README.md @@ -1,18 +1,18 @@ # Welcome to the PowerDNS-Admin wiki! ## Database Setup guides -- [Prepare MySQL or MariaDB Database for PowerDNS-Admin](preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md) -- [Using PowerDNS-Admin with PostgreSQL](preparation/Using-PowerDNS-Admin-with-PostgreSQL.md) +- [MySQL or MariaDB](preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md) +- [PostgreSQL](preparation/Using-PowerDNS-Admin-with-PostgreSQL.md) ## Installation guides -- [Running PowerDNS-Admin on Ubuntu or Debian](install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md) -- [Running PowerDNS-Admin on Centos 7](install/Running-PowerDNS-Admin-on-Centos-7.md) -- [Running PowerDNS-Admin on Fedora 23](install/Running-PowerDNS-Admin-on-Fedora-23.md) -- [Running PowerDNS-Admin on Fedora 30](install/Running-PowerDNS-Admin-on-Fedora-30.md) -- [Running PowerDNS-Admin on FreeBSD 12.1-RELEASE](install/Running-on-FreeBSD.md) +- [Installing PowerDNS-Admin on Ubuntu or Debian](install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md) +- [Installing PowerDNS-Admin on Centos 7](install/Running-PowerDNS-Admin-on-Centos-7.md) +- [Installing PowerDNS-Admin on Fedora 23](install/Running-PowerDNS-Admin-on-Fedora-23.md) +- [Installing PowerDNS-Admin on Fedora 30](install/Running-PowerDNS-Admin-on-Fedora-30.md) +- [Installing PowerDNS-Admin on FreeBSD 12.1-RELEASE](install/Running-on-FreeBSD.md) ### Post install Setup: -- [Environment Variables](preparation/Environment-variables.md) +- [Environment Variables](configuration/Environment-variables.md) - [Getting started](configuration/Getting-started.md) - SystemD: - [Running PowerDNS-Admin as a service using Systemd](install/Running-PowerDNS-Admin-as-a-service-(Systemd).md) diff --git a/docs/wiki/preparation/Environment-variables.md b/docs/wiki/configuration/Environment-variables.md similarity index 100% rename from docs/wiki/preparation/Environment-variables.md rename to docs/wiki/configuration/Environment-variables.md From e0970541b4dad20593da4c296a561002689691e2 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:10:45 -0400 Subject: [PATCH 12/39] Update links to be more readable. --- docs/wiki/README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/wiki/README.md b/docs/wiki/README.md index 340b63a..9a7226d 100644 --- a/docs/wiki/README.md +++ b/docs/wiki/README.md @@ -1,15 +1,16 @@ # Welcome to the PowerDNS-Admin wiki! -## Database Setup guides +## Database Setup guides: - [MySQL or MariaDB](preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md) - [PostgreSQL](preparation/Using-PowerDNS-Admin-with-PostgreSQL.md) -## Installation guides -- [Installing PowerDNS-Admin on Ubuntu or Debian](install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md) -- [Installing PowerDNS-Admin on Centos 7](install/Running-PowerDNS-Admin-on-Centos-7.md) -- [Installing PowerDNS-Admin on Fedora 23](install/Running-PowerDNS-Admin-on-Fedora-23.md) -- [Installing PowerDNS-Admin on Fedora 30](install/Running-PowerDNS-Admin-on-Fedora-30.md) -- [Installing PowerDNS-Admin on FreeBSD 12.1-RELEASE](install/Running-on-FreeBSD.md) +## Installation guides: +- [Install on Centos 7](install/Running-PowerDNS-Admin-on-Centos-7.md) +- [Install on Docker](install/Running-PowerDNS-Admin-on-Docker.md) +- [Install on Fedora 23](install/Running-PowerDNS-Admin-on-Fedora-23.md) +- [Install on Fedora 30](install/Running-PowerDNS-Admin-on-Fedora-30.md) +- [Install on FreeBSD 12.1-RELEASE](install/Running-on-FreeBSD.md) +- [Install on Ubuntu or Debian](install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md) ### Post install Setup: - [Environment Variables](configuration/Environment-variables.md) @@ -17,7 +18,7 @@ - SystemD: - [Running PowerDNS-Admin as a service using Systemd](install/Running-PowerDNS-Admin-as-a-service-(Systemd).md) -## Web Server configuration +### Web Server configuration: - [Supervisord](web-server/Supervisord-example.md) - [Systemd](web-server/Systemd-example.md) - [Systemd + Gunicorn + Nginx](web-server/Running-PowerDNS-Admin-with-Systemd-Gunicorn-and-Nginx.md) @@ -25,5 +26,10 @@ - [uWSGI](web-server/uWSGI-example.md) - [WSGI-Apache](web-server/WSGI-Apache-example.md) +## Using PowerDNS-Admin: +- Setting up a domain +- Adding a record +- + ## Feature usage - [DynDNS2](features/DynDNS2.md) \ No newline at end of file From fb387eb570356b10fa338a5036da88f1b323b257 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:13:26 -0400 Subject: [PATCH 13/39] Minor formatting change. --- docs/wiki/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/wiki/README.md b/docs/wiki/README.md index 9a7226d..6de6dc2 100644 --- a/docs/wiki/README.md +++ b/docs/wiki/README.md @@ -1,7 +1,7 @@ # Welcome to the PowerDNS-Admin wiki! ## Database Setup guides: -- [MySQL or MariaDB](preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md) +- [MySQL / MariaDB](preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md) - [PostgreSQL](preparation/Using-PowerDNS-Admin-with-PostgreSQL.md) ## Installation guides: From 76315aac6d3c6973f8e07657f7e12810cbf07911 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:16:26 -0400 Subject: [PATCH 14/39] Add required column to table. --- docs/wiki/configuration/Environment-variables.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/wiki/configuration/Environment-variables.md b/docs/wiki/configuration/Environment-variables.md index 3dc0ea0..097bf16 100644 --- a/docs/wiki/configuration/Environment-variables.md +++ b/docs/wiki/configuration/Environment-variables.md @@ -1,9 +1,9 @@ # Supported environment variables -| Variable | Description | Default value | -| -------------- | ----------- | --------------- | -| SQLALCHEMY_DATABASE_URI | SQL Alchemy URI to connect to database | | -| SECRET_KEY | Flask secret key [^1] | | +| Variable | Description | Required | Default value | +| ---------| ----------- | -------- | ------------- | +| SQLALCHEMY_DATABASE_URI | SQL Alchemy URI to connect to database | Y | | +| SECRET_KEY | Flask secret key [^1] | Y | | [^1]: Flask secret key (see https://flask.palletsprojects.com/en/2.0.x/config/#SECRET_KEY for how to generate) From d2c0c94e61000e1664e85d980fd8e4c760521ad5 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:19:18 -0400 Subject: [PATCH 15/39] Flesh out docker setup. --- .../install/Running-PowerDNS-Admin-on-Docker.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/wiki/install/Running-PowerDNS-Admin-on-Docker.md b/docs/wiki/install/Running-PowerDNS-Admin-on-Docker.md index 6af7286..2f23845 100644 --- a/docs/wiki/install/Running-PowerDNS-Admin-on-Docker.md +++ b/docs/wiki/install/Running-PowerDNS-Admin-on-Docker.md @@ -1 +1,14 @@ -# Installation on docker \ No newline at end of file +# Installation on docker + +The Docker image is ngoduykhanh/powerdns-admin available on [DockerHub](https://hub.docker.com/r/ngoduykhanh/powerdns-admin) + +The supported environment variables to configure the container are located [here](../configuration/Environment-variables.md). + +You can run the container and expose the web server on port 9191 using: +```bash +docker run -d \ + -e SECRET_KEY='a-very-secret-key' \ + -v pda-data:/data \ + -p 9191:80 \ + ngoduykhanh/powerdns-admin:latest +``` From 7a2f83a888adb766c862e1adea85c403d3d9bdb3 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:19:55 -0400 Subject: [PATCH 16/39] Update environment var required. --- docs/wiki/configuration/Environment-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/wiki/configuration/Environment-variables.md b/docs/wiki/configuration/Environment-variables.md index 097bf16..35e2a00 100644 --- a/docs/wiki/configuration/Environment-variables.md +++ b/docs/wiki/configuration/Environment-variables.md @@ -2,7 +2,7 @@ | Variable | Description | Required | Default value | | ---------| ----------- | -------- | ------------- | -| SQLALCHEMY_DATABASE_URI | SQL Alchemy URI to connect to database | Y | | +| SQLALCHEMY_DATABASE_URI | SQL Alchemy URI to connect to database | N | | | SECRET_KEY | Flask secret key [^1] | Y | | From 19e5750974a83f67eb1225ff9347e622116f2ffb Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:22:13 -0400 Subject: [PATCH 17/39] Dropped documentation to 1.1.x since that is the version being used. --- docs/wiki/configuration/Environment-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/wiki/configuration/Environment-variables.md b/docs/wiki/configuration/Environment-variables.md index 35e2a00..c24185a 100644 --- a/docs/wiki/configuration/Environment-variables.md +++ b/docs/wiki/configuration/Environment-variables.md @@ -6,4 +6,4 @@ | SECRET_KEY | Flask secret key [^1] | Y | | -[^1]: Flask secret key (see https://flask.palletsprojects.com/en/2.0.x/config/#SECRET_KEY for how to generate) +[^1]: Flask secret key (see https://flask.palletsprojects.com/en/1.1.x/config/#SECRET_KEY for how to generate) From 2dec2ad2041d784242925c6f776bff7721ec65fe Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:23:28 -0400 Subject: [PATCH 18/39] Fix default values. --- docs/wiki/configuration/Environment-variables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/wiki/configuration/Environment-variables.md b/docs/wiki/configuration/Environment-variables.md index c24185a..7b835e2 100644 --- a/docs/wiki/configuration/Environment-variables.md +++ b/docs/wiki/configuration/Environment-variables.md @@ -2,8 +2,8 @@ | Variable | Description | Required | Default value | | ---------| ----------- | -------- | ------------- | -| SQLALCHEMY_DATABASE_URI | SQL Alchemy URI to connect to database | N | | -| SECRET_KEY | Flask secret key [^1] | Y | | +| SQLALCHEMY_DATABASE_URI | SQL Alchemy URI to connect to database | N | no default | +| SECRET_KEY | Flask secret key [^1] | Y | no default | [^1]: Flask secret key (see https://flask.palletsprojects.com/en/1.1.x/config/#SECRET_KEY for how to generate) From dc495ce4265ab467a9a179759abfb21a4223acad Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:44:52 -0400 Subject: [PATCH 19/39] 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' From 55537e5bce0c90bcf2b0bdfba4836ef445b40a9c Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:46:49 -0400 Subject: [PATCH 20/39] Update links to database setup. --- docs/wiki/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/wiki/README.md b/docs/wiki/README.md index 6de6dc2..d271287 100644 --- a/docs/wiki/README.md +++ b/docs/wiki/README.md @@ -1,8 +1,8 @@ # Welcome to the PowerDNS-Admin wiki! ## Database Setup guides: -- [MySQL / MariaDB](preparation/Prepare-MySQL-or-MariaDB-Database-for-PowerDNS-Admin.md) -- [PostgreSQL](preparation/Using-PowerDNS-Admin-with-PostgreSQL.md) +- [MySQL / MariaDB](database-setup/Setup-MySQL-or-MariaDB.md) +- [PostgreSQL](database-setup/Setup-PostgreSQL.md) ## Installation guides: - [Install on Centos 7](install/Running-PowerDNS-Admin-on-Centos-7.md) From b5661b61a09737676a635cc69af4409ffd476782 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:47:28 -0400 Subject: [PATCH 21/39] Add postgres URI to getting-started. --- docs/wiki/configuration/Getting-started.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/wiki/configuration/Getting-started.md b/docs/wiki/configuration/Getting-started.md index 44bd3c6..c27beb1 100644 --- a/docs/wiki/configuration/Getting-started.md +++ b/docs/wiki/configuration/Getting-started.md @@ -1 +1,10 @@ -# Getting started with PowerDNS-Admin \ No newline at end of file +# Getting started with PowerDNS-Admin + + +In your `config.py` file, make sure you have the database URI filled in: + +For Postgres: +``` +SQLALCHEMY_DATABASE_URI = 'postgresql://powerdnsadmin:powerdnsadmin@127.0.0.1/powerdnsadmindb' +``` + From 4952f2de061c43fe82705ba735ae46432405fff1 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:48:29 -0400 Subject: [PATCH 22/39] Add postgres dependencies for postgres. --- docs/wiki/install/Running-PowerDNS-Admin-on-Fedora-30.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/wiki/install/Running-PowerDNS-Admin-on-Fedora-30.md b/docs/wiki/install/Running-PowerDNS-Admin-on-Fedora-30.md index 51b705c..bbd9f03 100644 --- a/docs/wiki/install/Running-PowerDNS-Admin-on-Fedora-30.md +++ b/docs/wiki/install/Running-PowerDNS-Admin-on-Fedora-30.md @@ -14,6 +14,11 @@ dnf install python37 python3-devel python3-pip ```bash dnf install mariadb-devel mariadb-common openldap-devel xmlsec1-devel xmlsec1-openssl libtool-ltdl-devel ``` +**Install Postgres dependencies** +```bash +$ sudo yum install postgresql-libs +$ pip3 install psycopg2 +``` **Install Development tools** ```bash dnf install gcc gc make @@ -27,6 +32,7 @@ pip3.7 install -U pip pip install -U virtualenv ``` + **Install Yarn for building NodeJS asset files:** ```bash dnf install npm From 2129c050e82f9b73583c2e0f4a71ed56ede83b9e Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:54:18 -0400 Subject: [PATCH 23/39] Minor re-formatting. --- docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md index 139e515..91fbe0f 100644 --- a/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md +++ b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md @@ -2,14 +2,14 @@ This guide will show you how to prepare a MySQL or MariaDB database for PowerDNS-Admin. -### Step-by-step instructions +## 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:** +## Known issues: 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. @@ -21,4 +21,4 @@ _Solution_: Convert the column to MEDIUMTEXT: * `USE powerdnsadmin;` -* `ALTER TABLE history MODIFY detail MEDIUMTEXT;` \ No newline at end of file +* `ALTER TABLE history MODIFY detail MEDIUMTEXT;` From 1cd14210b93f0aa5c121abbc0dfda25d07ec3de4 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 21:56:16 -0400 Subject: [PATCH 24/39] Change header --- docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md index 91fbe0f..8e9186d 100644 --- a/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md +++ b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md @@ -2,7 +2,7 @@ This guide will show you how to prepare a MySQL or MariaDB database for PowerDNS-Admin. -## Step-by-step instructions +## Setup database: 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';` From d6838cf802c5619c557e4a84532fa7323802f6e8 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 22:02:37 -0400 Subject: [PATCH 25/39] Add mysql DB URI --- docs/wiki/configuration/Getting-started.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/wiki/configuration/Getting-started.md b/docs/wiki/configuration/Getting-started.md index c27beb1..b3b16ba 100644 --- a/docs/wiki/configuration/Getting-started.md +++ b/docs/wiki/configuration/Getting-started.md @@ -3,6 +3,11 @@ In your `config.py` file, make sure you have the database URI filled in: +For MySQL / MariaDB: +``` +SQLALCHEMY_DATABASE_URI = 'mysql://username:password@127.0.0.1/db_name' +``` + For Postgres: ``` SQLALCHEMY_DATABASE_URI = 'postgresql://powerdnsadmin:powerdnsadmin@127.0.0.1/powerdnsadmindb' From 3c5b88340579fea9f7916d923bd56c08a34d3af9 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 22:02:51 -0400 Subject: [PATCH 26/39] Add DB setup README.md --- docs/wiki/database-setup/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 docs/wiki/database-setup/README.md diff --git a/docs/wiki/database-setup/README.md b/docs/wiki/database-setup/README.md new file mode 100644 index 0000000..1f8ea09 --- /dev/null +++ b/docs/wiki/database-setup/README.md @@ -0,0 +1,4 @@ +# Database setup guides + +[MySQL / MariaDB](Setup-MySQL-or-MaraDB.md) +[Postgres](Setup-PostgreSQL.md) From 9f8c4164326936ec445aaa662120f45721b5667c Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 22:06:24 -0400 Subject: [PATCH 27/39] Make db list a list. --- docs/wiki/database-setup/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/wiki/database-setup/README.md b/docs/wiki/database-setup/README.md index 1f8ea09..0c6aee6 100644 --- a/docs/wiki/database-setup/README.md +++ b/docs/wiki/database-setup/README.md @@ -1,4 +1,4 @@ # Database setup guides -[MySQL / MariaDB](Setup-MySQL-or-MaraDB.md) -[Postgres](Setup-PostgreSQL.md) +- [MySQL / MariaDB](Setup-MySQL-or-MaraDB.md) +- [Postgres](Setup-PostgreSQL.md) From be933db09a32ada563c7adfd275ba7278c49df0f Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 22:37:29 -0400 Subject: [PATCH 28/39] Add documentation on how to allow remote connection on postgres. --- docs/wiki/database-setup/Setup-PostgreSQL.md | 23 ++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/wiki/database-setup/Setup-PostgreSQL.md b/docs/wiki/database-setup/Setup-PostgreSQL.md index 2af39a0..a3b0e5b 100644 --- a/docs/wiki/database-setup/Setup-PostgreSQL.md +++ b/docs/wiki/database-setup/Setup-PostgreSQL.md @@ -16,9 +16,28 @@ 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 +If your database is on a different server postgres does not allow remote connections by default. -- You might need to adjust your PostgreSQL's `pg_hba.conf` config file to allow password authentication for networks. +``` +[root@host ~]$ sudo su - postgres +# Edit /var/lib/pgsql/data/postgresql.conf +# Change the following line: +listen_addresses = 'localhost' +# to: +listen_addresses = '*' +# Edit /var/lib/pgsql/data/pg_hba.conf +# Add the following lines to the end of the +host all all 0.0.0.0/0 md5 +host all all ::/0 md5 + +[postgres@host ~]$ exit +[root@host ~]$ sudo systemctl restart postgresql +``` + +On debian based systems these files are located in: +``` +/etc/postgresql//main/ +``` ## Docker ``` From fa6c58978ba1559d655c6c1ba9f018aeb2086438 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 22:50:25 -0400 Subject: [PATCH 29/39] Cleaned up mysql setup process. --- .../database-setup/Setup-MySQL-or-MariaDB.md | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md index 8e9186d..f028984 100644 --- a/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md +++ b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md @@ -2,23 +2,26 @@ This guide will show you how to prepare a MySQL or MariaDB database for PowerDNS-Admin. +We assume the database is installed per your platform's directions (apt, yum, etc). + ## Setup database: -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` + +Connect to the database (Usually using `mysql -u root -p` - then enter your MySQL/MariaDB root users password if applicable), then enter the following: +``` +CREATE DATABASE `powerdnsadmin` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +GRANT ALL PRIVILEGES ON `powerdnsadmin`.* TO 'pdnsadminuser'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD_HERE'; +FLUSH PRIVILEGES; +quit +``` ## Known issues: -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. +Problem: 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;` +Solution: Convert the column to MEDIUMTEXT: +``` +USE powerdnsadmin; +ALTER TABLE history MODIFY detail MEDIUMTEXT; +``` From 117659dd3105b8778c5ab0e9071958368a4da00e Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 22:51:59 -0400 Subject: [PATCH 30/39] Moved database setup to database-setup. --- ...nning-PowerDNS-Admin-on-Ubuntu-or-Debian.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md b/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md index b4e3b66..137f1a7 100644 --- a/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md +++ b/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md @@ -1,4 +1,9 @@ -## Install required packages +# Installing PowerDNS-Admin on Ubuntu or Debian based systems + +First setup your database accordingly: +[Database Setup](../database-setup/README.md) + +## Install required packages: **Install Python 3 development package** @@ -14,16 +19,7 @@ sudo apt install -y git libmysqlclient-dev libsasl2-dev libldap2-dev libssl-dev _**Note:**_ I am using MySQL Community server as the database backend. So `libmysqlclient-dev` is required. For MariaDB, and PostgreSQL the required package will be difference. -** Install Maria or MySQL (ONLY if not ALREADY installed)** -```bash -sudo apt install mariadb-server mariadb-client -``` -Create database and user using mysql command and entering -```bash ->create database pda; ->grant all privileges on pda.* TO 'pda'@'localhost' identified by 'YOUR_PASSWORD_HERE'; ->flush privileges; -``` + **Install NodeJs** ```bash From 09b661a8a371dbf4dc6ae33df823d977c6e114f3 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 22:53:23 -0400 Subject: [PATCH 31/39] Fix spelling mistake --- docs/wiki/database-setup/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/wiki/database-setup/README.md b/docs/wiki/database-setup/README.md index 0c6aee6..e4e4d01 100644 --- a/docs/wiki/database-setup/README.md +++ b/docs/wiki/database-setup/README.md @@ -1,4 +1,4 @@ # Database setup guides -- [MySQL / MariaDB](Setup-MySQL-or-MaraDB.md) -- [Postgres](Setup-PostgreSQL.md) +- [MySQL / MariaDB](Setup-MySQL-or-MariaDB.md) +- [PostgreSQL](Setup-PostgreSQL.md) From 099579de1144dad74cc398002845c6dd58fcbcda Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 23:04:23 -0400 Subject: [PATCH 32/39] Add db setup considerations for MySQL. --- docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md index f028984..d14d2a9 100644 --- a/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md +++ b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md @@ -13,6 +13,8 @@ GRANT ALL PRIVILEGES ON `powerdnsadmin`.* TO 'pdnsadminuser'@'localhost' IDENTIF FLUSH PRIVILEGES; quit ``` +- If your database server is located on a different machine then change 'localhost' to '%' +- Replace YOUR_PASSWORD_HERE with a secure password. ## Known issues: From 5f643ccb78adc0c977f61dfc3ff04a26873bceb0 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Thu, 8 Dec 2022 23:11:04 -0400 Subject: [PATCH 33/39] Explain where the config.py is. --- docs/wiki/configuration/Getting-started.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/wiki/configuration/Getting-started.md b/docs/wiki/configuration/Getting-started.md index b3b16ba..0e322da 100644 --- a/docs/wiki/configuration/Getting-started.md +++ b/docs/wiki/configuration/Getting-started.md @@ -1,7 +1,9 @@ # Getting started with PowerDNS-Admin -In your `config.py` file, make sure you have the database URI filled in: +In your FLASK_CONF (check the installation directions for where yours is) file, make sure you have the database URI filled in (in some previous documentation this was called config.py): + +TODO: list location of config.py For MySQL / MariaDB: ``` From 496222e6b7b3145c73e0103b4280eba5fb17d8ed Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Fri, 9 Dec 2022 06:46:02 -0400 Subject: [PATCH 34/39] Remove TODO and add setup of first user. --- docs/wiki/configuration/Getting-started.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/wiki/configuration/Getting-started.md b/docs/wiki/configuration/Getting-started.md index 0e322da..ce72234 100644 --- a/docs/wiki/configuration/Getting-started.md +++ b/docs/wiki/configuration/Getting-started.md @@ -3,8 +3,6 @@ In your FLASK_CONF (check the installation directions for where yours is) file, make sure you have the database URI filled in (in some previous documentation this was called config.py): -TODO: list location of config.py - For MySQL / MariaDB: ``` SQLALCHEMY_DATABASE_URI = 'mysql://username:password@127.0.0.1/db_name' @@ -15,3 +13,4 @@ For Postgres: SQLALCHEMY_DATABASE_URI = 'postgresql://powerdnsadmin:powerdnsadmin@127.0.0.1/powerdnsadmindb' ``` +Open your web browser and go to `http://localhost:9191` to visit PowerDNS-Admin web interface. Register a user. The first user will be in the Administrator role. From a5fdd8ffc4b8ce8ee64ccd383e2bf3c18b817ecd Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Fri, 9 Dec 2022 06:46:40 -0400 Subject: [PATCH 35/39] Change notes to headers and move setup of first user to getting started. --- ...nning-PowerDNS-Admin-on-Ubuntu-or-Debian.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md b/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md index 137f1a7..91738dd 100644 --- a/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md +++ b/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md @@ -5,13 +5,13 @@ First setup your database accordingly: ## Install required packages: -**Install Python 3 development package** +###Install Python 3 development package ```bash sudo apt install python3-dev ``` -**Install required packages for building python libraries from requirements.txt file** +###Install required packages for building python libraries from requirements.txt file ```bash sudo apt install -y git libmysqlclient-dev libsasl2-dev libldap2-dev libssl-dev libxml2-dev libxslt1-dev libxmlsec1-dev libffi-dev pkg-config apt-transport-https virtualenv build-essential curl @@ -20,14 +20,14 @@ sudo apt install -y git libmysqlclient-dev libsasl2-dev libldap2-dev libssl-dev _**Note:**_ I am using MySQL Community server as the database backend. So `libmysqlclient-dev` is required. For MariaDB, and PostgreSQL the required package will be difference. -**Install NodeJs** +###Install NodeJs ```bash curl -sL https://deb.nodesource.com/setup_14.x | bash - apt install -y nodejs ``` -**Install yarn to build asset files** +###Install yarn to build asset files ```bash sudo curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - @@ -36,7 +36,7 @@ sudo apt update -y sudo apt install -y yarn ``` -## Checkout source code and create virtualenv +###Checkout source code and create virtualenv _**Note:**_ Please adjust `/opt/web/powerdns-admin` to your local web application directory ```bash @@ -52,9 +52,6 @@ source ./venv/bin/activate pip install --upgrade pip pip install -r requirements.txt ``` - - - ## Running PowerDNS-Admin Create PowerDNS-Admin config file and make the changes necessary for your use case. Make sure to change `SECRET_KEY` to a long random string that you generated yourself ([see Flask docs](https://flask.palletsprojects.com/en/1.1.x/config/#SECRET_KEY)), do not use the pre-defined one. E.g.: @@ -85,6 +82,7 @@ Now you can run PowerDNS-Admin by command ./run.py ``` -Open your web browser and go to `http://localhost:9191` to visit PowerDNS-Admin web interface. Register a user. The first user will be in the Administrator role. +This is good for testing, but for production usage, you should use gunicorn or uwsgi. See [Running PowerDNS Admin with Systemd, Gunicorn and Nginx](../web-server/Running-PowerDNS-Admin-with-Systemd-Gunicorn-and-Nginx.md) for instructions. -This is good for testing, but for production usage, you should use gunicorn or uwsgi. See [Running PowerDNS Admin with Systemd, Gunicorn and Nginx](../web-server/Running-PowerDNS-Admin-with-Systemd-Gunicorn-and-Nginx.md) for instructions. \ No newline at end of file + +From here you can now follow the [Getting started guide](../configuration/Getting-started.md). From e06fcd75ce9a69d9fc947d8fd26e34e2168b4d62 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Fri, 9 Dec 2022 07:02:26 -0400 Subject: [PATCH 36/39] Moved database specific packages to the setup MySQL directions. --- docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md index d14d2a9..246a0a5 100644 --- a/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md +++ b/docs/wiki/database-setup/Setup-MySQL-or-MariaDB.md @@ -16,6 +16,20 @@ quit - If your database server is located on a different machine then change 'localhost' to '%' - Replace YOUR_PASSWORD_HERE with a secure password. +## Install required packages: +### Red-hat based systems: + +### Debian based systems: +``` +apt install libmysqlclient-dev +``` + +### Install python packages: +``` +pip3 install mysqlclient==2.0.1 +``` + + ## Known issues: Problem: 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. From 5ab04509c336bc32d3e086bebd8cc2af7e3e1456 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Fri, 9 Dec 2022 07:03:07 -0400 Subject: [PATCH 37/39] Remove MySQL specific documentation --- ...ning-PowerDNS-Admin-on-Ubuntu-or-Debian.md | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md b/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md index 91738dd..d3bc834 100644 --- a/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md +++ b/docs/wiki/install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md @@ -5,29 +5,20 @@ First setup your database accordingly: ## Install required packages: -###Install Python 3 development package +### Install required packages for building python libraries from requirements.txt file ```bash -sudo apt install python3-dev +sudo apt install -y python3-dev git libsasl2-dev libldap2-dev libssl-dev libxml2-dev libxslt1-dev libxmlsec1-dev libffi-dev pkg-config apt-transport-https virtualenv build-essential curl ``` -###Install required packages for building python libraries from requirements.txt file - -```bash -sudo apt install -y git libmysqlclient-dev libsasl2-dev libldap2-dev libssl-dev libxml2-dev libxslt1-dev libxmlsec1-dev libffi-dev pkg-config apt-transport-https virtualenv build-essential curl -``` - -_**Note:**_ I am using MySQL Community server as the database backend. So `libmysqlclient-dev` is required. For MariaDB, and PostgreSQL the required package will be difference. - - -###Install NodeJs +### Install NodeJs ```bash curl -sL https://deb.nodesource.com/setup_14.x | bash - apt install -y nodejs ``` -###Install yarn to build asset files +### Install yarn to build asset files ```bash sudo curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - @@ -36,7 +27,7 @@ sudo apt update -y sudo apt install -y yarn ``` -###Checkout source code and create virtualenv +### Checkout source code and create virtualenv _**Note:**_ Please adjust `/opt/web/powerdns-admin` to your local web application directory ```bash From 8b986db2acc692786ceed5634ef59c3ccb637b30 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Fri, 9 Dec 2022 07:11:12 -0400 Subject: [PATCH 38/39] Desc added for what is being created. --- docs/wiki/database-setup/Setup-PostgreSQL.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/wiki/database-setup/Setup-PostgreSQL.md b/docs/wiki/database-setup/Setup-PostgreSQL.md index a3b0e5b..40c1287 100644 --- a/docs/wiki/database-setup/Setup-PostgreSQL.md +++ b/docs/wiki/database-setup/Setup-PostgreSQL.md @@ -3,6 +3,8 @@ We assume you already have a postgres database software installed for your platform. ### Create database +The below will create a database called powerdnsadmindb and a user of powerdnsadmin. + ``` $ sudo su - postgres $ createuser powerdnsadmin @@ -18,6 +20,7 @@ Note: ### Setup Remote access to database: If your database is on a different server postgres does not allow remote connections by default. +To change this follow the below directions: ``` [root@host ~]$ sudo su - postgres # Edit /var/lib/pgsql/data/postgresql.conf @@ -31,7 +34,7 @@ host all all 0.0.0.0/0 md5 host all all ::/0 md5 [postgres@host ~]$ exit -[root@host ~]$ sudo systemctl restart postgresql +[root@host ~]$ sudo systemctl restart postgresql ``` On debian based systems these files are located in: @@ -40,6 +43,7 @@ On debian based systems these files are located in: ``` ## 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' From b1a3a98692487283816bbe429143e232759fc051 Mon Sep 17 00:00:00 2001 From: David Mc Ken Date: Fri, 9 Dec 2022 07:25:25 -0400 Subject: [PATCH 39/39] Add general install notes. --- docs/wiki/README.md | 20 ++++++++++++++------ docs/wiki/install/General.md | 7 +++++++ 2 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 docs/wiki/install/General.md diff --git a/docs/wiki/README.md b/docs/wiki/README.md index d271287..8a002bd 100644 --- a/docs/wiki/README.md +++ b/docs/wiki/README.md @@ -5,12 +5,20 @@ - [PostgreSQL](database-setup/Setup-PostgreSQL.md) ## Installation guides: -- [Install on Centos 7](install/Running-PowerDNS-Admin-on-Centos-7.md) -- [Install on Docker](install/Running-PowerDNS-Admin-on-Docker.md) -- [Install on Fedora 23](install/Running-PowerDNS-Admin-on-Fedora-23.md) -- [Install on Fedora 30](install/Running-PowerDNS-Admin-on-Fedora-30.md) -- [Install on FreeBSD 12.1-RELEASE](install/Running-on-FreeBSD.md) -- [Install on Ubuntu or Debian](install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md) +- [General (Read this first)](install/General.md) + - BSD: + - [Install on FreeBSD 12.1-RELEASE](install/Running-on-FreeBSD.md) + - Containers: + - [Install on Docker](install/Running-PowerDNS-Admin-on-Docker.md) + - Debian: + - [Install on Ubuntu or Debian](install/Running-PowerDNS-Admin-on-Ubuntu-or-Debian.md) + - Red-Hat: + - [Install on Centos 7](install/Running-PowerDNS-Admin-on-Centos-7.md) + - [Install on Fedora 23](install/Running-PowerDNS-Admin-on-Fedora-23.md) + - [Install on Fedora 30](install/Running-PowerDNS-Admin-on-Fedora-30.md) + + + ### Post install Setup: - [Environment Variables](configuration/Environment-variables.md) diff --git a/docs/wiki/install/General.md b/docs/wiki/install/General.md new file mode 100644 index 0000000..98dfa1f --- /dev/null +++ b/docs/wiki/install/General.md @@ -0,0 +1,7 @@ +# General installation + + +## Requirements: + +- A linux based system with python 3 or later available. Debian and Red-hat based systems are recommended, others (Arch-based for example) may work but are currently not tested. +- A database for PowerDNS-Admin, if you are using a database for PowerDNS itself this must be separate to that database. \ No newline at end of file