Skip to content

Commit

Permalink
⬇️ Revert libp2p bump
Browse files Browse the repository at this point in the history
Also reverts rcmgr configurations

See #12
  • Loading branch information
mudler committed Mar 17, 2022
1 parent 74f4632 commit abfb214
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 446 deletions.
5 changes: 0 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ builds:
- arm
- 386
- arm64
ignore:
- goos: darwin
goarch: arm64
- goos: darwin
goarch: amd64
source:
enabled: true
name_template: '{{ .ProjectName }}-{{ .Tag }}-source'
Expand Down
121 changes: 1 addition & 120 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,100 +189,7 @@ var CommonFlags []cli.Flag = []cli.Flag{
Name: "token",
Usage: "Specify an edgevpn token in place of a config file",
EnvVar: "EDGEVPNTOKEN",
},
&cli.StringFlag{
Name: "limit-file",
Usage: "Specify an limit config (json)",
EnvVar: "LIMITFILE",
},
&cli.StringFlag{
Name: "limit-scope",
Usage: "Specify a limit scope",
EnvVar: "LIMITSCOPE",
Value: "system",
},
&cli.BoolFlag{
Name: "limit-config",
Usage: "Enable inline resource limit configuration",
EnvVar: "LIMITCONFIG",
},
&cli.BoolFlag{
Name: "limit-disable",
Usage: "Disable resource limit",
EnvVar: "LIMITDISABLE",
},
&cli.BoolFlag{
Name: "limit-config-dynamic",
Usage: "Enable dynamic resource limit configuration",
EnvVar: "LIMITCONFIGDYNAMIC",
},
&cli.Int64Flag{
Name: "limit-config-memory",
Usage: "Memory resource limit configuration",
EnvVar: "LIMITCONFIGMEMORY",
Value: 128,
},
&cli.Float64Flag{
Name: "limit-config-memory-fraction",
Usage: "Fraction memory resource limit configuration (dynamic)",
EnvVar: "LIMITCONFIGMEMORYFRACTION",
Value: 10,
},
&cli.Int64Flag{
Name: "limit-config-min-memory",
Usage: "Minimum memory resource limit configuration (dynamic)",
EnvVar: "LIMITCONFIGMINMEMORY",
Value: 10,
},
&cli.Int64Flag{
Name: "limit-config-max-memory",
Usage: "Maximum memory resource limit configuration (dynamic)",
EnvVar: "LIMITCONFIGMAXMEMORY",
Value: 200,
},
&cli.IntFlag{
Name: "limit-config-streams",
Usage: "Streams resource limit configuration",
EnvVar: "LIMITCONFIGSTREAMS",
Value: 200,
},
&cli.IntFlag{
Name: "limit-config-streams-inbound",
Usage: "Inbound streams resource limit configuration",
EnvVar: "LIMITCONFIGSTREAMSINBOUND",
Value: 30,
},
&cli.IntFlag{
Name: "limit-config-streams-outbound",
Usage: "Outbound streams resource limit configuration",
EnvVar: "LIMITCONFIGSTREAMSOUTBOUND",
Value: 30,
},
&cli.IntFlag{
Name: "limit-config-conn",
Usage: "Connections resource limit configuration",
EnvVar: "LIMITCONFIGCONNS",
Value: 200,
},
&cli.IntFlag{
Name: "limit-config-conn-inbound",
Usage: "Inbound connections resource limit configuration",
EnvVar: "LIMITCONFIGCONNSINBOUND",
Value: 30,
},
&cli.IntFlag{
Name: "limit-config-conn-outbound",
Usage: "Outbound connections resource limit configuration",
EnvVar: "LIMITCONFIGCONNSOUTBOUND",
Value: 30,
},
&cli.IntFlag{
Name: "limit-config-fd",
Usage: "Max fd resource limit configuration",
EnvVar: "LIMITCONFIGFD",
Value: 30,
},
}
}}

func displayStart(ll *logger.Logger) {
ll.Info(Copyright)
Expand All @@ -291,26 +198,6 @@ func displayStart(ll *logger.Logger) {
}

func cliToOpts(c *cli.Context) ([]node.Option, []vpn.Option, *logger.Logger) {

var limitConfig *node.NetLimitConfig

if c.Bool("limit-config") {
limitConfig = &node.NetLimitConfig{
Dynamic: c.Bool("limit-config-dynamic"),
Memory: c.Int64("limit-config-memory"),
MinMemory: c.Int64("limit-config-min-memory"),
MaxMemory: c.Int64("limit-config-max-memory"),
MemoryFraction: c.Float64("limit-config-memory-fraction"),
Streams: c.Int("limit-config-streams"),
StreamsInbound: c.Int("limit-config-streams-inbound"),
StreamsOutbound: c.Int("limit-config-streams-outbound"),
Conns: c.Int("limit-config-conn"),
ConnsInbound: c.Int("limit-config-conn-inbound"),
ConnsOutbound: c.Int("limit-config-conn-outbound"),
FD: c.Int("limit-config-fd"),
}
}

nc := nodeConfig.Config{
NetworkConfig: c.String("config"),
NetworkToken: c.String("token"),
Expand Down Expand Up @@ -352,12 +239,6 @@ func cliToOpts(c *cli.Context) ([]node.Option, []vpn.Option, *logger.Logger) {
MaxStreams: c.Int("max-streams"),
HolePunch: c.Bool("holepunch"),
},
Limit: config.ResourceLimit{
Disable: c.Bool("limit-disable"),
FileLimit: c.String("limit-file"),
Scope: c.String("limit-scope"),
LimitConfig: limitConfig,
},
}

lvl, err := log.LevelFromString(nc.LogLevel)
Expand Down
43 changes: 20 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,54 @@ module github.com/mudler/edgevpn
go 1.16

require (
github.com/benbjohnson/clock v1.3.0
github.com/benbjohnson/clock v1.1.0
github.com/c-robinson/iplib v1.0.3
github.com/containerd/cgroups v1.0.3 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/elastic/gosigar v0.14.2 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/godbus/dbus/v5 v5.0.6 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/gookit/color v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/golang-lru v0.5.4
github.com/ipfs/go-cid v0.1.0 // indirect
github.com/ipfs/go-datastore v0.5.1 // indirect
github.com/ipfs/go-log v1.0.5
github.com/ipfs/go-log/v2 v2.5.0
github.com/ipld/go-ipld-prime v0.14.4 // indirect
github.com/klauspost/compress v1.14.2 // indirect
github.com/klauspost/cpuid/v2 v2.0.10 // indirect
github.com/labstack/echo/v4 v4.6.3
github.com/libp2p/go-libp2p v0.18.0-rc6
github.com/libp2p/go-libp2p-connmgr v0.3.1
github.com/libp2p/go-libp2p-core v0.14.0
github.com/ipfs/go-log/v2 v2.4.0
github.com/ipld/go-ipld-prime v0.14.3 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/labstack/echo/v4 v4.6.1
github.com/labstack/gommon v0.3.1 // indirect
github.com/libp2p/go-libp2p v0.17.0
github.com/libp2p/go-libp2p-connmgr v0.2.4
github.com/libp2p/go-libp2p-core v0.13.0
github.com/libp2p/go-libp2p-discovery v0.6.0
github.com/libp2p/go-libp2p-kad-dht v0.15.0
github.com/libp2p/go-libp2p-pubsub v0.6.1
github.com/libp2p/go-libp2p-resource-manager v0.1.5
github.com/libp2p/go-libp2p-pubsub v0.6.0
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/miekg/dns v1.1.45
github.com/mudler/go-isterminal v0.0.0-20211031135732-5e4e06fc5a58
github.com/mudler/go-processmanager v0.0.0-20211226182900-899fbb0b97f6
github.com/multiformats/go-base32 v0.0.4 // indirect
github.com/multiformats/go-multiaddr v0.5.0
github.com/multiformats/go-multiaddr v0.4.1
github.com/multiformats/go-multicodec v0.4.0 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/ginkgo/v2 v2.1.1
github.com/onsi/gomega v1.17.0
github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/pterm/pterm v0.12.36
github.com/prometheus/common v0.32.1 // indirect
github.com/pterm/pterm v0.12.33
github.com/songgao/packets v0.0.0-20160404182456-549a10cd4091
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8
github.com/urfave/cli v1.22.5
github.com/vishvananda/netlink v1.1.0
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect
github.com/xlzd/gotp v0.0.0-20220110052318-fab697c03c2c
go.uber.org/zap v1.20.0 // indirect
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect
golang.org/x/tools v0.1.9 // indirect
github.com/xlzd/gotp v0.0.0-20181030022105-c8557ba2c119
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/tools v0.1.8 // indirect
gopkg.in/yaml.v2 v2.4.0
lukechampine.com/blake3 v1.1.7 // indirect
)
Loading

0 comments on commit abfb214

Please sign in to comment.