34 Commits
Author SHA1 Message Date
iceBear67 7eb35f82b1 fix gui 2026-07-26 20:44:49 +08:00
iceBear67 ae79082481 Merge remote-tracking branch 'homelab/sfcraft' into sfcraft 2026-07-26 17:41:37 +08:00
iceBear67 5b3a7e147c add: gui and tsdiag 2026-07-26 09:39:17 +00:00
iceBear67 ac27db76f9 fix: connectivity check fails on split-DNS destinations at startup
The diagnostics never got the split-DNS fix from 20097a0. That commit
  taught the dial path to resolve through the tailnet's own resolver
  (resolveDialAddr) but left getPeerFromRules on resolveAddr, so the two
  disagreed about how to look a destination up: connecting through a
  split-DNS name worked while the startup check called it unresolvable.

  Both paths now share resolveHostToIP, which honors MagicDNS, split-DNS
  routes and the DoH fallback.

  The check also resolved once at startup and cached the result for the
  process lifetime. tsnet reports Running before the netmap's DNS config
  reaches its resolver, and accept-routes is only applied after Up()
  returns, so a split-DNS name can fail for the first few seconds and
  resolve fine after. That transient failure dropped the peer permanently
  -- and when every rule failed, the goroutine returned and diagnostics
  never ran at all. Peers are re-resolved every round now, with a warm-up
  retry so the first report waits for DNS rather than racing it.

  Destinations outside the tailnet are no longer reported as failures.
  mc.lxns.net resolves fine but belongs to no peer, which is not an error,
  just not something to ping. errNotTailnetPeer separates "cannot resolve"
  from "resolved, not a peer"; only the former is retried or warned about.
  Unresolved rules now log their tag and dst, which the old message
  omitted entirely.

  Also fixed:

    * NormalizeDstAddrWithSuffix passed "host:port" to resolveAddr, so
      every existence check failed on the stray colon. Fixing that made
      the pass wait on cold-start DNS and delayed the listeners by ~5s,
      so it is now bounded by normalizeDNSBudget.

    * Peer lookup matched any AllowedIPs prefix containing the address.
      An exit node advertises 0.0.0.0/0, which contains everything, so a
      tailnet with an exit node picked the wrong peer at random depending
      on map iteration order. Default routes are skipped, the most
      specific route wins, ties break deterministically.

    * peer.AllowedIPs is a nillable pointer, dereferenced unguarded.
2026-07-26 14:52:14 +08:00
iceBear67 5dc1759d80 add doh support 2026-07-26 14:14:03 +08:00
iceBear67 20097a02a1 fix: domain names aren't resolved by tailscale's dns resolver. 2026-07-21 01:18:01 +08:00
nc c725d40d80 fix(tsnet): revert unexpected changes 2026-06-10 02:10:03 +08:00
nc 30330a1525 Merge branch 'fix-multi-layer-magicdns-resolve'
# Conflicts:
#	core/utils.go
#	main.go
2026-06-10 01:32:26 +08:00
nc 74618fff4c chore(forwarder): adjust log level 2026-06-10 01:30:04 +08:00
nc 35f92fa781 feat(forwarder): split forwarder to different file 2026-06-10 01:23:38 +08:00
nc 7c5904cc47 feat(config): add config validator to avoid wrong settings 2026-06-10 01:22:18 +08:00
iceBear67 3edddb406b fix: use system dns when tailscale resolver fails 2026-06-05 10:43:18 +08:00
nc 125bc4bf3d feat(utils): resolveAddr can resolve subnet ip at domain properly 2026-06-05 03:56:52 +08:00
nc 390946e0a2 fix(utils): normalizer cannot handle domain with dot
such as cm.any->cm.any.ts.net
2026-06-05 02:35:09 +08:00
iceBear67 ca03dce36a fix: use correct tailscale dns behaviour 2026-06-05 01:23:40 +08:00
nullcat 186e29663e chore(utils): remove deprecated code 2026-06-01 16:32:46 +08:00
nullcat 2c11609437 feat(tsnet): embedded web client only runs on diagnose flag is set 2026-06-01 16:31:27 +08:00
nullcat e60a6b76c7 feat(utils): implement MagicDNS suffix handling and normalization for dst_addr
- Added support for extracting and setting MagicDNS suffix.
- Normalized `dst_addr` using the MagicDNS suffix to simplify configuration.
- Improved logging for normalized and failed addresses during `connect` rule processing.
2026-06-01 16:07:23 +08:00
nullcat a9828b4461 fix(forwarder): potential error on udpSession 2026-06-01 15:25:14 +08:00
iceBear67 5204500d73 Merge remote-tracking branch 'origin/master' into sf 2026-05-31 15:48:07 +08:00
iceBear67 26aa088d58 add remote fetch support 2026-05-31 15:46:33 +08:00
nullcat 0a5fde7925 chore(forward): adjust log level 2026-05-30 17:27:47 +08:00
nullcat da17faa6dc fix(utils): adjust getPeerInfo position 2026-05-30 17:11:44 +08:00
nullcat bcbe8fb5e3 fix(tsnet): add timeout handling for tsnet server initialization 2026-05-30 17:10:47 +08:00
nullcat c853084a7b fix(utils): move ping logic after peer info lookup and deduplicate address retrieval logic 2026-05-29 14:56:17 +08:00
nullcat 4dde0942ce fix(utils): panic on ping logic 2026-05-29 14:31:32 +08:00
nullcat f97540b8d0 chore(utils): add remote name into ping logger 2026-05-25 15:12:31 +08:00
nullcat c23ca5025c fix(forward): udp relay not using tsnet server context 2026-05-25 00:07:01 +08:00
nullcat 7e8d005f58 feat(main): add -diagnose flag to control tsnet debug log 2026-05-25 00:04:49 +08:00
nullcat d12ad615cf feat(utils): add timeout on ping request 2026-05-24 23:38:46 +08:00
nullcat 56f37faa84 feat(main): add connectivityCheck for diagnostics 2026-05-18 15:04:48 +08:00
nullcat ab2addd893 fix(main): hostname not set 2026-05-18 04:25:30 +08:00
nullcat 15bda1a807 fix(main): node expired when system sleep too long 2026-05-18 04:04:11 +08:00
nullcat f0f9a23813 Initial commit 2026-05-17 18:56:39 +08:00