Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
06d2cbca
Commit
06d2cbca
authored
Feb 26, 2016
by
Ad Schellevis
Committed by
Franco Fichtner
Mar 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) simplify things a bit in services_unbound_advanced.php
(cherry picked from commit
25c074ce
)
parent
79aa798a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
services_unbound_advanced.php
src/www/services_unbound_advanced.php
+9
-16
No files found.
src/www/services_unbound_advanced.php
View file @
06d2cbca
...
@@ -39,7 +39,7 @@ if(empty($config['unbound']) || !is_array($config['unbound'])) {
...
@@ -39,7 +39,7 @@ if(empty($config['unbound']) || !is_array($config['unbound'])) {
$copy_fields
=
array
(
'msgcachesize'
,
'outgoing_num_tcp'
,
'incoming_num_tcp'
,
'edns_buffer_size'
,
$copy_fields
=
array
(
'msgcachesize'
,
'outgoing_num_tcp'
,
'incoming_num_tcp'
,
'edns_buffer_size'
,
'num_queries_per_thread'
,
'jostle_timeout'
,
'cache_max_ttl'
,
'cache_min_ttl'
,
'num_queries_per_thread'
,
'jostle_timeout'
,
'cache_max_ttl'
,
'cache_min_ttl'
,
'infra_host_ttl'
,
'infra_cache_numhosts'
,
'unwanted_reply_threshold'
);
'infra_host_ttl'
,
'infra_cache_numhosts'
,
'unwanted_reply_threshold'
,
'log_verbosity'
);
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
$pconfig
=
array
();
$pconfig
=
array
();
...
@@ -51,6 +51,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
...
@@ -51,6 +51,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig
[
'infra_cache_numhosts'
]
=
10000
;
$pconfig
[
'infra_cache_numhosts'
]
=
10000
;
$pconfig
[
'edns_buffer_size'
]
=
4096
;
$pconfig
[
'edns_buffer_size'
]
=
4096
;
$pconfig
[
'num_queries_per_thread'
]
=
4096
;
$pconfig
[
'num_queries_per_thread'
]
=
4096
;
$pconfig
[
'log_verbosity'
]
=
"1"
;
// boolean fields
// boolean fields
$pconfig
[
'hideidentity'
]
=
isset
(
$config
[
'unbound'
][
'hideidentity'
]);
$pconfig
[
'hideidentity'
]
=
isset
(
$config
[
'unbound'
][
'hideidentity'
]);
...
@@ -59,9 +60,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
...
@@ -59,9 +60,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig
[
'prefetchkey'
]
=
isset
(
$config
[
'unbound'
][
'prefetchkey'
]);
$pconfig
[
'prefetchkey'
]
=
isset
(
$config
[
'unbound'
][
'prefetchkey'
]);
$pconfig
[
'dnssecstripped'
]
=
isset
(
$config
[
'unbound'
][
'dnssecstripped'
]);
$pconfig
[
'dnssecstripped'
]
=
isset
(
$config
[
'unbound'
][
'dnssecstripped'
]);
// predefined
$pconfig
[
'log_verbosity'
]
=
isset
(
$config
[
'unbound'
][
'log_verbosity'
])
?
$config
[
'unbound'
][
'log_verbosity'
]
:
"1"
;
// text fields
// text fields
foreach
(
$copy_fields
as
$fieldname
)
{
foreach
(
$copy_fields
as
$fieldname
)
{
if
(
isset
(
$config
[
'unbound'
][
$fieldname
]))
{
if
(
isset
(
$config
[
'unbound'
][
$fieldname
]))
{
...
@@ -78,25 +76,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
...
@@ -78,25 +76,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
exit
;
exit
;
}
else
{
}
else
{
$pconfig
=
$_POST
;
$pconfig
=
$_POST
;
// 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'
][
'msgcachesize'
]
=
$pconfig
[
'msgcachesize'
];
// text fields
$config
[
'unbound'
][
'outgoing_num_tcp'
]
=
$pconfig
[
'outgoing_num_tcp'
];
foreach
(
$copy_fields
as
$fieldname
)
{
$config
[
'unbound'
][
'incoming_num_tcp'
]
=
$pconfig
[
'incoming_num_tcp'
];
$config
[
'unbound'
][
$fieldname
]
=
$pconfig
[
$fieldname
];
$config
[
'unbound'
][
'edns_buffer_size'
]
=
$pconfig
[
'edns_buffer_size'
];
}
$config
[
'unbound'
][
'num_queries_per_thread'
]
=
$pconfig
[
'num_queries_per_thread'
];
$config
[
'unbound'
][
'jostle_timeout'
]
=
$pconfig
[
'jostle_timeout'
];
$config
[
'unbound'
][
'cache_max_ttl'
]
=
$pconfig
[
'cache_max_ttl'
];
$config
[
'unbound'
][
'cache_min_ttl'
]
=
$pconfig
[
'cache_min_ttl'
];
$config
[
'unbound'
][
'infra_host_ttl'
]
=
$pconfig
[
'infra_host_ttl'
];
$config
[
'unbound'
][
'infra_cache_numhosts'
]
=
$pconfig
[
'infra_cache_numhosts'
];
$config
[
'unbound'
][
'unwanted_reply_threshold'
]
=
$pconfig
[
'unwanted_reply_threshold'
];
$config
[
'unbound'
][
'log_verbosity'
]
=
$pconfig
[
'log_verbosity'
];
write_config
(
"DNS Resolver configured."
);
write_config
(
"DNS Resolver configured."
);
mark_subsystem_dirty
(
'unbound'
);
mark_subsystem_dirty
(
'unbound'
);
header
(
"Location: services_unbound_advanced.php"
);
exit
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment