diff --git a/Makefile b/Makefile index 959a75b8..1c335fd2 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,8 @@ NATIVE_GOARCH = $(shell unset GOARCH; go env GOARCH) mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) mkfile_dir := $(patsubst %/,%,$(dir $(mkfile_path))) GOPATH := $(mkfile_dir)/build/gopath -STATIC := build/static/index.html +JSFILES = $(shell find client -path client/node_modules -prune -o -type f -name '*.js') +STATIC = build/static/index.html .PHONY: all build clean all: build @@ -15,7 +16,7 @@ client/node_modules: client/package.json client/package-lock.json npm --prefix client install touch client/node_modules -$(STATIC): client/node_modules +$(STATIC): $(JSFILES) client/node_modules npm --prefix client run build-prod AdguardDNS: $(STATIC) *.go diff --git a/client/src/actions/index.js b/client/src/actions/index.js index 015aecd1..cb6cd1ed 100644 --- a/client/src/actions/index.js +++ b/client/src/actions/index.js @@ -297,7 +297,7 @@ export const setRules = rules => async (dispatch) => { .replace(/^\n/g, '') .replace(/\n\s*\n/g, '\n'); await apiClient.setRules(replacedLineEndings); - dispatch(addSuccessToast('Custom rules saved')); + dispatch(addSuccessToast('Updated the custom filtering rules')); dispatch(setRulesSuccess()); } catch (error) { dispatch(addErrorToast({ error })); @@ -456,7 +456,7 @@ export const setUpstream = url => async (dispatch) => { dispatch(setUpstreamRequest()); try { await apiClient.setUpstream(url); - dispatch(addSuccessToast('Upstream DNS servers saved')); + dispatch(addSuccessToast('Updated the upstream DNS servers')); dispatch(setUpstreamSuccess()); } catch (error) { dispatch(addErrorToast({ error })); diff --git a/client/src/components/Dashboard/BlockedDomains.js b/client/src/components/Dashboard/BlockedDomains.js index 4ede73c2..382a23b8 100644 --- a/client/src/components/Dashboard/BlockedDomains.js +++ b/client/src/components/Dashboard/BlockedDomains.js @@ -6,7 +6,7 @@ import map from 'lodash/map'; import Card from '../ui/Card'; const Clients = props => ( - + ( { ip: prop, domain: value } diff --git a/client/src/components/Dashboard/Clients.js b/client/src/components/Dashboard/Clients.js index 220a0f67..a3f4ae14 100644 --- a/client/src/components/Dashboard/Clients.js +++ b/client/src/components/Dashboard/Clients.js @@ -6,7 +6,7 @@ import map from 'lodash/map'; import Card from '../ui/Card'; const Clients = props => ( - + ( { ip: prop, count: value } @@ -15,7 +15,7 @@ const Clients = props => ( Header: 'IP', accessor: 'ip', }, { - Header: 'Request count', + Header: 'Requests count', accessor: 'count', }]} showPagination={false} diff --git a/client/src/components/Dashboard/Counters.js b/client/src/components/Dashboard/Counters.js index 6292e11f..1b7ec92f 100644 --- a/client/src/components/Dashboard/Counters.js +++ b/client/src/components/Dashboard/Counters.js @@ -7,13 +7,13 @@ import Tooltip from '../ui/Tooltip'; const tooltipType = 'tooltip-custom--narrow'; const Counters = props => ( - +
DNS Queries - + @@ -23,8 +23,8 @@ const Counters = props => (
- Blocked by filters - + Blocked by Filters + @@ -35,7 +35,7 @@ const Counters = props => (
Blocked malware/phishing - + diff --git a/client/src/components/Dashboard/QueriedDomains.js b/client/src/components/Dashboard/QueriedDomains.js index f927e11a..fd756e0e 100644 --- a/client/src/components/Dashboard/QueriedDomains.js +++ b/client/src/components/Dashboard/QueriedDomains.js @@ -6,7 +6,7 @@ import map from 'lodash/map'; import Card from '../ui/Card'; const QueriedDomains = props => ( - + ( { ip: prop, count: value } @@ -15,7 +15,7 @@ const QueriedDomains = props => ( Header: 'IP', accessor: 'ip', }, { - Header: 'Request count', + Header: 'Requests count', accessor: 'count', }]} showPagination={false} diff --git a/client/src/components/Dashboard/Statistics.js b/client/src/components/Dashboard/Statistics.js index de98e19c..e36c5c5a 100644 --- a/client/src/components/Dashboard/Statistics.js +++ b/client/src/components/Dashboard/Statistics.js @@ -5,7 +5,7 @@ import PropTypes from 'prop-types'; import Card from '../ui/Card'; const Statistics = props => ( - + {props.history ? (
{value}
), }, { - Header: 'Host file URL', + Header: 'Filter URL', accessor: 'url', Cell: ({ value }) => (), }, { @@ -51,7 +51,7 @@ class Filters extends Component { accessor: 'rulesCount', className: 'text-center', }, { - Header: 'Last time update', + Header: 'Last time updated', accessor: 'lastUpdated', className: 'text-center', }, { @@ -73,7 +73,7 @@ class Filters extends Component {
); diff --git a/client/src/components/Logs/index.js b/client/src/components/Logs/index.js index ad9a405d..343c1f1a 100644 --- a/client/src/components/Logs/index.js +++ b/client/src/components/Logs/index.js @@ -51,10 +51,10 @@ class Logs extends Component { if (userRules.match(preparedBlockingRule)) { this.props.setRules(userRules.replace(`${blockingRule}`, '')); - this.props.addSuccessToast(`Removing rule from custom list: ${blockingRule}`); + this.props.addSuccessToast(`Rule removed from the custom filtering rules: ${blockingRule}`); } else if (!userRules.match(preparedUnblockingRule)) { this.props.setRules(`${userRules}${lineEnding}${unblockingRule}\n`); - this.props.addSuccessToast(`Adding rule to custom list: ${unblockingRule}`); + this.props.addSuccessToast(`Rule added to the custom filtering rules: ${unblockingRule}`); } this.props.getFilteringStatus(); diff --git a/client/src/components/Settings/Upstream.js b/client/src/components/Settings/Upstream.js index 2b13d0b9..80d32311 100644 --- a/client/src/components/Settings/Upstream.js +++ b/client/src/components/Settings/Upstream.js @@ -27,7 +27,7 @@ export default class Upstream extends Component { return (
diff --git a/client/src/components/Settings/index.js b/client/src/components/Settings/index.js index c68f5668..799a7834 100644 --- a/client/src/components/Settings/index.js +++ b/client/src/components/Settings/index.js @@ -17,7 +17,7 @@ export default class Settings extends Component { safebrowsing: { enabled: false, title: 'Use AdGuard browsing security web service', - subtitle: 'AdGuard DNS will check if domain is blacklisted by the browsing security web service (sb.adtidy.org). It will use privacy-safe lookup API to do the check.', + subtitle: 'AdGuard DNS will check if domain is blacklisted by the browsing security web service. It will use privacy-friendly lookup API to perform the check: only a short prefix of the domain name SHA256 hash is sent to the server.', }, parental: { enabled: false, @@ -27,7 +27,7 @@ export default class Settings extends Component { safesearch: { enabled: false, title: 'Enforce safe search', - subtitle: 'AdGuard DNS can enforce safe search in the major search engines: Google, Bing, Yandex.', + subtitle: 'AdGuard DNS can enforce safe search in the following search engines: Google, Bing, Yandex.', }, }; diff --git a/client/src/helpers/helpers.js b/client/src/helpers/helpers.js index d6269d8a..9aea6a11 100644 --- a/client/src/helpers/helpers.js +++ b/client/src/helpers/helpers.js @@ -34,8 +34,20 @@ export const normalizeLogs = logs => logs.map((log) => { }; }); +const STATS_NAMES = { + avg_processing_time: 'Average processing time', + blocked_filtering: 'Blocked by filters', + dns_queries: 'DNS queries', + replaced_parental: 'Blocked adult websites', + replaced_safebrowsing: 'Blocked malware/phishing', + replaced_safesearch: 'Enforced safe search', +}; + export const normalizeHistory = history => Object.keys(history).map((key) => { - const id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase()); + let id = STATS_NAMES[key]; + if (!id) { + id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase()); + } const dayAgo = subHours(Date.now(), 24); diff --git a/coredns_plugin/querylog_top.go b/coredns_plugin/querylog_top.go index 6ff531f2..d6bb7a6b 100644 --- a/coredns_plugin/querylog_top.go +++ b/coredns_plugin/querylog_top.go @@ -19,12 +19,6 @@ import ( "github.com/miekg/dns" ) -// top domains/clients/blocked stats in the last 24 hours - -// on start we read the saved stats from the last 24 hours and add them to the stats - -// stats are counted using hourly LRU, rotating hourly and keeping last 24 hours - type hourTop struct { domains gcache.Cache blocked gcache.Cache