Skip to content

Commit 99d85e6

Browse files
committed
Added mydns configuration to the installer.
1 parent 4f4b91f commit 99d85e6

File tree

4 files changed

+84
-2
lines changed

4 files changed

+84
-2
lines changed

install/install.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,14 @@
9090
swriteln('Configuring Getmail');
9191
$inst->configure_getmail();
9292

93-
// Configure Getmail
93+
// Configure Pureftpd
9494
swriteln('Configuring Pureftpd');
9595
$inst->configure_pureftpd();
9696

97+
// Configure MyDNS
98+
swriteln('Configuring MyDNS');
99+
$inst->configure_mydns();
100+
97101
// Configure ISPConfig
98102
swriteln('Installing ISPConfig');
99103
$inst->install_ispconfig();
@@ -128,6 +132,7 @@
128132
system("/etc/init.d/courier-pop-ssl restart");
129133
system("/etc/init.d/apache2 restart");
130134
system("/etc/init.d/pure-ftpd-mysql restart");
135+
system("/etc/init.d/mydns restart");
131136

132137
echo "Installation finished.\n";
133138

install/lib/installer_base.lib.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,25 @@ function configure_pureftpd() {
473473

474474
}
475475

476+
function configure_mydns() {
477+
global $conf;
478+
479+
// configure pam for SMTP authentication agains the ispconfig database
480+
$configfile = 'mydns.conf';
481+
if(is_file($conf["dist_mydns_config_dir"].'/'.$configfile)) copy($conf["dist_mydns_config_dir"].'/'.$configfile,$conf["dist_mydns_config_dir"].'/'.$configfile.'~');
482+
if(is_file($conf["dist_mydns_config_dir"].'/'.$configfile.'~')) exec('chmod 400 '.$conf["dist_mydns_config_dir"].'/'.$configfile.'~');
483+
$content = rf("tpl/".$configfile.".master");
484+
$content = str_replace('{mysql_server_ispconfig_user}',$conf["mysql_server_ispconfig_user"],$content);
485+
$content = str_replace('{mysql_server_ispconfig_password}',$conf["mysql_server_ispconfig_password"],$content);
486+
$content = str_replace('{mysql_server_database}',$conf["mysql_server_database"],$content);
487+
$content = str_replace('{mysql_server_ip}',$conf["mysql_server_ip"],$content);
488+
$content = str_replace('{server_id}',$conf["server_id"],$content);
489+
wf($conf["dist_mydns_config_dir"].'/'.$configfile,$content);
490+
exec('chmod 600 '.$conf["dist_mydns_config_dir"].'/'.$configfile);
491+
exec('chown root:root '.$conf["dist_mydns_config_dir"].'/'.$configfile);
492+
493+
}
494+
476495

477496
function install_ispconfig() {
478497
global $conf;

install/tpl/mydns.conf.master

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## AUTOMATICALLY GENERATED BY DEBCONF. DO NOT MODIFY DATABASE
2+
## INFORMATION (database, db-*)...
3+
## PLEASE RUN 'dpkg-reconfigure mydns-mysql' INSTEAD.
4+
## CHANGES TO THE FOLLOWING DIRECTIVES ARE NOT PRESERVED, BUT REPLACED,
5+
## ON UPGRADE:
6+
## user, group, pidfile, db-*, database
7+
8+
##
9+
## /etc/mydns.conf
10+
## Thu Aug 2 16:36:26 2007
11+
## For more information, see mydns.conf(5).
12+
##
13+
14+
15+
# DATABASE INFORMATION
16+
17+
db-host = {mysql_server_ip} # SQL server hostname
18+
db-user = {mysql_server_ispconfig_user} # SQL server username
19+
db-password = {mysql_server_ispconfig_password} # SQL server password
20+
database = {mysql_server_database} # MyDNS database name
21+
22+
23+
# GENERAL OPTIONS
24+
25+
user = nobody # Run with the permissions of this user
26+
group = nogroup # Run with the permissions of this group
27+
listen = * # Listen on these addresses ('*' for all)
28+
no-listen = # Do not listen on these addresses
29+
30+
31+
# CACHE OPTIONS
32+
33+
zone-cache-size = 2048 # Maximum number of elements stored in the zone cache
34+
zone-cache-expire = 60 # Number of seconds after which cached zones expires
35+
reply-cache-size = 2048 # Maximum number of elements stored in the reply cache
36+
reply-cache-expire = 30 # Number of seconds after which cached replies expire
37+
38+
39+
# ESOTERICA
40+
41+
log = LOG_DAEMON # Facility to use for program output (LOG_*/stdout/stderr)
42+
pidfile = /var/run/mydns.pid # Path to PID file
43+
timeout = 120 # Number of seconds after which queries time out
44+
multicpu = 1 # Number of CPUs installed on your system
45+
recursive = # Location of recursive resolver
46+
allow-axfr = yes # Should AXFR be enabled?
47+
allow-tcp = no # Should TCP be enabled?
48+
allow-update = no # Should DNS UPDATE be enabled?
49+
ignore-minimum = no # Ignore minimum TTL for zone?
50+
soa-table = dns_soa # Name of table containing SOA records
51+
rr-table = dns_rr # Name of table containing RR data
52+
soa-where = server_id = {server_id} # Extra WHERE clause for SOA queries
53+
rr-where = server_id = {server_id} # Extra WHERE clause for RR queries

install/update.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,14 @@
128128
swriteln('Configuring Getmail');
129129
$inst->configure_getmail();
130130

131-
// Configure Getmail
131+
// Configure Pureftpd
132132
swriteln('Configuring Pureftpd');
133133
$inst->configure_pureftpd();
134134

135+
// Configure MyDNS
136+
swriteln('Configuring MyDNS');
137+
$inst->configure_mydns();
138+
135139
// Configure ISPConfig
136140
swriteln('Installing ISPConfig');
137141
$inst->install_ispconfig();
@@ -158,6 +162,7 @@
158162
system("/etc/init.d/courier-pop-ssl restart");
159163
system("/etc/init.d/apache2 restart");
160164
system("/etc/init.d/pure-ftpd-mysql restart");
165+
system("/etc/init.d/mydns restart");
161166

162167
echo "Update finished.\n";
163168

0 commit comments

Comments
 (0)