Commit 80af89a0 authored by Franco Fichtner's avatar Franco Fichtner

unbound: add serve-expired option #1405

(cherry picked from commit cdaa7aff)
(cherry picked from commit 069019c8)
parent e6e78723
...@@ -280,7 +280,8 @@ EOF; ...@@ -280,7 +280,8 @@ EOF;
$verbosity = isset($config['unbound']['log_verbosity']) ? $config['unbound']['log_verbosity'] : 1; $verbosity = isset($config['unbound']['log_verbosity']) ? $config['unbound']['log_verbosity'] : 1;
$msgcachesize = !empty($config['unbound']['msgcachesize']) ? $config['unbound']['msgcachesize'] : 4; $msgcachesize = !empty($config['unbound']['msgcachesize']) ? $config['unbound']['msgcachesize'] : 4;
$rrsetcachesize = $msgcachesize * 2; $rrsetcachesize = $msgcachesize * 2;
$dnssecstripped = !empty($config['unbound']['dnssecstripped']) ? "yes" : "no"; $dnssecstripped = !empty($config['unbound']['dnssecstripped']) ? 'yes' : 'no';
$serveexpired = !empty($config['unbound']['serveexpired']) ? 'yes' : 'no';
if (isset($config['unbound']['regdhcp'])) { if (isset($config['unbound']['regdhcp'])) {
// include dynamic leases // include dynamic leases
...@@ -352,6 +353,7 @@ module-config: "{$module_config}" ...@@ -352,6 +353,7 @@ module-config: "{$module_config}"
cache-max-ttl: {$cache_max_ttl} cache-max-ttl: {$cache_max_ttl}
cache-min-ttl: {$cache_min_ttl} cache-min-ttl: {$cache_min_ttl}
harden-dnssec-stripped: {$dnssecstripped} harden-dnssec-stripped: {$dnssecstripped}
serve-expired: {$serveexpired}
outgoing-num-tcp: {$outgoing_num_tcp} outgoing-num-tcp: {$outgoing_num_tcp}
incoming-num-tcp: {$incoming_num_tcp} incoming-num-tcp: {$incoming_num_tcp}
num-queries-per-thread: {$num_queries_per_thread} num-queries-per-thread: {$num_queries_per_thread}
......
...@@ -66,6 +66,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -66,6 +66,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['prefetch'] = isset($config['unbound']['prefetch']); $pconfig['prefetch'] = isset($config['unbound']['prefetch']);
$pconfig['prefetchkey'] = isset($config['unbound']['prefetchkey']); $pconfig['prefetchkey'] = isset($config['unbound']['prefetchkey']);
$pconfig['dnssecstripped'] = isset($config['unbound']['dnssecstripped']); $pconfig['dnssecstripped'] = isset($config['unbound']['dnssecstripped']);
$pconfig['serveexpired'] = isset($config['unbound']['serveexpired']);
// text fields // text fields
foreach ($copy_fields as $fieldname) { foreach ($copy_fields as $fieldname) {
...@@ -85,11 +86,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -85,11 +86,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} else { } else {
$pconfig = $_POST; $pconfig = $_POST;
// boolean fields // boolean fields
$config['unbound']['hideidentity'] = !empty($pconfig['hideidentity']); $config['unbound']['hideidentity'] = !empty($pconfig['hideidentity']);
$config['unbound']['hideversion'] = !empty($pconfig['hideversion']); $config['unbound']['hideversion'] = !empty($pconfig['hideversion']);
$config['unbound']['prefetch'] = !empty($pconfig['prefetch']); $config['unbound']['prefetch'] = !empty($pconfig['prefetch']);
$config['unbound']['prefetchkey'] = !empty($pconfig['prefetchkey']); $config['unbound']['prefetchkey'] = !empty($pconfig['prefetchkey']);
$config['unbound']['dnssecstripped'] = !empty($pconfig['dnssecstripped']); $config['unbound']['dnssecstripped'] = !empty($pconfig['dnssecstripped']);
$config['unbound']['serveexpired'] = !empty($pconfig['serveexpired']);
// text fields // text fields
foreach ($copy_fields as $fieldname) { foreach ($copy_fields as $fieldname) {
$config['unbound'][$fieldname] = $pconfig[$fieldname]; $config['unbound'][$fieldname] = $pconfig[$fieldname];
...@@ -175,6 +177,15 @@ include_once("head.inc"); ...@@ -175,6 +177,15 @@ include_once("head.inc");
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<td><a id="help_for_serveexpired" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?= gettext('Serve expired responses') ?></td>
<td>
<input name="serveexpired" type="checkbox" id="serveexpired" value="yes" <?= empty($pconfig['serveexpired']) ? '' : 'checked="checked"' ?> />
<div class="hidden" for="help_for_serveexpired">
<?= gettext('Serve expired responses from the cache with a TTL of 0 without waiting for the actual resolution to finish.') ?>
</div>
</td>
</tr>
<tr> <tr>
<td><a id="help_for_msgcachesize" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?= gettext("Message Cache Size") ?></td> <td><a id="help_for_msgcachesize" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?= gettext("Message Cache Size") ?></td>
<td> <td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment