Commit Graph

224 Commits

Author SHA1 Message Date
Simon Zolin
abd251c5c1 * whois,rdns: use 1 hour cache TTL 2019-11-07 14:02:34 +03:00
Simon Zolin
ab24ab2f1a - auth: fix crash on showing Dashboard in UI if authentication is disabled 2019-10-25 11:01:29 +03:00
Simon Zolin
03c4793010 Merge: * don't show "sign out" button if authorization is disabled
Close #1093

* commit '49e535336be47cccee07f2e1b05f0d514aa91aa7':
  * changelog
  + client: get profile info
  * minor
  + GET /control/profile
2019-10-23 19:23:37 +03:00
Simon Zolin
9d29fdea4b Merge: * filters: don't fail on filter update when filter file doesn't exist
Close #1112

* commit '0737354f534385c3c2036e15d65554bcb7090fb4':
  * filters: don't fail on filter update when filter file doesn't exist
2019-10-23 19:19:50 +03:00
Simon Zolin
c185f6826a + GET /control/profile
* openapi: get /profile

* auth: store user names along with sessions
2019-10-23 18:43:35 +03:00
Simon Zolin
e8bb0fdcb7 Merge: - /control/version.json: don't show error message if auto-update is disabled
Close #1083

* commit '5bcd1545a8044aff7f35179e7a324ec9b4ad1c2e':
  - /control/version.json: don't show error message if auto-update is disabled
2019-10-23 14:21:02 +03:00
Simon Zolin
0737354f53 * filters: don't fail on filter update when filter file doesn't exist 2019-10-23 14:19:43 +03:00
Simon Zolin
67f31ccf43 * minor 2019-10-22 16:15:51 +03:00
Simon Zolin
a52c4b4362 Merge: * rdns,whois: get client info for all question types (not just A/AAAA)
Close #1103

* commit '235b198ef97d7a46ab6d76a4074ec589fc0148eb':
  * rdns,whois: recheck IP addresses after some time
  * rdns,whois: get client info for all question types (not just A/AAAA)
2019-10-22 14:37:22 +03:00
Simon Zolin
235b198ef9 * rdns,whois: recheck IP addresses after some time 2019-10-22 13:11:22 +03:00
Simon Zolin
ddfd53bf06 * rdns,whois: get client info for all question types (not just A/AAAA) 2019-10-22 13:10:40 +03:00
Simon Zolin
76c9e61199 * TLS: don't print certificate data 2019-10-22 12:09:32 +03:00
Simon Zolin
5bcd1545a8 - /control/version.json: don't show error message if auto-update is disabled 2019-10-21 18:21:05 +03:00
Simon Zolin
e2ff8628ad - filters: auto-update didn't work 2019-10-17 14:33:38 +03:00
Simon Zolin
5cc8513322 * use debug log level for unimportant messages 2019-10-16 12:03:51 +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
bfc6c98109 Merge: + auth: add more tests
#1060

* commit '91bb9ccae69afadc06206d413d57c1c3b136e7a7':
  + auth: add more tests
2019-10-11 17:03:50 +03:00
Simon Zolin
91bb9ccae6 + auth: add more tests
* use directory "./agh-test"
2019-10-11 16:59:14 +03:00
Simon Zolin
c299753b67 - whois: couldn't set info on existing auto-clients 2019-10-11 16:58:10 +03:00
Simon Zolin
c9d7bc3069 * "refresh filters" HTTP handler: return the old synchronous behaviour
This was broken by "* dnsfilter: major refactoring"
2019-10-10 17:12:32 +03:00
Simon Zolin
6a08a9faa6 - whois/rdns: start processing top clients on startup after DNS server is started 2019-10-10 14:00:02 +03:00
Simon Zolin
8676cabc42 * whois/rdns: process up to 100 top clients on startup 2019-10-10 13:55:44 +03:00
Simon Zolin
a59e346d4a * dnsfilter: major refactoring
* dnsfilter is controlled by package home, not dnsforward
* move HTTP handlers to dnsfilter/
* apply filtering settings without DNS server restart
* use only 1 goroutine for filters update
* apply new filters quickly (after they are ready to be used)
2019-10-09 20:05:21 +03:00
Simon Zolin
90db91b0fd * querylog: refactor: move HTTP handlers to querylog/ 2019-10-09 19:38:58 +03:00
Simon Zolin
f4451dca7b Merge: * whois: improvements
Close #1035, Close #1036, Close #1047

* commit 'bd29b22f17d5b326d9fd603aa4f74593a0f1fca7':
  * CI: disable check if Git repo contains uncommited changes
  - whois: use the first "descr" field, not the last
  * filter: speed up parsing
  * whois: use whois.arin.net
  + whois, rdns: begin getting info for the most active clients on startup
  + stats: GetTopData()
  * stats: refactor
2019-10-09 19:26:42 +03:00
Simon Zolin
e9186e6202 - whois: use the first "descr" field, not the last 2019-10-09 18:03:22 +03:00
Simon Zolin
3b9b37dde7 * filter: speed up parsing 2019-10-09 18:03:22 +03:00
Simon Zolin
37fe3c148f * whois: use whois.arin.net
+ robust redirect mechanism
* decrease timeout 30sec -> 5sec
* faster response parsing
* don't use likexian/whois-go package
2019-10-09 18:03:22 +03:00
Simon Zolin
d75620fdc0 + whois, rdns: begin getting info for the most active clients on startup 2019-10-09 18:03:22 +03:00
Simon Zolin
127cca0c83 * systemd service file: fix boot priority: start AGH after network is online 2019-10-08 12:29:11 +03:00
Devin Buhl
55538f72ea block epic games 2019-10-04 17:57:51 +03:00
Ildar Kamalov
eb6dc76920 + i18n: add new languages 2019-10-03 20:52:14 +03:00
Andrey Meshkov
8a05e61feb *: fix auth tests - don't leave repo dirty 2019-10-02 17:02:16 +03:00
Andrey Meshkov
ed0c5ee525 *: tests mustn't leave repo dirty 2019-10-02 16:59:34 +03:00
Andrey Meshkov
33ae359cc1 *: change initDNSServer method, add getDataDir 2019-10-02 16:53:23 +03:00
Andrey Meshkov
9b23acf6da *: fix linter warnings 2019-10-02 16:40:26 +03:00
Simon Zolin
319cc848bd - crash after filter update if its data is too small 2019-09-27 13:22:08 +03:00
Simon Zolin
81828c87c1 * querylog: POST /control/querylog 2019-09-26 18:27:31 +03:00
Simon Zolin
bbb5413331 * stats: refactor: move HTTP handlers to stats/
DNS module passes additional parameters to Stats module.
This allows Stats to handle HTTP requests by itself - completely removing
 all stats-related code from outside.
2019-09-26 16:52:28 +03:00
Simon Zolin
fcf37da312 * clients: remove an auto-client if a client with the same IP was added manually 2019-09-25 16:11:42 +03:00
Simon Zolin
95eeccde8f + whois: use "descr" or "netname" in case there's no "orgname" 2019-09-25 16:11:42 +03:00
Andrey Meshkov
875905ce8a Merge: Add WHOIS info for clients
* commit 'a52715e0863af0a9e1b26dbf96fc7cced02ae4f6':
  + client: add whois info to dashboard and logs
  + client: add whois info to clients and auto clients table
  * rDNS: refactor
  + whois: add WHOIS information for a client
2019-09-23 20:07:05 +03:00
Simon Zolin
75b864f25e * dnsforward: create dnsfilter asynchronously 2019-09-23 20:00:11 +03:00
Simon Zolin
192b58b9d9 * rDNS: refactor 2019-09-23 18:14:00 +03:00
Simon Zolin
fd592b4dc8 + whois: add WHOIS information for a client
+ return WHOIS info in GET /clients response
2019-09-23 18:12:54 +03:00
Simon Zolin
07fa9bb47c * minor 2019-09-19 12:47:55 +03:00
Andrey Meshkov
4e76013334 *(home): fix golint issues 2019-09-19 12:47:55 +03:00
Simon Zolin
d7f256ba7f - fix crash after stats module is closed
Close DNS forward module BEFORE stats.
2019-09-19 12:47:55 +03:00
Simon Zolin
a71521a658 + config: upgrade from v4 to v5 2019-09-19 12:47:55 +03:00
Simon Zolin
6304a7b91b + Login page and web sessions
+ /control/login
+ /control/logout
2019-09-19 12:47:55 +03:00
Simon Zolin
b8a98c1a77 * stats: pass configuration object via stats.New() 2019-09-16 16:17:39 +03:00
Simon Zolin
93babd3e1c + clients: runtime list: add clients from DHCP that have non-empty Hostname property 2019-09-16 13:06:32 +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
Simon Zolin
04e2566e9e * stats: use uint32 or uint64 integer values, not int 2019-09-12 17:53:27 +03:00
Simon Zolin
8a2aa57e24 - /stats_config: write config 2019-09-12 14:48:24 +03:00
Simon Zolin
97684368b9 - stats: use --workdir 2019-09-12 14:48:13 +03:00
Simon Zolin
b078b82a89 * filter update: ensure filter data is text (but not html)
stop checking Content-Type HTTP header
2019-09-10 15:22:17 +03:00
Simon Zolin
4a58266ba3 + statistics: store in separate file
+ GET /control/stats handler
2019-09-04 10:12:02 +03:00
Simon Zolin
60eb55bdce * stats: remove old code 2019-09-04 10:12:01 +03:00
Simon Zolin
fe23b33d7e + config: "statistics_interval" setting 2019-09-04 10:12:01 +03:00
Simon Zolin
cc2654c371 + /control/stats_config, /control/stats_info 2019-09-04 10:12:01 +03:00
Simon Zolin
c616259e8b * dnsfilter: use golibs/cache
+ config: add cache size settings
+ config: add cache_time setting
2019-09-02 19:12:53 +03:00
Simon Zolin
24bb708b21 + config: add certificate_path, private_key_path
* POST /control/tls/configure: support certificate_path and private_key_path
2019-08-30 19:18:14 +03:00
Ildar Kamalov
bdd86adac5 + blocked_services: add tiktok main domain 2019-08-29 11:45:39 +03:00
Ildar Kamalov
eb524e27a6 + blocked_services: add tiktok 2019-08-29 11:39:04 +03:00
Simon Zolin
d4c012220e * control: add link to the issue on github 2019-08-27 11:53:09 +03:00
Simon Zolin
815489c0ff * /control/version.json: retry up to 3 times after DNS resolve of static.adguard.com has failed 2019-08-26 16:02:56 +03:00
Simon Zolin
452a668a5b * control: refactor: all handlers are registered via httpRegister()
* move some code to home/control_filtering.go
2019-08-21 14:52:57 +03:00
Andrey Meshkov
c82e93cfc7 -(dnsforward): fixed sigsegv when protection is disabled
Also, fixed all golint issues

 Closes: #941
2019-08-20 00:55:32 +03:00
Simon Zolin
8e08cddf64 + dhcp: use --workdir value for "leases.db" file path 2019-08-19 14:40:10 +03:00
Simon Zolin
d46ebe1c8b Revert "+ config: add cache size settings"
This reverts commit 81303b5db7.
2019-08-16 15:17:38 +03:00
Simon Zolin
ea2a523f8c Merge: * config: set default DNS server as IP addresses
Close #926

* commit '9d7285e42c61852ab5106402b0138ef27dbc5b0f':
  * config: set default DNS server as IP addresses
2019-08-13 13:48:12 +03:00
Simon Zolin
9d7285e42c * config: set default DNS server as IP addresses
* config: add "1.0.0.1" to default bootstrap addresses
2019-08-13 11:52:06 +03:00
Simon Zolin
8b63811fa9 * filters update: increase update period to 24 hours 2019-08-13 10:30:28 +03:00
Simon Zolin
d659e7ee08 * rDNS: make log messages' level = debug 2019-08-08 12:11:24 +03:00
Simon Zolin
4f08f96607 * rDNS: refactor: move code to a separate file 2019-08-08 12:10:50 +03:00
Simon Zolin
e7001c3bc4 * config upgrade: sequential processing 2019-08-05 14:12:22 +03:00
Simon Zolin
1b95a85651 * config: upgrade schema version: 3 -> 4 2019-08-05 14:12:22 +03:00
Simon Zolin
dc2d8cf075 + /control/blocked_services/* API 2019-08-05 14:12:22 +03:00
Simon Zolin
e81a9c7d56 + dnsfilter: use global and per-client BlockedServices array 2019-08-05 14:12:22 +03:00
Simon Zolin
04a477c14a + clients: add BlockedServices field 2019-08-05 14:12:22 +03:00
Simon Zolin
8307a5a494 + config: store/load "blocked_services" per-client setting 2019-08-05 14:12:22 +03:00
Simon Zolin
9857024c5d + control: add /rewrite/* handlers 2019-07-29 11:48:24 +03:00
Simon Zolin
81303b5db7 + config: add cache size settings 2019-07-23 15:57:44 +03:00
Simon Zolin
b8444ff46a * minor 2019-07-19 12:18:16 +03:00
Simon Zolin
6701e9ce06 * move "dnsctx" to "config" 2019-07-19 12:18:16 +03:00
Simon Zolin
af21a5f17b * move "dnsServer" to "config" 2019-07-19 12:18:16 +03:00
Simon Zolin
001b4b981f * move "dhcpServer" to "config" 2019-07-19 12:18:16 +03:00
Simon Zolin
5e309a7b3a * move "httpServer" to "config" 2019-07-19 12:18:16 +03:00
Simon Zolin
2780ace63e * move "httpsServer" to "config" 2019-07-19 12:18:16 +03:00
Simon Zolin
f79008d9d0 * move "pidFileName" to "config" 2019-07-19 12:18:16 +03:00
Simon Zolin
d3ddfc81a6 * move "versionCheckJSON" to "config" 2019-07-19 12:18:16 +03:00
Simon Zolin
c426ee0108 * move "client", "transport" to "config" 2019-07-19 12:18:16 +03:00
Simon Zolin
2682adca39 * move "controlLock" mutex to "config" 2019-07-17 19:29:45 +03:00
Simon Zolin
d51f43e27a * clients: move container object to "config"
Now the functions use parameter, not a global object.
2019-07-17 19:29:45 +03:00
Simon Zolin
1c5b613048 - filters: fix crash after update 2019-07-16 15:29:36 +03:00
Simon Zolin
1b45dc45fc - filters: start DNS server after filters are updated 2019-07-16 14:32:58 +03:00
Simon Zolin
2c91de73af * minor 2019-07-16 12:55:55 +03:00
Simon Zolin
94f3bf44d7 - filters: start DNS server after filter has been removed 2019-07-16 12:55:47 +03:00
Simon Zolin
27006f58c5 - filters: windows: fix update procedure
We couldn't write filter files on Windows due to
 "file is being used" error.
2019-07-16 12:55:18 +03:00
Simon Zolin
375e410aa3 - /filtering/remove_url: windows: remove filter file only after DNS server has been stopped
Otherwise, os.Remove() will return with an error "file is being used".
2019-07-15 18:23:58 +03:00
Simon Zolin
e2b518339f - don't load filter rules if filter is disabled 2019-07-15 12:49:48 +03:00
Simon Zolin
425f3c87d0 + /status: "dns_addresses": add "tls://" or "https://" prefix 2019-07-05 15:47:21 +03:00
Simon Zolin
ad7c5cb9dc * /status: "dns_addresses": add port if not 53 2019-07-05 15:47:21 +03:00
Simon Zolin
1445940473 Merge: * use urlfilter v0.4.0
Close #866

* commit '134d9275bba7de7d1550412310bc275c52bb340e':
  * use urlfilter v0.4.0
2019-07-05 12:33:30 +03:00
Simon Zolin
df30248870 Merge: - freebsd: fix build
Close #870

* commit '98ff11e1c781a373768f01c54f6c7c29d8096d32':
  - freebsd: fix build
2019-07-04 15:12:38 +03:00
Simon Zolin
b419a1e3d8 Merge: * dns: fail on starting DNS server if upstream servers configuration is incorrect
* commit 'e2675e9a3bb54263d991ed4e9260d5acfedd63da':
  - client: fix link to dhcp settings page
  * dns: fail on starting DNS server if upstream servers configuration is incorrect
2019-07-04 14:57:35 +03:00
Simon Zolin
98ff11e1c7 - freebsd: fix build
Go's "syscall" package file for FreeBSD (incorrectly?) uses int64
 types in syscall.Rlimit struct.
2019-07-04 14:26:34 +03:00
Simon Zolin
134d9275bb * use urlfilter v0.4.0
Now we pass filtering rules to urlfilter as filer file names,
 rather than the list of rule strings.
(Note: user rules are still passed as the list of rule strings).

As a result, we don't store the contents of filter files in memory.
2019-07-04 14:10:01 +03:00
Simon Zolin
dc43ad9910 * dns: fail on starting DNS server if upstream servers configuration is incorrect 2019-07-03 17:59:19 +03:00
Simon Zolin
131aa4c93c - service stop: fix race
Service Stop handler sends SIGINT to the main thread,
 which begins the stops the app.
2019-07-02 12:56:23 +03:00
Simon Zolin
1c9abd6107 Merge: + dhcpd, clients, dnsfilter: add more tests
#788

* commit '25da23497a19118a22b97d64749fa70337544116':
  + dnsfilter: more tests
  + dhcpd, clients: add more tests
2019-07-01 19:26:27 +03:00
Simon Zolin
b45e8e80fb Merge: * auto-update: use backup directory format without version: "agh-backup"
Close #801

* commit '885b660808a848277f080c78dc7e6107afdbabb7':
  * auto-update: refactor test;  test getUpdateInfo()
  * auto-update: use backup directory format without version: "agh-backup"
2019-06-27 18:04:37 +03:00
Simon Zolin
885b660808 * auto-update: refactor test; test getUpdateInfo() 2019-06-27 15:23:48 +03:00
Simon Zolin
bdc9a0b906 * auto-update: use backup directory format without version: "agh-backup" 2019-06-27 15:23:16 +03:00
Simon Zolin
db7efc24d3 + clients: parse 'arp -a' output; periodically update info
* prioritize a client source: etc/hosts > ARP > rDNS
2019-06-27 11:39:53 +03:00
Simon Zolin
b4b11406cf Merge: * /control/version.json: add "recheck_now" parameter
Close #815

* commit 'd2258cb66de32092f145f2803a7be3d7869970f2':
  * openapi.yaml: update /version.json
  + client: add button for check updates
  * /control/version.json: add "recheck_now" parameter
2019-06-27 11:23:29 +03:00
Simon Zolin
efaaeb58eb + dhcpd, clients: add more tests 2019-06-26 17:53:05 +03:00
Simon Zolin
6a1edc45be - rDNS: don't try to resolve loopback IP addresses 2019-06-25 16:14:52 +03:00
Simon Zolin
5d60bb05ab * /control/version.json: add "recheck_now" parameter 2019-06-25 16:06:55 +03:00
Andrey Meshkov
f1e6a30931 Fix version/channel linking 2019-06-20 14:36:26 +03:00
Andrey Meshkov
082354204b Fix #831
This commit fixes panic when customDialContext fails to resolve the host's address.
2019-06-18 16:18:13 +03:00
Simon Zolin
dc682763ff * move ./*.go files into ./home/ directory 2019-06-10 11:51:53 +03:00