Skip to content

Commit

Permalink
Merge pull request #9395 from ipfs/release-v0.17.0
Browse files Browse the repository at this point in the history
release v0.17.0
  • Loading branch information
galargh authored Nov 22, 2022
2 parents 38117db + d007b2a commit 4485d6b
Show file tree
Hide file tree
Showing 103 changed files with 2,035 additions and 1,827 deletions.
6 changes: 3 additions & 3 deletions .circleci/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ default_environment: &default_environment
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
GIT_PAGER: cat
IPFS_CHECK_RCMGR_DEFAULTS: 1

executors:
golang:
Expand Down Expand Up @@ -160,7 +159,7 @@ jobs:
tar xfz go1.19.1.linux-amd64.tar.gz
echo "export PATH=$(pwd)/go/bin:\$PATH" >> ~/.bashrc
- run: go version
- run: sudo apt install socat net-tools
- run: sudo apt install socat net-tools fish
- checkout

- run:
Expand Down Expand Up @@ -225,7 +224,7 @@ jobs:
docker:
- image: cimg/go:1.19.1-node
parallelism: 4
resource_class: large
resource_class: 2xlarge+
steps:
- *make_out_dirs
- attach_workspace:
Expand Down Expand Up @@ -325,6 +324,7 @@ jobs:
- ~/.cache/go-build/
ipfs-webui:
executor: node-browsers
resource_class: 2xlarge+
steps:
- *make_out_dirs
- attach_workspace:
Expand Down
68 changes: 0 additions & 68 deletions .github/config.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linters:
enable:
- stylecheck
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## What is Kubo?

Kubo was the first is the most widely used IPFS implementation today. Implementing the *Interplanetary Filesystem* - the Web3 standard and contender to replace https. Thus powered by IPLD's data models and the libp2p for network communication. Kubo is written in Go.
Kubo was the first IPFS implementation and is the most widely used one today. Implementing the *Interplanetary Filesystem* - the Web3 standard and contender to replace https. Thus powered by IPLD's data models and the libp2p for network communication. Kubo is written in Go.

Featureset
- Runs an IPFS-Node as a network service
Expand Down Expand Up @@ -274,11 +274,11 @@ PS> choco install go-ipfs

#### Scoop

Scoop provides kubo as `go-ipfs` in its 'extras' bucket.
Scoop provides kubo as `kubo` in its 'extras' bucket.

```Powershell
PS> scoop bucket add extras
PS> scoop install go-ipfs
PS> scoop install kubo
```

### Unofficial macOS packages
Expand Down
6 changes: 3 additions & 3 deletions cmd/ipfs/add_migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func addMigrations(ctx context.Context, node *core.IpfsNode, fetcher migrations.
}
}
default:
return errors.New("Cannot get migrations from unknown fetcher type")
return errors.New("cannot get migrations from unknown fetcher type")
}
}

Expand Down Expand Up @@ -118,9 +118,9 @@ func addMigrationPaths(ctx context.Context, node *core.IpfsNode, peerInfo peer.A
fmt.Printf("connected to migration peer %q\n", peerInfo)

if pin {
pinApi := ipfs.Pin()
pinAPI := ipfs.Pin()
for _, ipfsPath := range paths {
err := pinApi.Add(ctx, ipfsPath)
err := pinAPI.Add(ctx, ipfsPath)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const (
routingOptionCustomKwd = "custom"
routingOptionDefaultKwd = "default"
unencryptTransportKwd = "disable-transport-encryption"
unrestrictedApiAccessKwd = "unrestricted-api"
unrestrictedAPIAccessKwd = "unrestricted-api"
writableKwd = "writable"
enablePubSubKwd = "enable-pubsub-experiment"
enableIPNSPubSubKwd = "enable-namesys-pubsub"
Expand Down Expand Up @@ -174,7 +174,7 @@ Headers.
cmds.BoolOption(writableKwd, "Enable writing objects (with POST, PUT and DELETE)"),
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"),
cmds.BoolOption(unrestrictedAPIAccessKwd, "Allow API access to unlisted hashes"),
cmds.BoolOption(unencryptTransportKwd, "Disable transport encryption (for debugging protocols)"),
cmds.BoolOption(enableGCKwd, "Enable automatic periodic repo garbage collection"),
cmds.BoolOption(adjustFDLimitKwd, "Check and raise file descriptor limits if needed").WithDefault(true),
Expand Down Expand Up @@ -654,7 +654,7 @@ func serveHTTPApi(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, error
// because this would open up the api to scripting vulnerabilities.
// only the webui objects are allowed.
// if you know what you're doing, go ahead and pass --unrestricted-api.
unrestricted, _ := req.Options[unrestrictedApiAccessKwd].(bool)
unrestricted, _ := req.Options[unrestrictedAPIAccessKwd].(bool)
gatewayOpt := corehttp.GatewayOption(false, corehttp.WebUIPaths...)
if unrestricted {
gatewayOpt = corehttp.GatewayOption(true, "/ipfs", "/ipns")
Expand Down
3 changes: 2 additions & 1 deletion cmd/ipfs/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ const (
profileOptionName = "profile"
)

// nolint
var errRepoExists = errors.New(`ipfs configuration file already exists!
Reinitializing would overwrite your keys.
Reinitializing would overwrite your keys
`)

var initCmd = &cmds.Command{
Expand Down
2 changes: 1 addition & 1 deletion cmd/ipfs/ipfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
cmds "github.com/ipfs/go-ipfs-cmds"
)

// This is the CLI root, used for executing commands accessible to CLI clients.
// Root is the CLI root, used for executing commands accessible to CLI clients.
// Some subcommands (like 'ipfs daemon' or 'ipfs init') are only accessible here,
// and can't be called through the HTTP API.
var Root = &cmds.Command{
Expand Down
12 changes: 6 additions & 6 deletions cmd/ipfs/pinmfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestPinMFSRootNodeError(t *testing.T) {
}

func TestPinMFSService(t *testing.T) {
cfg_invalid_interval := &config.Config{
cfgInvalidInterval := &config.Config{
Pinning: config.Pinning{
RemoteServices: map[string]config.RemotePinningService{
"disabled": {
Expand All @@ -119,7 +119,7 @@ func TestPinMFSService(t *testing.T) {
},
},
}
cfg_valid_unnamed := &config.Config{
cfgValidUnnamed := &config.Config{
Pinning: config.Pinning{
RemoteServices: map[string]config.RemotePinningService{
"valid_unnamed": {
Expand All @@ -134,7 +134,7 @@ func TestPinMFSService(t *testing.T) {
},
},
}
cfg_valid_named := &config.Config{
cfgValidNamed := &config.Config{
Pinning: config.Pinning{
RemoteServices: map[string]config.RemotePinningService{
"valid_named": {
Expand All @@ -149,9 +149,9 @@ func TestPinMFSService(t *testing.T) {
},
},
}
testPinMFSServiceWithError(t, cfg_invalid_interval, "remote pinning service \"invalid_interval\" has invalid MFS.RepinInterval")
testPinMFSServiceWithError(t, cfg_valid_unnamed, "error while listing remote pins: empty response from remote pinning service")
testPinMFSServiceWithError(t, cfg_valid_named, "error while listing remote pins: empty response from remote pinning service")
testPinMFSServiceWithError(t, cfgInvalidInterval, "remote pinning service \"invalid_interval\" has invalid MFS.RepinInterval")
testPinMFSServiceWithError(t, cfgValidUnnamed, "error while listing remote pins: empty response from remote pinning service")
testPinMFSServiceWithError(t, cfgValidNamed, "error while listing remote pins: empty response from remote pinning service")
}

func testPinMFSServiceWithError(t *testing.T, cfg *config.Config, expectedErrorPrefix string) {
Expand Down
2 changes: 1 addition & 1 deletion config/experiments.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type Experiments struct {
ShardingEnabled bool `json:",omitempty"` // deprecated by autosharding: https://github.com/ipfs/kubo/pull/8527
GraphsyncEnabled bool
Libp2pStreamMounting bool
P2pHttpProxy bool
P2pHttpProxy bool //nolint
StrategicProviding bool
AcceleratedDHTClient bool
}
7 changes: 7 additions & 0 deletions config/gateway.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package config

const DefaultInlineDNSLink = false

type GatewaySpec struct {
// Paths is explicit list of path prefixes that should be handled by
// this gateway. Example: `["/ipfs", "/ipns", "/api"]`
Expand All @@ -18,6 +20,11 @@ type GatewaySpec struct {
// NoDNSLink configures this gateway to _not_ resolve DNSLink for the FQDN
// provided in `Host` HTTP header.
NoDNSLink bool

// InlineDNSLink configures this gateway to always inline DNSLink names
// (FQDN) into a single DNS label in order to interop with wildcard TLS certs
// and Origin per CID isolation provided by rules like https://publicsuffix.org
InlineDNSLink Flag
}

// Gateway contains options for the HTTP gateway server.
Expand Down
12 changes: 4 additions & 8 deletions config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ func InitWithIdentity(identity Identity) (*Config, error) {
Interval: "12h",
Strategy: "all",
},
Swarm: SwarmConfig{
ConnMgr: ConnMgr{
LowWater: DefaultConnMgrLowWater,
HighWater: DefaultConnMgrHighWater,
GracePeriod: DefaultConnMgrGracePeriod.String(),
Type: "basic",
},
},
Pinning: Pinning{
RemoteServices: map[string]RemotePinningService{},
},
Expand Down Expand Up @@ -114,6 +106,10 @@ const DefaultConnMgrLowWater = 600
// grace period
const DefaultConnMgrGracePeriod = time.Second * 20

// DefaultConnMgrType is the default value for the connection managers
// type.
const DefaultConnMgrType = "basic"

func addressesConfig() Addresses {
return Addresses{
Swarm: []string{
Expand Down
1 change: 1 addition & 0 deletions config/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ type InternalBitswap struct {
EngineBlockstoreWorkerCount OptionalInteger
EngineTaskWorkerCount OptionalInteger
MaxOutstandingBytesPerPeer OptionalInteger
ProviderSearchDelay OptionalDuration
}
10 changes: 7 additions & 3 deletions config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,13 @@ fetching may be degraded.
c.AutoNAT.ServiceMode = AutoNATServiceDisabled
c.Reprovider.Interval = "0"

c.Swarm.ConnMgr.LowWater = 20
c.Swarm.ConnMgr.HighWater = 40
c.Swarm.ConnMgr.GracePeriod = time.Minute.String()
lowWater := int64(20)
highWater := int64(40)
gracePeriod := time.Minute
c.Swarm.ConnMgr.Type = NewOptionalString("basic")
c.Swarm.ConnMgr.LowWater = &OptionalInteger{value: &lowWater}
c.Swarm.ConnMgr.HighWater = &OptionalInteger{value: &highWater}
c.Swarm.ConnMgr.GracePeriod = &OptionalDuration{&gracePeriod}
return nil
},
},
Expand Down
12 changes: 8 additions & 4 deletions config/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ type Transports struct {

// ConnMgr defines configuration options for the libp2p connection manager
type ConnMgr struct {
Type string
LowWater int
HighWater int
GracePeriod string
Type *OptionalString `json:",omitempty"`
LowWater *OptionalInteger `json:",omitempty"`
HighWater *OptionalInteger `json:",omitempty"`
GracePeriod *OptionalDuration `json:",omitempty"`
}

// ResourceMgr defines configuration options for the libp2p Network Resource Manager
Expand All @@ -143,6 +143,10 @@ type ResourceMgr struct {
// Enables the Network Resource Manager feature, default to on.
Enabled Flag `json:",omitempty"`
Limits *rcmgr.LimitConfig `json:",omitempty"`

MaxMemory *OptionalString `json:",omitempty"`
MaxFileDescriptors *OptionalInteger `json:",omitempty"`

// A list of multiaddrs that can bypass normal system limits (but are still
// limited by the allowlist scope). Convenience config around
// https://pkg.go.dev/github.com/libp2p/go-libp2p/p2p/host/resource-manager#Allowlist.Add
Expand Down
3 changes: 1 addition & 2 deletions core/commands/cid.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
verifcid "github.com/ipfs/go-verifcid"
ipldmulticodec "github.com/ipld/go-ipld-prime/multicodec"
mbase "github.com/multiformats/go-multibase"
"github.com/multiformats/go-multicodec"
mc "github.com/multiformats/go-multicodec"
mhash "github.com/multiformats/go-multihash"
)
Expand Down Expand Up @@ -71,7 +70,7 @@ The optional format string is a printf style format string:
opts.fmtStr = fmtStr

if codecStr != "" {
var codec multicodec.Code
var codec mc.Code
err := codec.Set(codecStr)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion core/commands/cmdenv/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func GetNode(env interface{}) (*core.IpfsNode, error) {
}

// GetApi extracts CoreAPI instance from the environment.
func GetApi(env cmds.Environment, req *cmds.Request) (coreiface.CoreAPI, error) {
func GetApi(env cmds.Environment, req *cmds.Request) (coreiface.CoreAPI, error) { //nolint
ctx, ok := env.(*commands.Context)
if !ok {
return nil, fmt.Errorf("expected env to be of type %T, got %T", ctx, env)
Expand Down
Loading

0 comments on commit 4485d6b

Please sign in to comment.