This implements a new peer-to-peer-based discovery protocol.
- The DHT is based on libp2p (of IPFS etc) and constitutes a new,
separate Syncthing-specific network. It does not piggyback on any
existing non-Syncthing nodes out there.
- It uses existing device IDs as the keys, and publishes discovery
documents that include the device certificate and are signed by the
same. This enables validation that the discovery data is _for_ the
right device ID, as well as published _by_ that device.
- The DHT runs on the QUIC socket, so it shares UPnP/NAT-PMP whole
punches and STUN discovery. (Unless the QUIC listener is disabled,
then it runs on an ephemeral socket and can effectively do only
queries and not participate as a full DHT node.)
- There is a hardcoded default pointing to three bootstrap nodes hosted
in the usual manner.
- Currently it's strictly additive -- it runs separately and in
parallell with the usual global discovery. Once proven and scaled, it
will gradually take over the duties of the global discovery.
- There is a new command line tool `stdht` which just runs a DHT node to
assist with discovery (the bootstrap nodes are this).
The diff is large and terrifying, but that's how it is.
Signed-off-by: Jakob Borg <[email protected]>
The glob in **/go.sum fails in some builds because there are a lot of files in ** due to things like the zig cache directory. We can be more specific. Also, avoid a huge build context sent to Docker for the container builds.
---------
Signed-off-by: Jakob Borg <[email protected]>
Avoid:
/_/GOROOT/src/os/user/cgo_lookup_cgo.go:45:(.text+0x54): warning: Using
'getgrgid_r' in statically linked applications requires at runtime the
shared libraries from the glibc version used for linking
and
/tmp/go-build/cgo-gcc-prolog:60:(.text+0x40): warning: Using
'getaddrinfo' in statically linked applications requires at runtime the
shared libraries from the glibc version used for linking
I added these tags as part of the big database PR, but I forget why. I
think it came from an attempt at a static binary using the Go-based
SQLite packages, but that's not the primary build anymore anyway. We can
remove this and go back to the standard resolvers, which gives better
support for primarily Windows and macOS special resolution methods...