Skip to content

Commit

Permalink
Merge pull request #10535 from ipfs/release-v0.31.0
Browse files Browse the repository at this point in the history
Release: v0.31.0 [skip changelog]
  • Loading branch information
gammazero authored Oct 16, 2024
2 parents 846c5cc + 4aebe7f commit 5a32936
Show file tree
Hide file tree
Showing 57 changed files with 1,398 additions and 653 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x
- uses: actions/checkout@v4
- run: docker build -t $IMAGE_NAME:$WIP_IMAGE_TAG .
- run: docker run --rm $IMAGE_NAME:$WIP_IMAGE_TAG --version
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
shell: bash

- name: Log in to Docker Hub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gateway-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x
- uses: protocol/cache-go-action@v1
with:
name: ${{ github.job }}
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x
- uses: protocol/cache-go-action@v1
with:
name: ${{ github.job }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x
- uses: actions/checkout@v4
- run: make cmd/ipfs-try-build
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golang-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
submodules: recursive
- uses: actions/setup-go@v5
with:
go-version: "1.22.x"
go-version: "1.23.x"
- name: Check that go.mod is tidy
uses: protocol/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x
- uses: actions/checkout@v4
- run: make -O test_go_lint
2 changes: 1 addition & 1 deletion .github/workflows/gotest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x
- name: Check out Kubo
uses: actions/checkout@v4
- name: Install missing tools
Expand Down
22 changes: 2 additions & 20 deletions .github/workflows/interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- 'master'

env:
GO_VERSION: 1.22.x
GO_VERSION: 1.23.x

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
Expand Down Expand Up @@ -70,27 +70,9 @@ jobs:
restore-keys: ${{ runner.os }}-${{ github.job }}-helia-
- run: sudo apt update
- run: sudo apt install -y libxkbcommon0 libxdamage1 libgbm1 libpango-1.0-0 libcairo2 # dependencies for playwright

# TODO: for now run against version from https://github.com/ipfs/helia/pull/584
- name: Checkout helia-interop with provisional fix
uses: actions/checkout@v4
with:
repository: ipfs/helia
ref: ab6b385787075ad9932f24362293b3bb82ff1d96
path: helia
- name: Run provisional build of helia
run: npm i && npm run build
working-directory: helia
- name: Run provisional build of helia-interop
run: npm i && npm run build && npx .
working-directory: helia/packages/interop
- run: npx --package @helia/interop helia-interop
env:
KUBO_BINARY: ${{ github.workspace }}/cmd/ipfs/ipfs

# TODO: switch back to release once https://github.com/ipfs/helia/pull/584 ships
#- run: npx --package @helia/interop helia-interop
# env:
# KUBO_BINARY: ${{ github.workspace }}/cmd/ipfs/ipfs
ipfs-webui:
needs: [interop-prep]
runs-on: ${{ fromJSON(github.repository == 'ipfs/kubo' && '["self-hosted", "linux", "x64", "2xlarge"]' || '"ubuntu-latest"') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sharness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x
- name: Checkout Kubo
uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Kubo Changelogs

- [v0.31](docs/changelogs/v0.31.md)
- [v0.30](docs/changelogs/v0.30.md)
- [v0.29](docs/changelogs/v0.29.md)
- [v0.28](docs/changelogs/v0.28.md)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.22 AS builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.23 AS builder

ARG TARGETOS TARGETARCH

Expand Down
46 changes: 25 additions & 21 deletions client/rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> IPFS CoreAPI implementation using HTTP API
This packages implements [`coreiface.CoreAPI`](https://pkg.go.dev/github.com/ipfs/boxo/coreiface#CoreAPI) over the HTTP API.
This package implements [`coreiface.CoreAPI`](https://pkg.go.dev/github.com/ipfs/kubo/core/coreiface#CoreAPI) over the HTTP API.

## Documentation

Expand All @@ -16,29 +16,33 @@ Pin file on your local IPFS node based on its CID:
package main

import (
"context"
"fmt"
"context"
"fmt"

"github.com/ipfs/kubo/client/rpc"
path "github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/path"
"github.com/ipfs/go-cid"
"github.com/ipfs/kubo/client/rpc"
)

func main() {
// "Connect" to local node
node, err := rpc.NewLocalApi()
if err != nil {
fmt.Printf(err)
return
}
// Pin a given file by its CID
ctx := context.Background()
cid := "bafkreidtuosuw37f5xmn65b3ksdiikajy7pwjjslzj2lxxz2vc4wdy3zku"
p := path.New(cid)
err = node.Pin().Add(ctx, p)
if err != nil {
fmt.Printf(err)
return
}
return
// "Connect" to local node
node, err := rpc.NewLocalApi()
if err != nil {
fmt.Println(err)
return
}
// Pin a given file by its CID
ctx := context.Background()
c, err := cid.Decode("bafkreidtuosuw37f5xmn65b3ksdiikajy7pwjjslzj2lxxz2vc4wdy3zku")
if err != nil {
fmt.Println(err)
return
}
p := path.FromCid(c)
err = node.Pin().Add(ctx, p)
if err != nil {
fmt.Println(err)
return
}
}
```
33 changes: 29 additions & 4 deletions cmd/ipfs/kubo/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ take effect.
prometheus.MustRegister(&corehttp.IpfsNodeCollector{Node: node})

// start MFS pinning thread
startPinMFS(daemonConfigPollInterval, cctx, &ipfsPinMFSNode{node})
startPinMFS(cctx, daemonConfigPollInterval, &ipfsPinMFSNode{node})

// The daemon is *finally* ready.
fmt.Printf("Daemon is ready\n")
Expand All @@ -600,8 +600,25 @@ take effect.
fmt.Println("(Hit ctrl-c again to force-shutdown the daemon.)")
}()

// Give the user heads up if daemon running in online mode has no peers after 1 minute
if !offline {
// Warn users who were victims of 'lowprofile' footgun (https://github.com/ipfs/kubo/pull/10524)
if cfg.Experimental.StrategicProviding {
fmt.Print(`
⚠️ Reprovide system is disabled due to 'Experimental.StrategicProviding=true'
⚠️ Local CIDs will not be announced to Amino DHT, making them impossible to retrieve without manual peering
⚠️ If this is not intentional, call 'ipfs config profile apply announce-on'
`)
} else if cfg.Reprovider.Interval.WithDefault(config.DefaultReproviderInterval) == 0 {
fmt.Print(`
⚠️ Reprovider system is disabled due to 'Reprovider.Interval=0'
⚠️ Local CIDs will not be announced to Amino DHT, making them impossible to retrieve without manual peering
⚠️ If this is not intentional, call 'ipfs config profile apply announce-on', or set 'Reprovider.Interval=22h'
`)
}

// Give the user heads up if daemon running in online mode has no peers after 1 minute
time.AfterFunc(1*time.Minute, func() {
cfg, err := cctx.GetConfig()
if err != nil {
Expand Down Expand Up @@ -706,10 +723,18 @@ func serveHTTPApi(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, error
for _, listener := range listeners {
// we might have listened to /tcp/0 - let's see what we are listing on
fmt.Printf("RPC API server listening on %s\n", listener.Multiaddr())
// Browsers require TCP.
// Browsers require TCP with explicit host.
switch listener.Addr().Network() {
case "tcp", "tcp4", "tcp6":
fmt.Printf("WebUI: http://%s/webui\n", listener.Addr())
rpc := listener.Addr().String()
// replace catch-all with explicit localhost URL that works in browsers
// https://github.com/ipfs/kubo/issues/10515
if strings.Contains(rpc, "0.0.0.0:") {
rpc = strings.Replace(rpc, "0.0.0.0:", "127.0.0.1:", 1)
} else if strings.Contains(rpc, "[::]:") {
rpc = strings.Replace(rpc, "[::]:", "[::1]:", 1)
}
fmt.Printf("WebUI: http://%s/webui\n", rpc)
}
}

Expand Down
Loading

0 comments on commit 5a32936

Please sign in to comment.