Cuong Manh Le and Cuong Manh Le
1dee4305bc
cmd/cli: refactoring self-check process
...
Make the code cleaner and easier to maintain.
2024-05-09 18:39:30 +07:00
Cuong Manh Le and GitHub
429a98b690
Merge pull request #144 from Control-D-Inc/release-branch-v1.3.6
...
Release branch v1.3.6
v1.3.6
2024-04-20 00:01:23 +07:00
Cuong Manh Le and Cuong Manh Le
da01a146d2
internal/clientinfo: check hostname mapping for both ipv4/ipv6
2024-04-19 14:32:21 +07:00
Cuong Manh Le and Cuong Manh Le
dd9f2465be
internal/clientinfo: map ::1 to the right host MAC address
...
So queries originating from host using ::1 as source will be recognized
properly, and treated the same as other queries from host itself.
2024-04-19 14:32:09 +07:00
Cuong Manh Le and Cuong Manh Le
b5cf0e2b31
cmd/cli: allow chosing dev/prod with upgrade command
2024-04-16 00:16:11 +07:00
Cuong Manh Le and Cuong Manh Le
1db159ad34
cmd/cli: move pin check before any API calls
...
So ctrld won't perform unnecessary API calls if pin code is set.
2024-04-16 00:16:00 +07:00
Ginder Singh and Cuong Manh Le
6604f973ac
Disconnect from Control D without checking pin for app restarts
2024-04-11 00:22:38 +07:00
Cuong Manh Le and Cuong Manh Le
69ee6582e2
Bump quic-go to v0.42.0
...
Fixes https://pkg.go.dev/vuln/GO-2024-2682
2024-04-11 00:19:36 +07:00
Cuong Manh Le and Cuong Manh Le
6f12667e8c
Only set OS header value for query from router itself
...
So queries from clients won't be mis-recognized as query from router in
case of client metadata is in progress of collecting.
2024-04-06 00:41:23 +07:00
Cuong Manh Le and Cuong Manh Le
b002dff624
internal: only delete old ipv6 if it is non-link local
...
So the client is removed from table only when it's global ipv6 changed.
2024-04-06 00:41:04 +07:00
Cuong Manh Le and Cuong Manh Le
affef963c1
cmd/cli: log new version when upgrading successfully
2024-04-04 22:44:29 +07:00
Cuong Manh Le and Cuong Manh Le
56b2056190
Bump golang.org/x/net to v0.23.0
...
Fix https://pkg.go.dev/vuln/GO-2024-2687
2024-04-04 22:44:29 +07:00
Cuong Manh Le and Cuong Manh Le
c1e6f5126a
internal/clientinfo: watch NDP table changes on Linux
...
So with clients which only use SLAAC, ctrld could see client's new ip as
soon as its state changes to REACHABLE.
Moreover, the NDP listener is also changed to listen on all possible
ipv6 link local interfaces. That would allow ctrld to get all NDP events
happening in local network.
SLAAC RFC: https://datatracker.ietf.org/doc/html/rfc4862
2024-04-04 22:44:25 +07:00
Cuong Manh Le and Cuong Manh Le
1a8c1ec73d
Provide better error message when self-check failed
...
By connecting to all upstreams when self-check failed, so it's clearer
to users what causes self-check failed.
2024-04-01 14:14:57 +07:00
Cuong Manh Le and Cuong Manh Le
52954b8ceb
Set bootstrap ip for ControlD upstream in cd mode
2024-04-01 14:14:44 +07:00
Cuong Manh Le and Cuong Manh Le
a5025e35ea
cmd/cli: add internal domain test query during self-check
...
So it's clear that client could be reached ctrld's listener or not.
2024-04-01 14:14:32 +07:00
Cuong Manh Le and Cuong Manh Le
07f80c9ebf
cmd/cli: disable quic-go's ECN support by default
...
It may cause issues on some OS-es.
See: https://github.com/quic-go/quic-go/issues/3911
2024-03-25 18:25:07 +07:00
Cuong Manh Le and Cuong Manh Le
13db23553d
Upgrade protobuf to v1.33.0
...
Fixing CVE-2024-24786.
2024-03-22 22:36:12 +07:00
Cuong Manh Le and Cuong Manh Le
3963fce43b
Use sync.OnceValue
2024-03-22 16:29:54 +07:00
Cuong Manh Le and Cuong Manh Le
ea4e5147bd
cmd/cli: use slices.Contains
2024-03-22 16:29:47 +07:00
Cuong Manh Le and Cuong Manh Le
7a491a4cc5
cmd/cli: use clear builtin
2024-03-22 16:29:38 +07:00
Cuong Manh Le and Cuong Manh Le
5ba90748f6
internal/clientinfo: skipping non-reachable neighbor
...
Otherwise, failed or stale ipv6 will be used if it appeared last in the
table, instaed of the current one.
2024-03-22 16:11:47 +07:00
Cuong Manh Le and Cuong Manh Le
20f8f22bae
all: add support to Netgear Orbi Voxel
...
While at it, also ensure checking the service is installed or not before
executing uninstall function, so we won't emit un-necessary errors.
2024-03-22 16:11:25 +07:00
Cuong Manh Le and Cuong Manh Le
b50cccac85
all: add flush cache domains config
2024-03-22 16:09:06 +07:00
Cuong Manh Le and Cuong Manh Le
34ebe9b054
cmd/cli: allow MAC wildcard matching
2024-03-22 16:08:53 +07:00
Cuong Manh Le and Cuong Manh Le
43d82cf1a7
cmd/cli,internal/router: detect unbound/dnsmasq status correctly on *BSD
...
Also detect cd mode for stop/uninstall command correctly, too.
2024-03-22 16:08:40 +07:00
Cuong Manh Le and Cuong Manh Le
ab88174091
docs: add missing supported lease file type
...
Discover while supporting user in Discord.
2024-03-22 16:08:26 +07:00
Cuong Manh Le and Cuong Manh Le
ebcbf85373
cmd/cli: add upgrade command
...
This commit implements upgrade command which will:
- Download latest version for current running arch.
- Replacing the binary on disk.
- Self-restart ctrld service.
If the service does not start with new binary, old binary will be
restored and self-restart again.
2024-03-22 16:08:14 +07:00
Cuong Manh Le and Cuong Manh Le
87513cba6d
cmd/cli: ignore un-usable interfaces on darwin when resetDNS
2024-03-22 16:08:01 +07:00
Cuong Manh Le and Cuong Manh Le
64bcd2f00d
cmd/cli: validate remote config during "ctrld start"
...
On BSD, the service is made un-killable since v1.3.4 by using daemon
command "-r" option. However, when reading remote config, the ctrld will
fatally exit if the config is malformed. This causes daemon respawn new
ctrld process immediately, causing the "ctrld start" command hang
forever because of restart loop.
Since "ctrld start" already fetch the resolver config for validating
uid, it should validate the remote config, too. This allows better error
message printed to users, let them know that the config is invalid.
Further, if the remote config was invalid, we should disregard it and
generating the default working one in cd mode.
2024-03-22 16:07:45 +07:00
Cuong Manh Le and Cuong Manh Le
cc6ae290f8
internal/clientinfo: use last seen IP for NDP discovery
2024-03-22 16:07:29 +07:00
Cuong Manh Le and Cuong Manh Le
3e62bd3dbd
internal/router: use same dir with executable as home dir on Firewalla
...
Since when /etc is not persisted after rebooting.
2024-03-22 16:07:19 +07:00
Ginder Singh and Cuong Manh Le
8491f9c455
Deactivation pin fixes
...
- short control socket name.(in IOS max length is 11)
- wait for control server to reply before checking for deactivation pin.
- Added separate name for control socket for mobile.
- Added stop channel reference to Control client constructor.
2024-03-22 16:05:49 +07:00
Cuong Manh Le and Cuong Manh Le
3ca754b438
cmd/cli: use loopback mapping for query from self
...
So queries from host will always use the same hostname consistently.
2024-03-22 15:58:31 +07:00
Cuong Manh Le and Cuong Manh Le
8c7c3901e8
cmd/cli: ignore un-usable interfaces on darwin
...
So multi interfaces config won't emit un-necessary errors if the network
cable adapters are not being used on MacOS.
2024-03-22 15:58:17 +07:00
Cuong Manh Le and Cuong Manh Le
a9672dfff5
Allow DoH/DoH3 endpoint without scheme
2024-03-22 15:58:00 +07:00
Cuong Manh Le and Cuong Manh Le
203a2ec8b8
cmd/cli: add timeout for newSocketControlClient
...
On BSD platform, using "daemon -r" may fool the status check that ctrld
is still running while it was terminated unexpectedly. This may cause
the check in newSocketControlClient hangs forever.
Using a sane timeout value of 30 seconds, which should be enough for the
ctrld service started in normal condition.
2024-03-22 15:57:42 +07:00
Yegor S and GitHub
810cbd1f4f
Merge pull request #138 from Control-D-Inc/release-branch-v1.3.5
...
Release branch v1.3.5
v1.3.5
2024-03-04 12:40:40 -05:00
Cuong Manh Le and Cuong Manh Le
49eebcdcbc
.github/workflows: bump go version to 1.21.x
2024-03-04 14:49:52 +07:00
Cuong Manh Le and Cuong Manh Le
e89021ec3a
cmd/cli: only set DNS for physical interfaces on Windows
...
By filtering the interfaces by MAC address instead of name.
2024-03-04 14:49:52 +07:00
Cuong Manh Le and Cuong Manh Le
73a697b2fa
cmd/cli: remove old DNS settings on installing
2024-02-27 23:18:11 +07:00
Yegor Sak and Cuong Manh Le
9319d08046
Update file config.md
2024-02-27 23:18:11 +07:00
Cuong Manh Le and Cuong Manh Le
7dc5138e91
cmd/cli: watch resolv.conf on all unix platforms
2024-02-22 18:15:36 +07:00
Cuong Manh Le and Cuong Manh Le
8f189c919a
cmd/cli: skip deactivation check for old socket server
...
If the server is running old version of ctrld, the deactivation pin
check will return 404 not found, the client should consider this as no
error instead of returning invalid pin code.
This allows v1.3.5 binary `ctrld start` command while the ctrld server
is still running old version. I discover this while testing v1.3.5
binary on a router with old ctrld version running.
2024-02-22 18:14:30 +07:00
Cuong Manh Le and Cuong Manh Le
906479a15c
cmd/cli: do not save static DNS when ctrld is already installed
...
If ctrld was installed, the DNS setting was changed, we could not
determine the dynamic or static settings before installing ctrld.
2024-02-21 17:49:19 +07:00
Cuong Manh Le and Cuong Manh Le
dabbf2037b
cmd/cli: do not allow running start command if pin code set
...
While at it, also emitting a better error message when pin code was set
but users do not provide --pin flag.
2024-02-20 15:21:00 +07:00
Yegor S and GitHub
b496147ce7
Merge pull request #137 from Control-D-Inc/fix-doc-links
...
docs: fix reference links in config.md
2024-02-19 17:02:29 -05:00
Cuong Manh Le and Cuong Manh Le
583718f234
cmd/cli: silent un-necessary error for physical interfaces loop
...
The loop is run after the main interface DNS was set, thus the error
would make noise to users. This commit removes the noise, by making
currentStaticDNS returns an additional error, so it's up to the caller
to decive whether to emit the error or not.
Further, the physical interface loop will now only log when the callback
function runs successfully. Emitting the callback error can be done in
the future, until we can figure out how to detect physical interfaces in
Go portably.
2024-02-19 18:29:22 +07:00
Cuong Manh Le and Cuong Manh Le
fdb82f6ec3
cmd/cli: only emit error for running interfaces
...
While at it, also ensure setDNS/resetDNS return a wrapped error on
Darwin/Windows, so the caller can decide whether to print the error to
users.
2024-02-19 18:29:22 +07:00
Cuong Manh Le and Cuong Manh Le
5145729ab1
cmd/cli: always set/reset DNS regardless of interfaces state
...
The interface may be down during ctrld uninstall, so the previous set
DNS won't be restored, causing bad state when interface is up again.
2024-02-19 18:29:22 +07:00