usmannasir / cyberpanel

Cyber Panel - The hosting control panel for OpenLiteSpeed
GNU General Public License v3.0
1.6k stars 613 forks source link

Mange PowerDNS does not format config according to PDNS Documentation #347

Closed perf3ktion closed 4 years ago

perf3ktion commented 4 years ago

Hey team,

I am setting up a CyberPanel hosting server with two DNS Slaves. All are currently running CentOS Linux release 7.8.2003 (Core) with CyberPanel 2.0.

Issue

When configuring the MASTER DNS server in the UI and after entering multiple slaves (2 or 3), the allow-axfr-ips and also-notify values are separated by spaces, however they are requested to be separated by commas in the PDNS documentation. This prevents PDNS from being able to create a Master / Slave relationship correctly.

The result is a config similar to below:

allow-axfr-ips=192.168.0.2/32 192.168.0.3/32 also-notify=192.168.0.2 192.168.0.3

When it should resemble below:

allow-axfr-ips=192.168.0.2/32, 192.168.0.3/32 also-notify=192.168.0.2, 192.168.0.3

Expected

  1. Configure PowerDNS as a MASTER with minimum two SLAVE servers.
  2. Configuration persists through UI refresh / reload.
  3. Configuration has been saved in correct format, separated by commas.

Steps to Reproduce

  1. Login to CyberPanel
  2. Browse to Server > Manage Services > Manage PowerDNS
  3. Select Function Mode: MASTER
  4. Enter in hostname and IP addresses on two slaves.
  5. Click Save Changes
  6. View the pdns.conf file at /etc/pdns and notice the incorrectly formatted config for allow-axfr-ips and also-notify.

Thanks for your hard work :)

jacewalker commented 4 years ago

+1

meramsey commented 4 years ago

Should be relatively easy fix to do in this file. https://github.com/usmannasir/cyberpanel/blob/stable/manageServices/serviceManager.py

Not near a desktop to do that right now but I believe changing

ipsString = ipsString + '%s/32 ' % (items.slaveServerIP) ipStringNoSubnet = ipStringNoSubnet + '%s ' % (items.slaveServerIP)

To this would essentially correct the missing comma issue. ipsString = ipsString + '%s/32, ' % (items.slaveServerIP) ipStringNoSubnet = ipStringNoSubnet + '%s, ' % (items.slaveServerIP)

Recommend backing up this file making that modification and seeing if it adds It properly after that.

If that works please let us know and we can get a commit with that fix applied.

usmannasir commented 4 years ago

@whattheserver

Will further investigate.

usmannasir commented 4 years ago

Fixed.

perf3ktion commented 4 years ago

Hi @usmannasir, sorry I have been away. Would you still like me to test?

usmannasir commented 4 years ago

Yes, you can try using the upgrade guide I gave on https://github.com/usmannasir/cyberpanel/issues/346