From e1d9300fc5e48b2089e3e4ed7bb5cd2bcc45d3df Mon Sep 17 00:00:00 2001 From: rkonfj Date: Sat, 1 Jun 2024 11:38:41 +0800 Subject: [PATCH] disco: better default parameters for disco --- cmd/pgcli/vpn/vpn.go | 4 ++-- disco/disco.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/pgcli/vpn/vpn.go b/cmd/pgcli/vpn/vpn.go index 097675c..fe6079d 100644 --- a/cmd/pgcli/vpn/vpn.go +++ b/cmd/pgcli/vpn/vpn.go @@ -52,8 +52,8 @@ func init() { Cmd.Flags().StringSlice("allowed-ip", []string{}, "declare IPs that can be routed/NATed by this machine (i.e. 192.168.0.0/24)") Cmd.Flags().StringSlice("peer", []string{}, "specify peers instead of auto-discovery (pg://?alias1=&alias2=)") - Cmd.Flags().Int("disco-port-scan-offset", -500, "scan ports offset when disco") - Cmd.Flags().Int("disco-port-scan-count", 2000, "scan ports count when disco") + Cmd.Flags().Int("disco-port-scan-offset", -1000, "scan ports offset when disco") + Cmd.Flags().Int("disco-port-scan-count", 3000, "scan ports count when disco") Cmd.Flags().Int("disco-challenges-retry", 5, "ping challenges retry count when disco") Cmd.Flags().Duration("disco-challenges-initial-interval", 200*time.Millisecond, "ping challenges initial interval when disco") Cmd.Flags().Float64("disco-challenges-backoff-rate", 1.65, "ping challenges backoff rate when disco") diff --git a/disco/disco.go b/disco/disco.go index e10a2ad..eeca965 100644 --- a/disco/disco.go +++ b/disco/disco.go @@ -18,8 +18,8 @@ var ( ) var defaultDiscoConfig = DiscoConfig{ - PortScanOffset: -500, - PortScanCount: 2000, + PortScanOffset: -1000, + PortScanCount: 3000, ChallengesRetry: 5, ChallengesInitialInterval: 200 * time.Millisecond, ChallengesBackoffRate: 1.65,