From 82c1bfa0e6f57d7c5e4e74eefb4d834274ce817f Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 23 Nov 2021 20:46:00 +0100 Subject: [PATCH] feat: hard deprecation of IPFS_REUSEPORT Years passed and we still see it. Time to force users to switch to LIBP2P_TCP_REUSEPORT. --- cmd/ipfs/daemon.go | 6 ++++++ docs/environment-variables.md | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index c2cefbafe..f827d76cd 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -559,6 +559,12 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment log.Error("failed to bootstrap (no peers found): consider updating Bootstrap or Peering section of your config") } }) + + } + + // Hard deprecation notice if someone still uses IPFS_REUSEPORT + if flag := os.Getenv("IPFS_REUSEPORT"); flag != "" { + log.Fatal("Support for IPFS_REUSEPORT was removed. Use LIBP2P_TCP_REUSEPORT instead.") } // collect long-running errors and block for shutdown diff --git a/docs/environment-variables.md b/docs/environment-variables.md index 78f3d4d5c..174e283f9 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -1,13 +1,11 @@ # go-ipfs environment variables -## `LIBP2P_TCP_REUSEPORT` (`IPFS_REUSEPORT`) +## `LIBP2P_TCP_REUSEPORT` go-ipfs tries to reuse the same source port for all connections to improve NAT traversal. If this is an issue, you can disable it by setting `LIBP2P_TCP_REUSEPORT` to false. -This variable was previously `IPFS_REUSEPORT`. - Default: true ## `IPFS_PATH`