Commit Graph

114 Commits

Author SHA1 Message Date
Eugene Bujak d8802a9709 Use new log wrapper and add more functions to it. 2018-12-29 17:37:18 +03:00
Eugene Bujak 8b4a1ca713 First implementation of DHCP server, compiles but not tested yet. 2018-12-28 18:28:46 +03:00
Eugene Bujak 73f71364b3 Add interface name to dhcp config 2018-12-28 18:26:57 +03:00
Eugene Bujak 39bc55e430 Fixup of previous commit. 2018-12-28 18:26:56 +03:00
Eugene Bujak 59adad4d53 DHCP -- Use uint64 for lease duration 2018-12-28 18:26:56 +03:00
Ildar Kamalov d46b65f982 Add enable/disable for DHCP server 2018-12-28 18:26:56 +03:00
Eugene Bujak 96fbf7f134 Fix yaml marshalling panic. 2018-12-28 18:26:56 +03:00
Eugene Bujak 9294c9ecb2 Add DHCP API stubs for JS development. 2018-12-28 18:26:56 +03:00
Eugene Bujak 8fb6f92753 Use filter deduplication function. 2018-12-06 17:19:04 +03:00
Eugene Bujak 250cc0ec0f config -- Avoid deleting existing dns section if someone removes schema_version from yaml file. 2018-12-06 00:29:38 +03:00
Eugene Bujak 0f5dd661f5 Add support for bootstrapping upstream DNS servers by hostname. 2018-12-06 00:22:20 +03:00
Eugene Bujak 609523a59c Don't omit empty user rules in configfile -- otherwise users might not be able to find that it's customizable in configfile. 2018-12-05 21:09:37 +03:00
Eugene Bujak e31905864b Get rid of mentions of CoreDNS in code except for upgrading and in readme. Add config upgrade. 2018-12-05 21:08:43 +03:00
Eugene Bujak 478ce03386 dnsforward -- implement ratelimit and refuseany 2018-12-05 18:49:19 +03:00
Eugene Bujak 057db71f3b Get rid of duplicate variable definitions 2018-12-05 16:57:21 +03:00
Eugene Bujak 87c54ebd4c Move Filter definition from dnsforward to dnsfilter, it belongs there. 2018-12-05 16:57:21 +03:00
Eugene Bujak 31f77af534 Move user filter saving into writeAllConfigs() 2018-12-05 16:56:11 +03:00
Eugene Bujak 0d1478b635 Remove unused struct field 2018-12-05 16:56:11 +03:00
Eugene Bujak d27fd0488d Move filter-related variables, types and methods to filter.go 2018-12-05 16:56:11 +03:00
Eugene Bujak 8316d39b42 Move filtering setting fields from main app to dnsforward. 2018-12-05 16:56:11 +03:00
Eugene Bujak 4eb122e973 Avoid duplication of fields in filter struct. 2018-12-05 16:56:11 +03:00
Eugene Bujak feabc21864 Unplug coreDNS and plug dnsforward library. 2018-12-05 16:54:56 +03:00
Eugene Bujak ea1353422f User rules -- hold them as a slice of strings, which is how dns forwarding server will expect them. 2018-12-05 16:54:56 +03:00
Eugene Bujak 39eccc62b1 Fix that filter ID is uppercase while js expects it to be lowercase. 2018-12-05 16:50:06 +03:00
Eugene Bujak 45ae984f3b Fix incorrect cherry-pick in previous commit. 2018-11-29 14:58:25 +03:00
Eugene Bujak 2012e707d0 Fix race condition of trying to write YAML config simultaneously and failing. 2018-11-29 13:31:50 +03:00
Eugene Bujak 701fd10c1c Protect against users deleting the filter ID's in the config file.
Incidentally, it also simplifies upgrade schema from 0 to 1.
2018-11-28 13:38:19 +03:00
Eugene Bujak 6cb991fe7f Clean up some code -- reorganize some structs and unexport some consts. 2018-11-28 13:38:19 +03:00
Eugene Bujak ec7efcc9d6 Move config upgrade to separate upgrade.go 2018-11-28 13:38:19 +03:00
Eugene Bujak 12a8011fb3 Get rid of unnecessary duplicate type coreDnsFilter. 2018-11-27 16:48:57 +03:00
Eugene Bujak 47e2a1004d Remove IDE-specific noise from source code. 2018-11-27 16:05:43 +03:00
Andrey Meshkov 82da886df5 Add ratelimit and refuse_any to config file 2018-11-26 17:00:46 +03:00
Andrey Meshkov a0482fc201 Fix #426
Added refuseany (enabled by default)
Added ratelimit and refuseany to the config file (for manual editing only)
2018-11-26 13:38:17 +03:00
Andrey Meshkov f94c63ed5b Set default ratelimit to 30/sec 2018-11-25 23:32:28 +03:00
Andrey Meshkov 668dcebf13 Added ratelimit plugin 2018-11-25 23:11:36 +03:00
Eugene Bujak 2139bb9c79 Allow querying and changeing i18n language via API. 2018-11-21 20:44:20 +03:00
Andrey Meshkov 451922b858 Added bootstrap DNS to the config file
DNS healthcheck now uses the upstream package methods
2018-11-06 00:47:59 +03:00
Andrey Meshkov efdd1c1ff2 Added CoreDNS plugin setup and replaced forward 2018-11-05 23:49:31 +03:00
Andrey Meshkov 54bdacdde2 Fix review comments: NextFilterId collisions 2018-10-30 17:16:20 +03:00
Andrey Meshkov 591065aa3a Added filterId to the querylog
Updated the openapi.yaml accordingly
Some minor refactoring/renaming
Fix other review comments
2018-10-30 12:24:59 +03:00
Andrey Meshkov 760e3596b6 Fix review comments
Fixed coredns plugin tests
Check that user filter is not empty
2018-10-30 11:01:09 +03:00
Andrey Meshkov 32d4e80c93 Fix #371 #421
Filters are now saved to a file
Also, they're loaded from the file on startup
Filter ID is not passed to the CoreDNS plugin config (server-side AG DNS must be changed accordingly)
Some minor refactoring, unused functions removed
2018-10-30 02:17:24 +03:00
Eugene Bujak a528ed9f94 Stop requiring current working directory to be the location of AdGuardHome.
Fixes #381.
2018-10-17 20:43:26 +03:00
Eugene Bujak 3e2a3afc52 Rename from 'Adguard DNS' to 'AdGuard Home'. 2018-10-15 16:02:19 +03:00
Eugene Bujak bad88961e9 WIP -- single binary -- works, replies to DNS, but need to check what got broken 2018-10-12 17:11:57 +03:00
Eugene Bujak 557c2268dc Merge pull request #67 in DNS/adguard-dns from feature/333 to master
* commit '383f1c2fb38437e682ec9fc6623672730dae4581':
  Hide badge if core is not running
  Add client requests for toggle protection
  API backend -- implement ability to turn toggle all protection in one go, helpful to temporarily disable all kinds of filtering
2018-10-11 16:23:01 +03:00
Andrey Meshkov e7b6ab4750 Change blocked ttl to 10 sec, we don't need it to be large in a home network 2018-10-11 13:24:06 +03:00
Eugene Bujak 413228e6ec API backend -- implement ability to turn toggle all protection in one go, helpful to temporarily disable all kinds of filtering 2018-10-10 20:13:03 +03:00
Eugene Bujak e689c7d940 Do not lose filter name when saving to yaml 2018-10-10 19:49:18 +03:00
Eugene Bujak c499c435c3 Fixup of previous merge -- fix build failure. 2018-10-10 01:13:00 +03:00
Eugene Bujak 8503f76747 Add default disabled hosts filters. 2018-10-10 00:59:37 +03:00
Eugene Bujak c2be5917ef Change default filter URL to github-hosted version 2018-10-10 00:44:39 +03:00
Eugene Bujak 2244c21b76 Fix race conditions found by go's race detector 2018-10-07 02:21:27 +03:00
Eugene Bujak 98994916b5 Code review request -- set safebrowsing default to disabled 2018-09-26 18:41:45 +03:00
Eugene Bujak f1ae5d78d2 web backend -- generate corefile with blocked_ttl config parameter
Closes #346.
2018-09-26 18:38:35 +03:00
Eugene Bujak c7790a8d9f coredns plugin -- Add option "blocked_ttl" that can change default nxdomain response TTL 2018-09-26 18:38:06 +03:00
Eugene Bujak ff86d6b7dc Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API
2018-09-26 17:47:23 +03:00
Eugene Bujak 09a39cce03 Allow disabling of filtering but keeping querylog, safebrowsing, safesearch and parental working. 2018-09-25 19:26:26 +03:00
Eugene Bujak ba56d6c01d Reorganize config file. 2018-09-19 15:51:44 +03:00
Eugene Bujak 4548eb8d11 Implement simple basic auth.
Closes #326.
2018-09-18 20:59:41 +03:00
Eugene Bujak 076c9de68e Fix many lint warnings found by gometalinter 2018-09-14 18:40:05 +03:00
Eugene Bujak c1e16cc584 Add support for serving /etc/hosts 2018-09-10 20:43:22 +03:00
Eugene Bujak 859f1590dd Be more atomic during writing of files -- this prevents other processes from seeing empty or impartial files 2018-09-06 02:03:03 +03:00
Eugene Bujak ed4077a969 Initial commit 2018-08-30 17:25:33 +03:00