From 50fb7ad6cea69121a1a7f7363c60a63cd09f73c5 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Thu, 2 Feb 2023 09:18:33 +0100 Subject: [PATCH] Add TODOs for only sending patch updates Signed-off-by: Kristoffer Dalby --- api_common.go | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/api_common.go b/api_common.go index 374cc56b..86e98649 100644 --- a/api_common.go +++ b/api_common.go @@ -60,16 +60,39 @@ func (h *Headscale) generateMapResponse( now := time.Now() resp := tailcfg.MapResponse{ - KeepAlive: false, - Node: node, - Peers: nodePeers, - DNSConfig: dnsConfig, - Domain: h.cfg.BaseDomain, + KeepAlive: false, + Node: node, + + // TODO: Only send if updated + DERPMap: h.DERPMap, + + // TODO: Only send if updated + Peers: nodePeers, + + // TODO(kradalby): Implement: + // https://github.com/tailscale/tailscale/blob/main/tailcfg/tailcfg.go#L1351-L1374 + // PeersChanged + // PeersRemoved + // PeersChangedPatch + // PeerSeenChange + // OnlineChange + + // TODO: Only send if updated + DNSConfig: dnsConfig, + + // TODO: Only send if updated + Domain: h.cfg.BaseDomain, + + // TODO: Only send if updated PacketFilter: h.aclRules, - SSHPolicy: h.sshPolicy, - DERPMap: h.DERPMap, + UserProfiles: profiles, - ControlTime: &now, + + // TODO: Only send if updated + SSHPolicy: h.sshPolicy, + + ControlTime: &now, + Debug: &tailcfg.Debug{ DisableLogTail: !h.cfg.LogTail.Enabled, RandomizeClientPort: h.cfg.RandomizeClientPort,