nsedit/includes/config.inc.php-dist
Stefan Bühler 54fb62b471 Rewrite/Refactoring
- add a lot of permission checks:
  zone edits were completely unchecked (after login); only list and creation were
  protected.
- reduce regular expression usage
- don't use user provided names/ids/urls for requests; instead use them
  to search for the zone in the list of all zones.
- rename 'label' to 'name' in template records ('name' is used in all
  other places)
- make 'localhost' default $apisid
- add 'soa_edit' default
- remove gen_pw/pwgen caller; use openssl instead for random password
- fix a lot of bugs (editrecord, TXT quoting, name checking, ...)
- improve record sorting
2014-10-05 13:08:23 +02:00

61 lines
2.2 KiB
Text

<?php
$apiuser = ''; # The PowerDNS API username
$apipass = ''; # The PowerDNS API-user password
$apiip = ''; # The IP of the PowerDNS API
$apiport = '8081'; # The port of the PowerDNS API
$apisid = 'localhost'; # PowerDNS's :server_id
$allowzoneadd = FALSE; # Allow normal users to add zones
# If you configure this, nsedit will try to authenticate via WeFact too.
# Debtors will be added to the sqlitedatabase with their crypted password.
#$wefactapiurl = 'https://yourdomain/Pro/apiv2/api.php';
#$wefactapikey = 'xyz';
# If you want external scripts to be able to execute stuff here, add the
# remote-ip to $adminapiips and create a $adminapikey
#$adminapiips = array();
#$adminapikey = 'thisshouldbequitealongstring,youknow';
$authdb = "../etc/pdns.users.sqlite3";
$templates = array();
/*
$templates[] = array(
'name' => 'Tuxis',
'owner' => 'username', # Set to 'public' to make it available to all users
'records' => array(
array(
'name' => '',
'type' => 'MX',
'content' => 'mx2.tuxis.nl',
'priority' => '200')
)
);
*/
$defaults['soa_edit'] = 'INCEPTION-INCREMENT';
$defaults['soa_edit_api'] = 'INCEPTION-INCREMENT';
$defaults['defaulttype'] = 'Master'; # Choose between 'Native' or 'Master'
$defaults['primaryns'] = 'unconfigured.primaryns'; # The value of the first NS-record
$defaults['secondaryns'] = 'unconfigured.secondaryns'; # The value of the second NS-record
$defaults['ttl'] = 3600; # Default TTL for records
$defaults['priority'] = 0; # Default for priority in records
/* No need to change stuf below */
$defaults['defaulttype'] = ucfirst(strtolower($defaults['defaulttype']));
if (!file_exists($authdb)) {
is_dir(dirname($authdb)) || mkdir(dirname($authdb));
$db = new SQLite3($authdb, SQLITE3_OPEN_CREATE|SQLITE3_OPEN_READWRITE);
$createsql = file_get_contents('includes/scheme.sql');
$db->exec($createsql);
$salt = bin2hex(openssl_random_pseudo_bytes(16));
$db->exec("INSERT INTO users (emailaddress, password, isadmin) VALUES ('admin', '".crypt("admin", '$6$'.$salt)."', 1)");
}
?>