Commit Graph

76 Commits

Author SHA1 Message Date
Simon Zolin 07db05dd80 * makefile: test: use '-race' parameter on UNIX, don't use it on Windows
Squashed commit of the following:

commit b01379bb223dd28464e8f0b1e8878d3e6b314c26
Merge: 16c7ab79 4efc464e
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Thu Sep 3 10:00:31 2020 +0300

    Merge remote-tracking branch 'origin/master' into fix-test

commit 16c7ab7949ee0a175f89285c1f1fbde0aa27081b
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Sep 2 20:04:00 2020 +0300

    minor

commit af8002b09a3017955e9892db413fa62ce1e4ad81
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Sep 2 19:56:01 2020 +0300

    * makefile: test: use '-race' parameter on UNIX, don't use it on Windows

commit b893358cbe5d1b7dc7db23b0b159ec436c20ee3e
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Sep 2 19:36:48 2020 +0300

    test

commit c52a82b720f61f874d49708e9cc1b307d2f62839
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Sep 2 17:47:51 2020 +0300

    - fix test
2020-09-03 10:10:54 +03:00
Simon Zolin 9634ef9c03 - fix linter 2020-08-25 17:44:30 +03:00
Simon Zolin 704291e88d Merge: * DHCP fixes
Close #2040

* commit '06af130bb7c042d8a44720cc9423b3fc76deadee':
  - DHCP: fix crash after adding static lease which replaces the dynamic one
  * DHCP: don't replace the host name from static lease
2020-08-25 17:29:49 +03:00
Simon Zolin 9c999f98fb + dhcp custom options
Squashed commit of the following:

commit 140ac16568383cab2270e5d5ba895959902dd943
Merge: d5ed73b5 cb6ca3b0
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Tue Aug 25 13:46:34 2020 +0300

    Merge remote-tracking branch 'origin/master' into 1585-dhcp-options

commit d5ed73b5e4f068b823fe97ab1161753670d10387
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Aug 21 18:16:41 2020 +0300

    minor

commit f5208a0b050c2dd462b32edee0379758cc6e5003
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Jun 1 14:09:39 2020 +0300

    + dhcpv4 custom options
2020-08-25 14:07:11 +03:00
Simon Zolin 06af130bb7 - DHCP: fix crash after adding static lease which replaces the dynamic one 2020-08-25 13:38:52 +03:00
Simon Zolin 719ef16b93 * DHCP: don't replace the host name from static lease
When a static lease contains a host name
 and client sends its own host name:

1. don't replace the host name from static lease with it
2. send option FQDN to the client in Ack response packet
2020-08-25 13:38:28 +03:00
Andrey Meshkov 546a02b49e fix linter issues 2020-08-20 15:41:25 +03:00
Simon Zolin dd46cd5f36 * copy dhcpv4/nclient4 package with minor enhancement
The original package can be built only on Linux.
2020-08-20 15:19:59 +03:00
Simon Zolin e7bef3a448 * POST /control/dhcp/find_active_dhcp: add dhcpv6 server info 2020-08-20 15:19:58 +03:00
Simon Zolin 23752377b7 - dhcp: CheckIfOtherDHCPServersPresent: fix
Sometimes request from DHCP server couldn't be received
 because we were bound to a specific IP address.
2020-08-20 15:19:58 +03:00
Simon Zolin 6090400ea0 * GET /control/dhcp/interfaces: remove 'mtu'; add 'gateway_ip' 2020-08-19 18:32:34 +03:00
Simon Zolin ec24d18f83 * GET /control/dhcp/interfaces: split IPv4 and IPv6 addresses 2020-08-19 18:32:34 +03:00
Simon Zolin 89c3926ba5 * dhcp: fail on startup if couldn't initialize DHCP module 2020-08-19 18:32:34 +03:00
Simon Zolin a3317c08c4 + dhcpv6 server; rewrite dhcpv4 server; changed API 2020-08-19 18:32:23 +03:00
Simon Zolin 49a92605b8 + dns: respond to PTR requests for internal IP addresses from DHCP
Close #1682

Squashed commit of the following:

commit 2fad3544bf8853b1f8f19ad8b7bc8a490c96e533
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Jun 22 17:32:45 2020 +0300

    minor

commit 7c17992424702d95e6de91f30e8ae2dfcd8de257
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Jun 22 16:09:34 2020 +0300

    build

commit 16a52e11a015a97d3cbf30362482a4abd052192b
Merge: 7b6a73c8 2c47053c
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Jun 22 16:08:32 2020 +0300

    Merge remote-tracking branch 'origin/master' into 1682-dhcp-resolve

commit 7b6a73c84b5cb9a073a9dfb7d7bdecd22e1e1318
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Jun 22 16:01:34 2020 +0300

    tests

commit c2654abb2e5e7b7e3a04e4ddb8e1064b37613929
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Jun 1 15:15:13 2020 +0300

    + dnsforward: respond to PTR requests for internal IP addresses

    {[IP] => "host"} <- DNSforward <-(leases)-- DHCP
2020-06-23 12:13:13 +03:00
Simon Zolin 33195b9155 - DHCP: when adding a new static lease: remove dynamic lease with the same MAC 2020-04-08 11:55:58 +03:00
Simon Zolin 105e2dd1ee Merge: - dhcp: web handlers were not registered when DHCP server is disabled
Close #1552

* commit '43704901384fe35785383b27a1ad0bd7d430830c':
  - dhcp: web handlers were not registered when DHCP server is disabled
2020-04-07 11:54:29 +03:00
Simon Zolin 4370490138 - dhcp: web handlers were not registered when DHCP server is disabled
So there was no way to enable DHCP from UI
2020-04-07 11:48:03 +03:00
Andrey Meshkov 7b8588afa4 *: fix golangci-lint warnings 2020-04-05 18:34:43 +03:00
Simon Zolin e8129f15c7 * refactor
1. Auth module was initialized inside dns.go - now it's moved to initWeb()

2. stopHTTPServer() wasn't called on server stop - now we do that

3. Don't use postInstall() HTTP filter where it's not necessary.
Now we register handlers after installation is complete.
2020-03-17 15:23:29 +03:00
Andrey Meshkov 7a3eda02ce Fix #1069 install: check static ip
Squashed commit of the following:

commit 57466233cb
Merge: 2df5f281 867bf545
Author: Andrey Meshkov <am@adguard.com>
Date:   Thu Feb 13 18:39:15 2020 +0300

    Merge branch 'master' into 1069-install-static-ip

commit 2df5f281c4
Author: Andrey Meshkov <am@adguard.com>
Date:   Thu Feb 13 18:35:54 2020 +0300

    *: lang fix

commit b4649a6b27
Merge: c2785253 f61d5f0f
Author: Andrey Meshkov <am@adguard.com>
Date:   Thu Feb 13 16:47:30 2020 +0300

    *(home): fixed issues with setting static IP on Mac

commit c27852537d
Author: Andrey Meshkov <am@adguard.com>
Date:   Thu Feb 13 14:14:30 2020 +0300

    +(dhcpd): added static IP for MacOS

commit f61d5f0f85
Author: Ildar Kamalov <i.kamalov@adguard.com>
Date:   Thu Feb 13 14:13:35 2020 +0300

    + client: show confirm before setting static IP

commit 7afa16fbe7
Author: Ildar Kamalov <i.kamalov@adguard.com>
Date:   Thu Feb 13 13:51:52 2020 +0300

    - client: fix text

commit 019bff0851
Author: Ildar Kamalov <i.kamalov@adguard.com>
Date:   Thu Feb 13 13:49:16 2020 +0300

    - client: pass all params to the check_config request

commit 194bed72f5
Author: Andrey Meshkov <am@adguard.com>
Date:   Wed Feb 12 17:12:16 2020 +0300

    *: fix home_test

commit 9359f6b55f
Merge: ae299058 c5ca2a77
Author: Andrey Meshkov <am@adguard.com>
Date:   Wed Feb 12 15:54:54 2020 +0300

    Merge with master

commit ae2990582d
Author: Andrey Meshkov <am@adguard.com>
Date:   Wed Feb 12 15:53:36 2020 +0300

    *(global): refactoring - moved runtime properties to Context

commit d8d48c5386
Author: Andrey Meshkov <am@adguard.com>
Date:   Wed Feb 12 15:04:25 2020 +0300

    *(dhcpd): refactoring, use dhcpd/network_utils where possible

commit 8d039c572f
Author: Ildar Kamalov <i.kamalov@adguard.com>
Date:   Fri Feb 7 18:37:39 2020 +0300

    - client: fix button position

commit 26c47e59dd
Author: Ildar Kamalov <i.kamalov@adguard.com>
Date:   Fri Feb 7 18:08:56 2020 +0300

    - client: fix static ip description

commit cb12babc46
Author: Andrey Meshkov <am@adguard.com>
Date:   Fri Feb 7 17:08:39 2020 +0300

    *: lower log level for some commands

commit d9001ff848
Author: Andrey Meshkov <am@adguard.com>
Date:   Fri Feb 7 16:17:59 2020 +0300

    *(documentation): updated openapi

commit 1d213d53c8
Merge: 8406d7d2 80861860
Author: Andrey Meshkov <am@adguard.com>
Date:   Fri Feb 7 15:16:46 2020 +0300

    *: merge with master

commit 8406d7d288
Author: Ildar Kamalov <i.kamalov@adguard.com>
Date:   Fri Jan 31 16:52:22 2020 +0300

    - client: fix locales

commit fb476b0117
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Jan 31 13:29:03 2020 +0300

    linter

commit 84b5708e71
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Jan 31 13:27:53 2020 +0300

    linter

commit 143a86a28a
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Jan 31 13:26:47 2020 +0300

    linter

... and 7 more commits
2020-02-13 18:42:07 +03:00
Simon Zolin dcc575402b Merge: * clients: update runtime clients of type DHCP by event from DHCP module
Close #1378

Squashed commit of the following:

commit e45e2d0e2768fe0677eee43538d381b3eaba39ca
Merge: bea8f79d 5e9c21b0
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Jan 29 20:08:20 2020 +0300

    Merge remote-tracking branch 'origin/master' into 1378-dhcp-clients

commit bea8f79dd6f8f3eae87649d853917b503df29616
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Jan 29 20:08:06 2020 +0300

    minor

commit 6f1da9c6ea9db5bf80acf234ffe322a4cd2d8d92
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Jan 29 19:31:08 2020 +0300

    fix

commit a88b46c1ded2b460ef7f0bfbcf1b80a066edf1c1
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Jan 29 12:53:22 2020 +0300

    minor

commit d2897fe0a9b726fcd97a04906e3be3d21f6b42d7
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Tue Jan 28 19:55:10 2020 +0300

    * clients: update runtime clients of type DHCP by event from DHCP module

commit 3aa352ed2372141617d77363b2f2aeaf3a7e47a0
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Tue Jan 28 19:52:08 2020 +0300

    * minor

commit f5c2291e39df4d13b9baf9aa773284890494bb0a
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Tue Jan 28 19:08:23 2020 +0300

    * clients: remove old entries of source type /etc/hosts or ARP
2020-01-30 10:25:02 +03:00
Andrey Meshkov 6bf512f96f -(home): fix searching clients by mac address 2019-12-23 16:59:02 +03:00
Simon Zolin b9c0b55356 * dhcp: now static leases functionality works before DHCP is started 2019-12-17 15:59:05 +03:00
Simon Zolin 906f26d7d2 - DHCP: normalize leases on startup (prioritize static leases over dynamic) 2019-12-03 20:43:22 +03:00
Simon Zolin df92941ae0 + POST /control/dhcp/reset: Reset DHCP configuration 2019-11-29 17:11:07 +03:00
Simon Zolin 477a4bbf54 * dhcp: move HTTP handlers to dhcpd/ 2019-11-29 17:11:07 +03:00
Simon Zolin 149fcc0f2d * dhcp,clients: DHCP server module is passed to Clients module during initialization. 2019-11-29 17:11:07 +03:00
Simon Zolin 71ce0c6da9 * clients: multiple IP, CIDR, MAC addresses
+ /clients/find
* clients: move code for config read/write
* clients: move HTTP handlers
2019-11-29 16:52:32 +03:00
Simon Zolin fd3e153a04 - dhcp: don't replace a static lease with a dynamic one 2019-09-23 18:47:13 +03:00
Simon Zolin 0c2611ff97 * minor 2019-09-16 13:06:32 +03:00
Simon Zolin c7b5b00d14 Merge: * dhcp: validate range_start/range_end values
Close #848

* commit '625b22a8d7bece655216b926f1b4ce35e14ccb07':
  * dhcp: validate range_start/range_end values
2019-08-23 17:18:30 +03:00
Simon Zolin 7acbeb8956 * dhcp: when adding a static lease, it can replace a dynamic lease 2019-08-23 16:14:00 +03:00
Simon Zolin 625b22a8d7 * dhcp: validate range_start/range_end values 2019-08-23 14:44:23 +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 79a5c920a4 * dhcpd: check if subnet mask is correct 2019-07-17 11:55:21 +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 efaaeb58eb + dhcpd, clients: add more tests 2019-06-26 17:53:05 +03:00
Simon Zolin 0b3ba82242 - dhcp: store lease data in database on each change rather than once on app stop 2019-06-26 14:02:41 +03:00
Simon Zolin eff23f3b62 - dhcp: fix race introduced by static lease add/remove from UI thread 2019-06-26 14:01:59 +03:00
Simon Zolin 3baa6919dc - fix tests and linter issues 2019-05-31 12:27:13 +03:00
Simon Zolin fa47fa3f9c * dhcpd: refactor: use separate objects for ServerConfig and RWMutex 2019-05-28 19:01:24 +03:00
Simon Zolin 763b986955 + dhcp: /dhcp/status: return static leases 2019-05-28 18:59:15 +03:00
Simon Zolin 342699d933 * dhcpd: minor improvements 2019-05-28 18:59:15 +03:00
Simon Zolin 725aeeb910 + dhcp: /dhcp/add_static_lease, /dhcp/remove_static_lease: control static lease table 2019-05-28 18:59:15 +03:00
Simon Zolin cc366495d3 + dhcpd: CheckConfig() 2019-05-28 18:59:15 +03:00
Simon Zolin 0d405c0af8 * dhcpd: move code from Start() to Init() 2019-05-28 18:59:15 +03:00
Simon Zolin 4bb7b654ab + dhcp: FindIPbyMAC() 2019-05-28 18:44:27 +03:00
Simon Zolin d5f46f51b8 - dhcp: fix build on macos #704 2019-04-23 15:14:26 +03:00