Browse Source

:gear: Remove deprecated option, enhance default settings

mudler 2 years ago
parent
commit
ad0d66f6da
2 changed files with 3 additions and 22 deletions
  1. 2 15
      cmd/util.go
  2. 1 7
      pkg/config/config.go

+ 2 - 15
cmd/util.go

@@ -125,7 +125,7 @@ var CommonFlags []cli.Flag = []cli.Flag{
 		Name:   "max-connections",
 		Name:   "max-connections",
 		Usage:  "Max connections",
 		Usage:  "Max connections",
 		EnvVar: "EDGEVPNMAXCONNS",
 		EnvVar: "EDGEVPNMAXCONNS",
-		Value:  100,
+		Value:  0,
 	},
 	},
 	&cli.StringFlag{
 	&cli.StringFlag{
 		Name:   "ledger-state",
 		Name:   "ledger-state",
@@ -142,7 +142,7 @@ var CommonFlags []cli.Flag = []cli.Flag{
 		Usage:  "Automatically act as a relay if the node can accept inbound connections",
 		Usage:  "Automatically act as a relay if the node can accept inbound connections",
 		EnvVar: "EDGEVPNAUTORELAY",
 		EnvVar: "EDGEVPNAUTORELAY",
 	},
 	},
-	&cli.BoolTFlag{
+	&cli.BoolFlag{
 		Name:   "autorelay-v1",
 		Name:   "autorelay-v1",
 		Usage:  "Enable autorelay v1 circuits",
 		Usage:  "Enable autorelay v1 circuits",
 		EnvVar: "EDGEVPNAUTORELAYV1",
 		EnvVar: "EDGEVPNAUTORELAYV1",
@@ -182,17 +182,6 @@ var CommonFlags []cli.Flag = []cli.Flag{
 		Usage:  "Enable mplex multiplexer.",
 		Usage:  "Enable mplex multiplexer.",
 		EnvVar: "EDGEVPNMPLEX",
 		EnvVar: "EDGEVPNMPLEX",
 	},
 	},
-	&cli.BoolTFlag{
-		Name:   "low-profile-vpn",
-		Usage:  "Enable low profile on VPN",
-		EnvVar: "EDGEVPNLOWPROFILEVPN",
-	},
-	&cli.IntFlag{
-		Name:   "max-streams",
-		Usage:  "Number of concurrent streams",
-		Value:  100,
-		EnvVar: "EDGEVPNMAXSTREAMS",
-	},
 	&cli.IntFlag{
 	&cli.IntFlag{
 		Name:   "aliveness-healthcheck-interval",
 		Name:   "aliveness-healthcheck-interval",
 		Usage:  "Healthcheck interval",
 		Usage:  "Healthcheck interval",
@@ -385,7 +374,6 @@ func cliToOpts(c *cli.Context) ([]node.Option, []vpn.Option, *logger.Logger) {
 		Libp2pLogLevel:    c.String("libp2p-log-level"),
 		Libp2pLogLevel:    c.String("libp2p-log-level"),
 		LogLevel:          c.String("log-level"),
 		LogLevel:          c.String("log-level"),
 		LowProfile:        c.Bool("low-profile"),
 		LowProfile:        c.Bool("low-profile"),
-		VPNLowProfile:     c.Bool("low-profile-vpn"),
 		Blacklist:         c.StringSlice("blacklist"),
 		Blacklist:         c.StringSlice("blacklist"),
 		Concurrency:       c.Int("concurrency"),
 		Concurrency:       c.Int("concurrency"),
 		FrameTimeout:      c.String("timeout"),
 		FrameTimeout:      c.String("timeout"),
@@ -416,7 +404,6 @@ func cliToOpts(c *cli.Context) ([]node.Option, []vpn.Option, *logger.Logger) {
 			AutoRelay:                  c.Bool("autorelay"),
 			AutoRelay:                  c.Bool("autorelay"),
 			RelayV1:                    c.Bool("autorelay-v1"),
 			RelayV1:                    c.Bool("autorelay-v1"),
 			MaxConnections:             c.Int("max-connections"),
 			MaxConnections:             c.Int("max-connections"),
-			MaxStreams:                 c.Int("max-streams"),
 			HolePunch:                  c.Bool("holepunch"),
 			HolePunch:                  c.Bool("holepunch"),
 			Mplex:                      c.Bool("mplex-multiplexer"),
 			Mplex:                      c.Bool("mplex-multiplexer"),
 			StaticRelays:               c.StringSlice("autorelay-static-peer"),
 			StaticRelays:               c.StringSlice("autorelay-static-peer"),

+ 1 - 7
pkg/config/config.go

@@ -51,7 +51,7 @@ type Config struct {
 	Router                                     string
 	Router                                     string
 	Interface                                  string
 	Interface                                  string
 	Libp2pLogLevel, LogLevel                   string
 	Libp2pLogLevel, LogLevel                   string
-	LowProfile, VPNLowProfile, BootstrapIface  bool
+	LowProfile, BootstrapIface                 bool
 	Blacklist                                  []string
 	Blacklist                                  []string
 	Concurrency                                int
 	Concurrency                                int
 	FrameTimeout                               string
 	FrameTimeout                               string
@@ -115,7 +115,6 @@ type Connection struct {
 
 
 	Mplex          bool
 	Mplex          bool
 	MaxConnections int
 	MaxConnections int
-	MaxStreams     int
 }
 }
 
 
 // NAT is the structure relative to NAT configuration settings
 // NAT is the structure relative to NAT configuration settings
@@ -227,11 +226,6 @@ func (c Config) ToOpts(l *logger.Logger) ([]node.Option, []vpn.Option, error) {
 		vpn.WithPacketMTU(c.PacketMTU),
 		vpn.WithPacketMTU(c.PacketMTU),
 		vpn.WithRouterAddress(router),
 		vpn.WithRouterAddress(router),
 		vpn.WithInterfaceName(iface),
 		vpn.WithInterfaceName(iface),
-		vpn.WithMaxStreams(c.Connection.MaxStreams),
-	}
-
-	if c.VPNLowProfile {
-		vpnOpts = append(vpnOpts, vpn.LowProfile)
 	}
 	}
 
 
 	libp2pOpts := []libp2p.Option{libp2p.UserAgent("edgevpn")}
 	libp2pOpts := []libp2p.Option{libp2p.UserAgent("edgevpn")}