mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
Services - Unbound DNS - General - System Domain Local Zone Type Option
Expose system domain unbound local-zone type to be configurable.
This commit is contained in:
parent
d3f51dedb0
commit
0df6c357f7
@ -509,7 +509,14 @@ function unbound_add_host_entries()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$unbound_entries = "local-zone: \"{$config['system']['domain']}\" transparent\n";
|
||||
// Make sure the config setting is a valid unbound local zone type. If not use "transparent".
|
||||
if (array_key_exists($config['unbound']['system_domain_local_zone_type'], unbound_local_zone_types())) {
|
||||
$system_domain_local_zone_type = $config['unbound']['system_domain_local_zone_type'];
|
||||
} else {
|
||||
$system_domain_local_zone_type = "transparent";
|
||||
}
|
||||
|
||||
$unbound_entries = "local-zone: \"{$config['system']['domain']}\" $system_domain_local_zone_type\n";
|
||||
|
||||
// IPv4 entries
|
||||
$unbound_entries .= "local-data-ptr: \"127.0.0.1 localhost\"\n";
|
||||
@ -747,3 +754,18 @@ function unbound_hosts_generate()
|
||||
|
||||
killbypid('/var/run/unbound.pid', 'HUP');
|
||||
}
|
||||
|
||||
// Array of valid unbound local zone types
|
||||
function unbound_local_zone_types() {
|
||||
return array(
|
||||
"deny" => gettext("Deny"),
|
||||
"refuse" => gettext("Refuse"),
|
||||
"static" => gettext("Static"),
|
||||
"transparent" => gettext("Transparent"),
|
||||
"typetransparent" => gettext("Type Transparent"),
|
||||
"redirect" => gettext("Redirect"),
|
||||
"inform" => gettext("Inform"),
|
||||
"inform_deny" => gettext("Inform Deny"),
|
||||
"nodefault" => gettext("No Default")
|
||||
);
|
||||
}
|
||||
|
||||
@ -51,6 +51,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
// array types
|
||||
$pconfig['active_interface'] = !empty($a_unboundcfg['active_interface']) ? explode(",", $a_unboundcfg['active_interface']) : array();
|
||||
$pconfig['outgoing_interface'] = !empty($a_unboundcfg['outgoing_interface']) ? explode(",", $a_unboundcfg['outgoing_interface']) : array();
|
||||
$pconfig['system_domain_local_zone_type'] = !empty($a_unboundcfg['system_domain_local_zone_type']) ? $a_unboundcfg['system_domain_local_zone_type'] : 'transparent';
|
||||
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$input_errors = array();
|
||||
$pconfig = $_POST;
|
||||
@ -108,6 +109,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
// array types
|
||||
$a_unboundcfg['active_interface'] = !empty( $pconfig['active_interface']) ? implode(",", $pconfig['active_interface']) : array();
|
||||
$a_unboundcfg['outgoing_interface'] = !empty( $pconfig['outgoing_interface']) ? implode(",", $pconfig['outgoing_interface']) : array();
|
||||
$a_unboundcfg['system_domain_local_zone_type'] = $pconfig['system_domain_local_zone_type'];
|
||||
|
||||
write_config("DNS Resolver configured.");
|
||||
mark_subsystem_dirty('unbound');
|
||||
@ -191,6 +193,21 @@ include_once("head.inc");
|
||||
</output>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a id="help_for_system_domain_local_zone_type" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("System Domain Local Zone Type"); ?></td>
|
||||
<td>
|
||||
<select name="system_domain_local_zone_type" size="3" class="selectpicker" >
|
||||
<?php
|
||||
foreach (unbound_local_zone_types() as $value => $name):?>
|
||||
<option value="<?=$value;?>" <?=$value == $pconfig['system_domain_local_zone_type'] ? 'selected="selected"' : "";?>><?=htmlspecialchars($name);?></option>
|
||||
<?php
|
||||
endforeach; ?>
|
||||
</select>
|
||||
<output class="hidden" for="help_for_system_domain_local_zone_type">
|
||||
<?=sprintf(gettext("The local-zone type used for the system domain (System | Settings | General | Domain). Transparent is the default. Local-Zone type descriptions are available in the unbound %s manual pages."), '<a target="_blank" href="https://www.unbound.net/documentation/unbound.conf.html">'.gettext("conf(5)").'</a>');?>
|
||||
</output>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("DNSSEC");?></td>
|
||||
<td>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user