Commit Graph

41 Commits

Author SHA1 Message Date
Simon Zolin 1b5fb97a02 + querylog,stats: anonymize client ip: /16 2020-06-03 19:08:11 +03:00
Simon Zolin 32d1f385ff + config: new setting "querylog_file_enabled"
Close #876

Squashed commit of the following:

commit f83f60a7340d8a3f6de7ecfebb426e47d19e83d8
Merge: cfb72869 391e6199
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Thu May 28 15:17:21 2020 +0300

    Merge remote-tracking branch 'origin/master' into 876-logs

commit cfb72869f7cf0bf59a478ab8c7920c273e2fa5f9
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Thu May 28 12:50:02 2020 +0300

    tests

commit 35376e4f450cf66507d733c931b7ed27eff1f36c
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed May 27 18:15:12 2020 +0300

    fix

commit 0cfb802d73db52a4b09c459a68a8a18918447b76
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed May 27 16:49:52 2020 +0300

    tests

commit 03ca280b6aed3a4880a9d4f4cd18bf47b1c742f6
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed May 27 15:32:27 2020 +0300

    + config: new setting "querylog_file_enabled" - query log will be written to a file
2020-05-28 15:29:36 +03:00
Andrey Meshkov 61a24ffc71 *(querylog): decode methods to a new file 2020-05-26 16:24:31 +03:00
Andrey Meshkov ceedc2d1ff *(querylog): added offset/limit parameters
Actually, this is a serious refactoring of the query log module. The
rest API part is refactored, it's now more clear how the search is
conducted. Split the logic into more files and added more tests.

Closes: https://github.com/AdguardTeam/AdGuardHome/issues/1559
2020-05-26 15:37:37 +03:00
Simon Zolin 93a597fce4 - querylog: fix get data
Close #1589

Squashed commit of the following:

commit 83d1d15f06a67746feb0e82fb71d5ea02f86ab69
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Apr 17 14:11:00 2020 +0300

    - querylog: fix get data
2020-04-17 14:40:13 +03:00
Andrey Meshkov e96fd6e42d -: fix qlog test on Windows 2020-04-15 14:11:31 +03:00
Simon Zolin 2e845e4f4d + qlog: hide_client_ip setting 2020-03-20 14:50:43 +03:00
Simon Zolin bebd43923b - querylog: querylog_memsize setting was reset to 0
Since v0.100.0 the query logs memory buffer was not active,
 despite the default capacity of 1000 items.

Now we remove querylog_memsize setting and replace it with querylog_size_memory
2020-03-19 15:53:25 +03:00
Simon Zolin a5c2cdaf38 + dnsforward: add dnssec_enabled option 2020-03-18 18:05:02 +03:00
Andrey Meshkov f84331abde Merge: -(dnsforward): fixing an issue with the querylog speed
Squashed commit of the following:

commit 7db062d2ce40369fc6c7eaa89f678c660d531516
Author: Andrey Meshkov <am@adguard.com>
Date:   Thu Feb 27 12:08:58 2020 +0300

    *(dnsforward): added comment about oldest

commit dbec84d8a8c60ca040faa59f8aa818ed5959e92a
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Thu Feb 27 11:16:58 2020 +0300

    fix

commit d6df1ee28b3918e8d1676ff6ab4b516d46fe4202
Author: Andrey Meshkov <am@adguard.com>
Date:   Wed Feb 26 20:42:11 2020 +0300

    -(dnsforward): fixing an issue with the querylog speed
2020-02-27 14:02:05 +03:00
Andrey Meshkov df427b6822 *(dnsforward): fix reading in-memory entries 2020-02-21 16:50:20 +03:00
Andrey Meshkov 9d8a95f836 *(dnsforward): fix in-memory log entries sort orderr 2020-02-21 13:01:41 +03:00
Andrey Meshkov 87c0410914 -(dnsforward): start using lastProbeLineIdx in the Seek 2020-02-21 12:57:12 +03:00
Andrey Meshkov 696a6df6ba *(dnsforward): replaced old search with the new one 2020-02-21 01:07:30 +03:00
Andrey Meshkov 90f2c18353 *(dnsforward): qlogreader implementation 2020-02-20 21:12:51 +03:00
Andrey Meshkov 712023112d *(dnsforward): finished new qlog_file implementation 2020-02-20 19:38:11 +03:00
Andrey Meshkov 67dc7d7d88 *: better tests for qlog 2020-02-20 14:11:33 +03:00
Andrey Meshkov 9d5f201ddf *(dnsforward): added QLogFile struct
This struct is supposed to use an easier algorithm for scanning query
log files. The end goal is allow us scanning multiple query log files.
2020-02-18 13:02:59 +03:00
Simon Zolin 6563886b49 Merge: - install: recover from error on DNS server start
Close #1293

Squashed commit of the following:

commit 0981754c5c2c67f2567ee4af0d9ab24377c53413
Merge: ef81f2c8 a6d75118
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Thu Jan 16 14:19:20 2020 +0300

    Merge remote-tracking branch 'origin/master' into 1293-install

commit ef81f2c886f3bfcff4e4352d7ecea6642be7d8e1
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Dec 30 18:32:11 2019 +0300

    linter

commit 9e205be53d9de25bd2ad63398644e14b09f95238
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Dec 30 17:22:17 2019 +0300

    - install: recover from error on DNS server start

    Close all modules properly
    Don't register HTTP handlers twice
2020-01-16 14:25:40 +03:00
Simon Zolin 29998a8959 - querylog: incorrect client IP when blocked by hosts filter 2020-01-09 18:27:44 +03:00
Simon Zolin e7727e9f63 + dnsforward: match CNAME with filtering rules
+ GET /control/querylog: add "cname_match" field

* querylog: Add() now receives an object with parameters
2019-12-03 17:01:26 +03:00
Simon Zolin 7e45c2fc24 + new setting "dns.querylog_memsize"
* set 1000 entries by default (not 5000)
2019-12-02 15:46:03 +03:00
Simon Zolin a31116635e * querylog: delete code for time counter 2019-11-25 15:20:56 +03:00
Simon Zolin 305df63054 - querylog: remove time counter (fix zero div exception) 2019-11-25 13:40:27 +03:00
Simon Zolin 81e8bbe63c * /control/querylog_config: support optional parameters 2019-11-20 20:12:46 +03:00
Simon Zolin a7742a3665 - querylog: fix linter issue 2019-11-19 17:13:12 +03:00
Simon Zolin 12f4ebc6a5 + querylog: preserve searching compatibility with the previous version 2019-11-19 17:09:54 +03:00
Simon Zolin 68cd7976b7 * querylog: add more tests 2019-11-19 15:09:53 +03:00
Simon Zolin 0cd6781a9a * QueryLog.Add() now receives net.IP, not net.Addr 2019-11-19 15:09:53 +03:00
Simon Zolin 2f5d6593f2 * querylog: major refactor: change on-disk format and API
speed up decoding
speed up search
compatible with previous format (when not searching)
2019-11-19 15:08:51 +03:00
Simon Zolin 0d4e95b36d * querylog: don't return entries without Question data 2019-11-12 18:14:33 +03:00
Simon Zolin 8323c0c4b6 Merge: * querylog: skip decoding errors
Close #753

* commit 'c74ae0d0e7ca03a592663025dc644397c1e31d57':
  * querylog: skip decoding errors
2019-10-24 16:00:07 +03:00
Simon Zolin c047053646 - querylog: writing to a file could stop randomly 2019-10-24 14:28:24 +03:00
Simon Zolin c74ae0d0e7 * querylog: skip decoding errors
We read line from file and pass it to a JSON decoder.
JSON decoder is now a local object.
2019-10-22 19:16:04 +03:00
Simon Zolin e2c26ec554 * API changes
* filtering_info -> filtering/status
* filtering_config -> filtering/config
2019-10-14 15:55:58 +03:00
Simon Zolin 90db91b0fd * querylog: refactor: move HTTP handlers to querylog/ 2019-10-09 19:38:58 +03:00
Simon Zolin c9b4a0742f * querylog, stats: don't print unnecessary log messages 2019-10-07 12:03:56 +03:00
Andrey Meshkov b835baf013 *(global): CI scripts 2019-10-02 15:41:14 +03:00
Simon Zolin 81828c87c1 * querylog: POST /control/querylog 2019-09-26 18:27:31 +03:00
Simon Zolin adb422fedf filtering: refactor; change API; add "filters_update_interval" setting
+ config: "filters_update_interval"
* add /control/filtering_info
* remove /control/filtering/enable
* remove /control/filtering/disable

* add /control/filtering_config
* remove /control/filtering/status

* add /control/filtering/set_url
* remove /control/filtering/enable_url
* remove /control/filtering/disable_url
2019-09-12 18:38:13 +03:00
Simon Zolin 8104c902ee * querylog: move code to a separate package
+ config: "querylog_interval" setting
/control/querylog_config, /control/querylog_info
+ POST /control/querylog_clear
2019-09-12 18:35:13 +03:00