config: remove all options that are marked as REMOVED
Most of the removed options are many years old. In addition, they've all been removed in past iterations of Kubo. Some options were marked as removed in the config.md, but we still had a warning in the code to let users know they have been removed. I think it's been long enough for all of this options, and enough Kubo iterations in order to alert the users. It is good to keep it in the config.md for now so that people can actually check. However, I think it's time to remove them from the code itself.
Henrique Dias committed
Jan 19, 2024 at 11:20 UTC
d1db95c447490d3e4ec56416a3718d8917f02b81
9 files changed
+1
-81
cmd/ipfs/kubo/daemon.go
-15
@@ -68,7 +68,6 @@ const (
68
routingOptionAutoClientKwd = "autoclient"
69
unencryptTransportKwd = "disable-transport-encryption"
70
unrestrictedAPIAccessKwd = "unrestricted-api"
71
- writableKwd = "writable"
71
enablePubSubKwd = "enable-pubsub-experiment"
72
enableIPNSPubSubKwd = "enable-namesys-pubsub"
73
enableMultiplexKwd = "enable-mplex-experiment"
@@ -164,7 +163,6 @@ Headers.
163
cmds.StringOption(initProfileOptionKwd, "Configuration profiles to apply for --init. See ipfs init --help for more"),
164
cmds.StringOption(routingOptionKwd, "Overrides the routing option").WithDefault(routingOptionDefaultKwd),
165
cmds.BoolOption(mountKwd, "Mounts IPFS to the filesystem using FUSE (experimental)"),
167
- cmds.BoolOption(writableKwd, "Enable legacy Gateway.Writable (REMOVED)"),
166
cmds.StringOption(ipfsMountKwd, "Path to the mountpoint for IPFS (if using --mount). Defaults to config setting."),
167
cmds.StringOption(ipnsMountKwd, "Path to the mountpoint for IPNS (if using --mount). Defaults to config setting."),
168
cmds.BoolOption(unrestrictedAPIAccessKwd, "Allow API access to unlisted hashes"),
@@ -803,15 +801,6 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e
801
return nil, fmt.Errorf("serveHTTPGateway: GetConfig() failed: %s", err)
802
}
803
806
- writable, writableOptionFound := req.Options[writableKwd].(bool)
807
- if !writableOptionFound {
808
- writable = cfg.Gateway.Writable.WithDefault(false)
809
- }
810
-
811
- if writable {
812
- log.Fatalf("Support for Gateway.Writable and --writable has been REMOVED. Please remove it from your config file or CLI. Modern replacement tracked in https://github.com/ipfs/specs/issues/375")
813
- }
814
-
804
listeners, err := sockets.TakeListeners("io.ipfs.gateway")
805
if err != nil {
806
return nil, fmt.Errorf("serveHTTPGateway: socket activation failed: %s", err)
@@ -876,10 +865,6 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e
865
opts = append(opts, corehttp.RedirectOption("", cfg.Gateway.RootRedirect))
866
}
867
879
- if len(cfg.Gateway.PathPrefixes) > 0 {
880
- log.Fatal("Support for custom Gateway.PathPrefixes was removed: https://github.com/ipfs/go-ipfs/issues/7702")
881
- }
882
-
868
node, err := cctx.ConstructNode()
869
if err != nil {
870
return nil, fmt.Errorf("serveHTTPGateway: ConstructNode() failed: %s", err)
config/discovery.go
-4
@@ -6,8 +6,4 @@ type Discovery struct {
6
7
type MDNS struct {
8
Enabled bool
9
-
10
- // DEPRECATED: the time between discovery rounds is no longer configurable
11
- // See: https://github.com/ipfs/go-ipfs/pull/9048#discussion_r906814717
12
- Interval *OptionalInteger `json:",omitempty"`
9
}
config/gateway.go
-6
@@ -47,12 +47,6 @@ type Gateway struct {
47
// should be redirected.
48
RootRedirect string
49
50
- // REMOVED: modern replacement tracked in https://github.com/ipfs/specs/issues/375
51
- Writable Flag `json:",omitempty"`
52
-
53
- // PathPrefixes was removed: https://github.com/ipfs/go-ipfs/issues/7702
54
- PathPrefixes []string
55
-
50
// NoFetch configures the gateway to _not_ fetch blocks in response to
51
// requests.
52
NoFetch bool
config/init.go
-1
@@ -66,7 +66,6 @@ func InitWithIdentity(identity Identity) (*Config, error) {
66
Gateway: Gateway{
67
RootRedirect: "",
68
NoFetch: false,
69
- PathPrefixes: []string{},
69
HTTPHeaders: map[string][]string{},
70
},
71
Reprovider: Reprovider{
config/swarm.go
-24
@@ -13,26 +13,6 @@ type SwarmConfig struct {
13
// DisableNatPortMap turns off NAT port mapping (UPnP, etc.).
14
DisableNatPortMap bool
15
16
- // DisableRelay explicitly disables the relay transport.
17
- //
18
- // Deprecated: This flag is deprecated and is overridden by
19
- // `Swarm.Transports.Relay` if specified.
20
- DisableRelay bool `json:",omitempty"`
21
-
22
- // EnableRelayHop makes this node act as a public relay v1
23
- //
24
- // Deprecated: The circuit v1 protocol is deprecated.
25
- // Use `Swarm.RelayService` to configure the circuit v2 relay.
26
- EnableRelayHop bool `json:",omitempty"`
27
-
28
- // EnableAutoRelay enables the "auto relay user" feature.
29
- // Node will find and use advertised public relays when it determines that
30
- // it's not reachable from the public internet.
31
- //
32
- // Deprecated: This flag is deprecated and is overridden by
33
- // `Swarm.RelayClient.Enabled` if specified.
34
- EnableAutoRelay bool `json:",omitempty"`
35
-
16
// RelayClient controls the client side of "auto relay" feature.
17
// When enabled, the node will use relays if it is not publicly reachable.
18
RelayClient RelayClient
@@ -112,8 +92,6 @@ type Transports struct {
92
Security struct {
93
// Defaults to 100.
94
TLS Priority `json:",omitempty"`
115
- // Defaults to 200.
116
- SECIO Priority `json:",omitempty"`
95
// Defaults to 300.
96
Noise Priority `json:",omitempty"`
97
}
@@ -123,8 +101,6 @@ type Transports struct {
101
Multiplexers struct {
102
// Defaults to 100.
103
Yamux Priority `json:",omitempty"`
126
- // Defaults to -1.
127
- Mplex Priority `json:",omitempty"`
104
}
105
}
106
core/node/groups.go
-18
@@ -122,24 +122,6 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config, userResourceOverrides rcmgr.Part
122
}
123
}
124
125
- // Force users to migrate old config.
126
- // nolint
127
- if cfg.Swarm.DisableRelay {
128
- logger.Fatal("The 'Swarm.DisableRelay' config field was removed." +
129
- "Use the 'Swarm.Transports.Network.Relay' instead.")
130
- }
131
- // nolint
132
- if cfg.Swarm.EnableAutoRelay {
133
- logger.Fatal("The 'Swarm.EnableAutoRelay' config field was removed." +
134
- "Use the 'Swarm.RelayClient.Enabled' instead.")
135
- }
136
- // nolint
137
- if cfg.Swarm.EnableRelayHop {
138
- logger.Fatal("The `Swarm.EnableRelayHop` config field was removed.\n" +
139
- "Use `Swarm.RelayService` to configure the circuit v2 relay.\n" +
140
- "If you want to continue running a circuit v1 relay, please use the standalone relay daemon: https://dist.ipfs.tech/#libp2p-relay-daemon (with RelayV1.Enabled: true)")
141
- }
142
-
125
// Gather all the options
126
opts := fx.Options(
127
BaseLibP2P,
core/node/libp2p/sec.go
-9
@@ -8,11 +8,6 @@ import (
8
tls "github.com/libp2p/go-libp2p/p2p/security/tls"
9
)
10
11
-const secioEnabledWarning = `The SECIO security transport was enabled in the config but is no longer supported.
12
-
13
-SECIO disabled by default in go-ipfs 0.7 removed in go-ipfs 0.9. Please remove
14
-Swarm.Transports.Security.SECIO from your IPFS config.`
15
-
11
func Security(enabled bool, tptConfig config.Transports) interface{} {
12
if !enabled {
13
return func() (opts Libp2pOpts) {
@@ -23,10 +18,6 @@ func Security(enabled bool, tptConfig config.Transports) interface{} {
18
}
19
}
20
26
- if _, enabled := tptConfig.Security.SECIO.WithDefault(config.Disabled); enabled {
27
- log.Error(secioEnabledWarning)
28
- }
29
-
21
// Using the new config options.
22
return func() (opts Libp2pOpts) {
23
opts.Opts = append(opts.Opts, prioritizeOptions([]priorityOption{{
core/node/libp2p/smux.go
-3
@@ -14,9 +14,6 @@ func makeSmuxTransportOption(tptConfig config.Transports) (libp2p.Option, error)
14
if prefs := os.Getenv("LIBP2P_MUX_PREFS"); prefs != "" {
15
return nil, fmt.Errorf("configuring muxers with LIBP2P_MUX_PREFS is no longer supported, use Swarm.Transports.Multiplexers")
16
}
17
- if tptConfig.Multiplexers.Mplex != 0 {
18
- return nil, fmt.Errorf("Swarm.Transports.Multiplexers.Mplex is no longer supported, remove it from your config, see https://github.com/libp2p/specs/issues/553")
19
- }
17
if tptConfig.Multiplexers.Yamux < 0 {
18
return nil, fmt.Errorf("running libp2p with Swarm.Transports.Multiplexers.Yamux disabled is not supported")
19
}
docs/config.md
+1
-1
@@ -2222,7 +2222,7 @@ Type: `priority`
2222
2223
#### `Swarm.Transports.Security.SECIO`
2224
2225
-Support for SECIO has been removed. Please remove this option from your config.
2225
+**REMOVED**: support for SECIO has been removed. Please remove this option from your config.
2226
2227
#### `Swarm.Transports.Security.Noise`
2228