Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: remove all options that are marked as REMOVED #10310

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions cmd/ipfs/kubo/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const (
routingOptionAutoClientKwd = "autoclient"
unencryptTransportKwd = "disable-transport-encryption"
unrestrictedAPIAccessKwd = "unrestricted-api"
writableKwd = "writable"
enablePubSubKwd = "enable-pubsub-experiment"
enableIPNSPubSubKwd = "enable-namesys-pubsub"
enableMultiplexKwd = "enable-mplex-experiment"
Expand Down Expand Up @@ -164,7 +163,6 @@ Headers.
cmds.StringOption(initProfileOptionKwd, "Configuration profiles to apply for --init. See ipfs init --help for more"),
cmds.StringOption(routingOptionKwd, "Overrides the routing option").WithDefault(routingOptionDefaultKwd),
cmds.BoolOption(mountKwd, "Mounts IPFS to the filesystem using FUSE (experimental)"),
cmds.BoolOption(writableKwd, "Enable legacy Gateway.Writable (REMOVED)"),
cmds.StringOption(ipfsMountKwd, "Path to the mountpoint for IPFS (if using --mount). Defaults to config setting."),
cmds.StringOption(ipnsMountKwd, "Path to the mountpoint for IPNS (if using --mount). Defaults to config setting."),
cmds.BoolOption(unrestrictedAPIAccessKwd, "Allow API access to unlisted hashes"),
Expand Down Expand Up @@ -803,15 +801,6 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e
return nil, fmt.Errorf("serveHTTPGateway: GetConfig() failed: %s", err)
}

writable, writableOptionFound := req.Options[writableKwd].(bool)
if !writableOptionFound {
writable = cfg.Gateway.Writable.WithDefault(false)
}

if writable {
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")
}

listeners, err := sockets.TakeListeners("io.ipfs.gateway")
if err != nil {
return nil, fmt.Errorf("serveHTTPGateway: socket activation failed: %s", err)
Expand Down Expand Up @@ -876,10 +865,6 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e
opts = append(opts, corehttp.RedirectOption("", cfg.Gateway.RootRedirect))
}

if len(cfg.Gateway.PathPrefixes) > 0 {
log.Fatal("Support for custom Gateway.PathPrefixes was removed: https://github.com/ipfs/go-ipfs/issues/7702")
}

node, err := cctx.ConstructNode()
if err != nil {
return nil, fmt.Errorf("serveHTTPGateway: ConstructNode() failed: %s", err)
Expand Down
4 changes: 0 additions & 4 deletions config/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ type Discovery struct {

type MDNS struct {
Enabled bool

// DEPRECATED: the time between discovery rounds is no longer configurable
// See: https://github.com/ipfs/go-ipfs/pull/9048#discussion_r906814717
Interval *OptionalInteger `json:",omitempty"`
}
6 changes: 0 additions & 6 deletions config/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ type Gateway struct {
// should be redirected.
RootRedirect string

// REMOVED: modern replacement tracked in https://github.com/ipfs/specs/issues/375
Writable Flag `json:",omitempty"`

// PathPrefixes was removed: https://github.com/ipfs/go-ipfs/issues/7702
PathPrefixes []string

// NoFetch configures the gateway to _not_ fetch blocks in response to
// requests.
NoFetch bool
Expand Down
1 change: 0 additions & 1 deletion config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func InitWithIdentity(identity Identity) (*Config, error) {
Gateway: Gateway{
RootRedirect: "",
NoFetch: false,
PathPrefixes: []string{},
HTTPHeaders: map[string][]string{},
},
Reprovider: Reprovider{
Expand Down
24 changes: 0 additions & 24 deletions config/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,6 @@ type SwarmConfig struct {
// DisableNatPortMap turns off NAT port mapping (UPnP, etc.).
DisableNatPortMap bool

// DisableRelay explicitly disables the relay transport.
//
// Deprecated: This flag is deprecated and is overridden by
// `Swarm.Transports.Relay` if specified.
DisableRelay bool `json:",omitempty"`

// EnableRelayHop makes this node act as a public relay v1
//
// Deprecated: The circuit v1 protocol is deprecated.
// Use `Swarm.RelayService` to configure the circuit v2 relay.
EnableRelayHop bool `json:",omitempty"`

// EnableAutoRelay enables the "auto relay user" feature.
// Node will find and use advertised public relays when it determines that
// it's not reachable from the public internet.
//
// Deprecated: This flag is deprecated and is overridden by
// `Swarm.RelayClient.Enabled` if specified.
EnableAutoRelay bool `json:",omitempty"`

// RelayClient controls the client side of "auto relay" feature.
// When enabled, the node will use relays if it is not publicly reachable.
RelayClient RelayClient
Expand Down Expand Up @@ -112,8 +92,6 @@ type Transports struct {
Security struct {
// Defaults to 100.
TLS Priority `json:",omitempty"`
// Defaults to 200.
SECIO Priority `json:",omitempty"`
// Defaults to 300.
Noise Priority `json:",omitempty"`
}
Expand All @@ -123,8 +101,6 @@ type Transports struct {
Multiplexers struct {
// Defaults to 100.
Yamux Priority `json:",omitempty"`
// Defaults to -1.
Mplex Priority `json:",omitempty"`
}
}

Expand Down
18 changes: 0 additions & 18 deletions core/node/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,24 +122,6 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config, userResourceOverrides rcmgr.Part
}
}

// Force users to migrate old config.
// nolint
if cfg.Swarm.DisableRelay {
logger.Fatal("The 'Swarm.DisableRelay' config field was removed." +
"Use the 'Swarm.Transports.Network.Relay' instead.")
}
// nolint
if cfg.Swarm.EnableAutoRelay {
logger.Fatal("The 'Swarm.EnableAutoRelay' config field was removed." +
"Use the 'Swarm.RelayClient.Enabled' instead.")
}
// nolint
if cfg.Swarm.EnableRelayHop {
logger.Fatal("The `Swarm.EnableRelayHop` config field was removed.\n" +
"Use `Swarm.RelayService` to configure the circuit v2 relay.\n" +
"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)")
}

// Gather all the options
opts := fx.Options(
BaseLibP2P,
Expand Down
9 changes: 0 additions & 9 deletions core/node/libp2p/sec.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import (
tls "github.com/libp2p/go-libp2p/p2p/security/tls"
)

const secioEnabledWarning = `The SECIO security transport was enabled in the config but is no longer supported.

SECIO disabled by default in go-ipfs 0.7 removed in go-ipfs 0.9. Please remove
Swarm.Transports.Security.SECIO from your IPFS config.`

func Security(enabled bool, tptConfig config.Transports) interface{} {
if !enabled {
return func() (opts Libp2pOpts) {
Expand All @@ -23,10 +18,6 @@ func Security(enabled bool, tptConfig config.Transports) interface{} {
}
}

if _, enabled := tptConfig.Security.SECIO.WithDefault(config.Disabled); enabled {
log.Error(secioEnabledWarning)
}

// Using the new config options.
return func() (opts Libp2pOpts) {
opts.Opts = append(opts.Opts, prioritizeOptions([]priorityOption{{
Expand Down
3 changes: 0 additions & 3 deletions core/node/libp2p/smux.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ func makeSmuxTransportOption(tptConfig config.Transports) (libp2p.Option, error)
if prefs := os.Getenv("LIBP2P_MUX_PREFS"); prefs != "" {
return nil, fmt.Errorf("configuring muxers with LIBP2P_MUX_PREFS is no longer supported, use Swarm.Transports.Multiplexers")
}
if tptConfig.Multiplexers.Mplex != 0 {
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")
}
if tptConfig.Multiplexers.Yamux < 0 {
return nil, fmt.Errorf("running libp2p with Swarm.Transports.Multiplexers.Yamux disabled is not supported")
}
Expand Down
2 changes: 1 addition & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,7 @@ Type: `priority`

#### `Swarm.Transports.Security.SECIO`

Support for SECIO has been removed. Please remove this option from your config.
**REMOVED**: support for SECIO has been removed. Please remove this option from your config.

#### `Swarm.Transports.Security.Noise`

Expand Down
Loading