dns/dnscrypt-proxy: add logging to UI (#1131)

This commit is contained in:
Michael 2019-02-04 18:36:43 +01:00 committed by Franco Fichtner
parent 3704c3b174
commit 0335ae7578
4 changed files with 43 additions and 2 deletions

View file

@ -1,5 +1,5 @@
PLUGIN_NAME= dnscrypt-proxy
PLUGIN_VERSION= 1.1
PLUGIN_VERSION= 1.2
PLUGIN_COMMENT= Flexible DNS proxy supporting DNSCrypt and DoH
PLUGIN_DEPENDS= dnscrypt-proxy2
PLUGIN_MAINTAINER= m.muenz@gmail.com

View file

@ -1,4 +1,21 @@
A flexible DNS proxy, with support for modern encrypted DNS protocols
such as DNSCrypt v2 and DNS-over-HTTPS.
Plugin Changelog
================
1.2
* Add logging to menu
1.1
* Allow manual server addition and selection
1.0
* Initial release
WWW: https://github.com/jedisct1/dnscrypt-proxy

View file

@ -1,5 +1,10 @@
<menu>
<Services>
<DNSCrypt-Proxy cssClass="fa fa-lock fa-fw" url="/ui/dnscryptproxy/general/index" />
<DNSCrypt-Proxy cssClass="fa fa-lock fa-fw">
<Configuration url="/ui/dnscryptproxy/general/index" order="10"/>
<Log VisibleName="Log File" url="/diag_logs_dnscrypt.php?type=dnscrypt-proxy" order="20">
<More url="/diag_logs_dnscrypt.php*" visibility="hidden"/>
</Log>
</DNSCrypt-Proxy>
</Services>
</menu>

View file

@ -0,0 +1,19 @@
<?php
$type = 'dnscrypt-proxy';
if (isset($_GET['type']) && ($_GET['type'] === 'dnscrypt-proxy' || $_GET['type'] === 'query' || $_GET['type'] === 'nx')) {
$type = $_GET['type'];
}
$logfile = "/var/log/dnscrypt-proxy/{$type}.log";
$logclog = false;
$logsplit = 2;
$logpills = array();
$logpills[] = array(gettext('General'), true, '/diag_logs_dnscrypt.php?type=dnscrypt-proxy');
$logpills[] = array(gettext('Queries'), false, '/diag_logs_dnscrypt.php?type=query');
$logpills[] = array(gettext('NX'), false, '/diag_logs_dnscrypt.php?type=nx');
$service_hook = 'dnscrypt-proxy';
require_once 'diag_logs_template.inc';