aboutsummaryrefslogtreecommitdiffstats
path: root/packages/powerdns.xml
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-01-10 05:44:45 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-01-10 05:44:45 +0000
commit1d1faced56b820134058664ddaefe6d849ddaac5 (patch)
tree6e8e841b59f78e2efe0843a67ed528ea01c8d661 /packages/powerdns.xml
parentf1116c3ddfcf3d495253d69c954f5f342808033b (diff)
downloadpfsense-packages-1d1faced56b820134058664ddaefe6d849ddaac5.tar.gz
pfsense-packages-1d1faced56b820134058664ddaefe6d849ddaac5.tar.bz2
pfsense-packages-1d1faced56b820134058664ddaefe6d849ddaac5.zip
Add more options
Diffstat (limited to 'packages/powerdns.xml')
-rw-r--r--packages/powerdns.xml208
1 files changed, 181 insertions, 27 deletions
diff --git a/packages/powerdns.xml b/packages/powerdns.xml
index e236e35d..70643f7b 100644
--- a/packages/powerdns.xml
+++ b/packages/powerdns.xml
@@ -3,9 +3,6 @@
<name>nmap</name>
<donotsave>true</donotsave>
<preoutput>yes</preoutput>
- <additional_files_needed>
- <item>http://www.pfsense.com/packages/config/powerdns.schema</item>
- </additional_files_needed>
<!-- Menu is where this packages menu will appear -->
<menu>
<name>PowerDNS</name>
@@ -16,28 +13,185 @@
<!-- Do not save invokes a simple input menu and will not update
the configuration database. -->
<fields>
- </fields>
- <custom_php_deinstall_command>
- system("rm -rf /usr/local/pgsql");
- system("/usr/sbin/pw userdel pgsql");
- system("/usr/bin/killall -9 postgres");
- echo "&lt;p&gt;";
- echo "Reboot required... One moment...";
- echo "&lt;p&gt;";
- system("/sbin/shutdown -r now");
- </custom_php_deinstall_command>
- <custom_php_install_command>
- echo "&lt;pre&gt;";
- echo "Creating DB...";
- system("/usr/bin/su -l pgsql -c initdb");
- echo "Starting DB...";
- system("/usr/local/etc/rc.d/010.pgsql.sh start");
- system("/usr/bin/su -l pgsql -c \"dropdb powerdns\" ");
- system("/usr/bin/su -l pgsql -c \"createdb powerdns\" ");
- echo "Creating DB Schema...";
- system("cat /usr/local/pkg/powerdns.schema | /usr/bin/su -l pgsql -c \"psql powerdns\" ");
- system("cat /usr/local/www/powerdnsadmin-0.3/docs/postgresql.sql | /usr/bin/su -l pgsql -c \"psql powerdns\" ");
- </custom_php_install_command>
- <custom_add_php_command>
- </custom_add_php_command>
+ <field>
+ <fielddescr>pgsql Password</fielddescr>
+ <fieldname>password</fieldname>
+ <description>Enter the pgsql users password.</description>
+ <type>password</type>
+ </field>
+ <field>
+ <fielddescr>pgsql Password AGAIN</fielddescr>
+ <fieldname>passwordagain</fieldname>
+ <type>password</type>
+ </field>
+ <field>
+ <fielddescr>IP Address</fielddescr>
+ <fieldname>ipaddress</fieldname>
+ <type>input</type>
+ <value>0.0.0.0</value>
+ <description>(0.0.0.0 to bind to all)</description>
+ </field>
+ <field>
+ <fielddescr>Cache Time to Live</fielddescr>
+ <fieldname>cachettl</fieldname>
+ <type>input</type>
+ <value>20</value>
+ <description>Recommended value: 20</description>
+ </field>
+ <field>
+ <fielddescr>Master</fielddescr>
+ <fieldname>master</fieldname>
+ <type>select</type>
+ <options>
+ <option><name>Yes</name><value>yes</value></option>
+ <option><name>No</name><value>no</value></option>
+ </options>
+ </field>
+ <field>
+ <fielddescr>Slave</fielddescr>
+ <fieldname>slave</fieldname>
+ <type>select</type>
+ <options>
+ <option><name>No</name><value>no</value></option>
+ <option><name>Yes</name><value>yes</value></option>
+ </options>
+ </field>
+ </fields>
+ <custom_php_deinstall_command>
+ system("/usr/local/bin/pg_ctl -m immediate");
+ system("rm -rf /usr/local/pgsql");
+ system("/usr/sbin/pw userdel pgsql");
+ system("/usr/bin/killall -9 postgres");
+ echo "&lt;p&gt;";
+ echo "Reboot required... One moment...";
+ echo "&lt;p&gt;";
+ system("/sbin/shutdown -r now");
+ </custom_php_deinstall_command>
+ <custom_php_install_command>
+ echo "&lt;pre&gt;";
+ echo "Creating DB...";
+ system("/usr/bin/su -l pgsql -c initdb");
+ system("/usr/local/etc/rc.d/010.pgsql.sh start");
+ system("/usr/bin/su -l pgsql -c \"dropdb powerdns\" ");
+ system("/usr/bin/su -l pgsql -c \"createdb powerdns\" ");
+ $fout = fopen("/usr/local/pkg/powerdns.schema","w");
+ /* DATABASE SCHEMA */
+ fwrite($fout, "create table domains (\n");
+ fwrite($fout, "id SERIAL PRIMARY KEY,\n");
+ fwrite($fout, "name VARCHAR(255) NOT NULL,\n");
+ fwrite($fout, "master VARCHAR(20) DEFAULT NULL,\n");
+ fwrite($fout, "last_check INT DEFAULT NULL,\n");
+ fwrite($fout, "type VARCHAR(6) NOT NULL,\n");
+ fwrite($fout, "notified_serial INT DEFAULT NULL,\n");
+ fwrite($fout, "account VARCHAR(40) DEFAULT NULL\n");
+ fwrite($fout, ");\n");
+ fwrite($fout, "CREATE UNIQUE INDEX name_index ON domains(name);\n");
+ fwrite($fout, "CREATE TABLE records (\n");
+ fwrite($fout, " id SERIAL PRIMARY KEY,\n");
+ fwrite($fout, " domain_id INT DEFAULT NULL,\n");
+ fwrite($fout, " name VARCHAR(255) DEFAULT NULL,\n");
+ fwrite($fout, " type VARCHAR(6) DEFAULT NULL,\n");
+ fwrite($fout, " content VARCHAR(255) DEFAULT NULL,\n");
+ fwrite($fout, " ttl INT DEFAULT NULL,\n");
+ fwrite($fout, " prio INT DEFAULT NULL,\n");
+ fwrite($fout, " change_date INT DEFAULT NULL,\n");
+ fwrite($fout, " CONSTRAINT domain_exists\n");
+ fwrite($fout, " FOREIGN KEY(domain_id) REFERENCES domains(id)\n");
+ fwrite($fout, " ON DELETE CASCADE\n");
+ fwrite($fout, ");\n");
+ fwrite($fout, "CREATE INDEX rec_name_index ON records(name);\n");
+ fwrite($fout, "CREATE INDEX nametype_index ON records(name,type);\n");
+ fwrite($fout, "CREATE INDEX domain_id ON records(domain_id);\n");
+ fwrite($fout, "create table supermasters (\n");
+ fwrite($fout, " ip VARCHAR(25) NOT NULL,\n");
+ fwrite($fout, " nameserver VARCHAR(255) NOT NULL,\n");
+ fwrite($fout, " account VARCHAR(40) DEFAULT NULL\n");
+ fwrite($fout, ");\n");
+ fwrite($fout, "GRANT SELECT ON supermasters TO pgsql;\n");
+ fwrite($fout, "GRANT ALL ON domains TO pgsql;\n");
+ fwrite($fout, "GRANT ALL ON domains_id_seq TO pgsql;\n");
+ fwrite($fout, "GRANT ALL ON records TO pgsql;\n");
+ fwrite($fout, "GRANT ALL ON records_id_seq TO pgsql;\n");
+ fclose($fout);
+ system("cat /usr/local/pkg/powerdns.schema | /usr/bin/su -l pgsql -c \"psql powerdns\" ");
+ echo "Installation completed!";
+ </custom_php_install_command>
+ <custom_add_php_command>
+ if($password == $passwordagain) {
+ $fd = popen("/usr/sbin/pw usermod -n pgsql -H 0", "w");
+ $salt = md5(time());
+ $crypted_pw = crypt($_POST['password'],$salt);
+ fwrite($fd, $crypted_pw);
+ pclose($fd);
+ $fout = fopen("/usr/local/etc/pdns.conf","w");
+ fwrite($fout, "launch=gpgsql\n");
+ fwrite($fout, "gpgsql-host=127.0.0.1\n");
+ fwrite($fout, "gpgsql-dbname=powerdns\n");
+ fwrite($fout, "fwrite($fout, "gpgsql-user=pgsql\n");
+ fwrite($fout, "gpgsql-password=" . $_POST['password'] . "\n");
+ fwrite($fout, "chroot=/var/empty\n");
+ fwrite($fout, "disable-tcp=no\n");
+ fwrite($fout, "guardian=yes\n");
+ fwrite($fout, "webserver=yes\n");
+ fwrite($fout, "webserver-address=127.0.0.1\n");
+ fwrite($fout, "webserver-port=8081\n");
+ fwrite($fout, "local-address=" . $ipaddress . "\n";");
+ fwrite($fout, "master=" . $POST['master'] . "\n");
+ fwrite($fout, "slave=" . $POST['slave'] . "\n");
+ fwrite($fout, "cache-ttl=" . $POST['cachettl'] . "\n");
+ /* XXX: TODO */
+ fwrite($fout, "# allow-axfr-ips=\n");
+ fwrite($fout, "# allow-recursion=\n");
+ fwrite($fout, "# config-dir=/etc\n");
+ fwrite($fout, "# config-name=\n");
+ fwrite($fout, "# control-console=no\n");
+ fwrite($fout, "# default-soa-name=ns.example.com\n");
+ fwrite($fout, "# disable-axfr=no\n");
+ fwrite($fout, "# distributor-threads=3\n");
+ fwrite($fout, "# fancy-records=no\n");
+ fwrite($fout, "# launch=\n");
+ fwrite($fout, "# lazy-recursion=yes\n");
+ fwrite($fout, "# load-modules=\n");
+ fwrite($fout, "# local-ipv6=\n");
+ fwrite($fout, "# local-port=53\n");
+ fwrite($fout, "# log-dns-details=\n");
+ fwrite($fout, "# log-failed-updates=\n");
+ fwrite($fout, "# logfile=pdns.log\n");
+ fwrite($fout, "# logging-facility=\n");
+ fwrite($fout, "# loglevel=4\n");
+ fwrite($fout, "# max-queue-length=5000\n");
+ fwrite($fout, "# max-tcp-connections=10\n");
+ fwrite($fout, "# module-dir=/usr/local/bin/../lib\n");
+ fwrite($fout, "# negquery-cache-ttl=60\n");
+ fwrite($fout, "# only-soa=org\n");
+ fwrite($fout, "# out-of-zone-additional-processing=no\n");
+ fwrite($fout, "# query-cache-ttl=20\n");
+ fwrite($fout, "# query-logging=no\n");
+ fwrite($fout, "# queue-limit=1500\n");
+ fwrite($fout, "# receiver-threads=1\n");
+ fwrite($fout, "# recursive-cache-ttl=10\n");
+ fwrite($fout, "# recursor=no\n");
+ fwrite($fout, "# setgid=\n");
+ fwrite($fout, "# setuid=\n");
+ fwrite($fout, "# skip-cname=no\n");
+ fwrite($fout, "# slave=no\n");
+ fwrite($fout, "# slave-cycle-interval=60\n");
+ fwrite($fout, "# soa-minimum-ttl=3600\n");
+ fwrite($fout, "# soa-serial-offset=0\n");
+ fwrite($fout, "# socket-dir=/var/run\n");
+ fwrite($fout, "# strict-rfc-axfrs=no\n");
+ fwrite($fout, "# urlredirector=127.0.0.1\n");
+ fwrite($fout, "# use-logfile=no\n");
+ fwrite($fout, "# webserver-password=\n");
+ fwrite($fout, "# webserver-print-arguments=no\n");
+ fwrite($fout, "# wildcard-url=no\n");
+ fwrite($fout, "# wildcards=\n");
+ fclose($fout);
+ system("/usr/local/bin/pg_ctl -m smart");
+ system("/usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start");
+ } else {
+ echo "Passwords do not much!
+ exit;
+ }
+ </custom_add_php_command>
</packagegui> \ No newline at end of file