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

refactor: rename to kubo #8958

Merged
merged 4 commits into from
Jul 6, 2022
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
4 changes: 2 additions & 2 deletions .circleci/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ jobs:
cp go.sum go.sum.bak

# make sure the examples run against the current version of go-ipfs
go mod edit -replace github.com/ipfs/go-ipfs=./../../..
go mod edit -replace github.com/ipfs/kubo=./../../..
go mod tidy

# use the internal config package when we test the current version of go-ipfs
sed -i.bak 's;"github.com/ipfs/go-ipfs-config";"github.com/ipfs/go-ipfs/config";' ./main.go
sed -i.bak 's;"github.com/ipfs/go-ipfs-config";"github.com/ipfs/kubo/config";' ./main.go

go test -v ./...

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ on:

jobs:
push_to_registry:
if: github.repository == 'ipfs/go-ipfs' || github.event_name == 'workflow_dispatch'
if: github.repository == 'ipfs/go-ipfs' || github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
IMAGE_NAME: ipfs/go-ipfs
IMAGE_NAME: ipfs/kubo
LEGACY_IMAGE_NAME: ipfs/go-ipfs
steps:
- name: Check out the repo
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y \
ca-certificates \
fuse

ENV SRC_DIR /go-ipfs
ENV SRC_DIR /kubo

# Download packages first so they can be cached.
COPY go.mod go.sum $SRC_DIR/
Expand Down Expand Up @@ -51,7 +51,7 @@ FROM busybox:1.31.1-glibc
LABEL maintainer="Steven Allen <[email protected]>"

# Get the ipfs binary, entrypoint script, and TLS CAs from the build container.
ENV SRC_DIR /go-ipfs
ENV SRC_DIR /kubo
COPY --from=0 $SRC_DIR/cmd/ipfs/ipfs /usr/local/bin/ipfs
COPY --from=0 $SRC_DIR/bin/container_daemon /usr/local/bin/start_ipfs
COPY --from=0 $SRC_DIR/bin/container_init_run /usr/local/bin/container_init_run
Expand Down
193 changes: 106 additions & 87 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
gopath "path"
"strconv"

"github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/core/coreapi"
"github.com/ipfs/kubo/core"
"github.com/ipfs/kubo/core/coreapi"

"github.com/cespare/xxhash"
cid "github.com/ipfs/go-cid"
Expand Down
6 changes: 4 additions & 2 deletions bin/get-docker-tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ BUILD_NUM=$1
GIT_SHA1=${2:-$(git rev-parse HEAD)}
GIT_SHA1_SHORT=$(echo "$GIT_SHA1" | cut -c 1-7)
GIT_BRANCH=${3:-$(git symbolic-ref -q --short HEAD || echo "unknown")}
GIT_TAG=${4:-$(git describe --tags --exact-match || echo "")}
GIT_TAG=${4:-$(git describe --tags --exact-match 2> /dev/null || echo "")}

IMAGE_NAME=${IMAGE_NAME:-ipfs/go-ipfs}
IMAGE_NAME=${IMAGE_NAME:-ipfs/kubo}
LEGACY_IMAGE_NAME=${LEGACY_IMAGE_NAME:-ipfs/go-ipfs}

echoImageName () {
local IMAGE_TAG=$1
echo "$IMAGE_NAME:$IMAGE_TAG"
echo "$LEGACY_IMAGE_NAME:$IMAGE_TAG"
}

if [[ $GIT_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc ]]; then
Expand Down
4 changes: 2 additions & 2 deletions cmd/ipfs/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PATH := $(realpath $(d)):$(PATH)
# DEPS_OO_$(d) += merkledag/pb/merkledag.pb.go namesys/pb/namesys.pb.go
# DEPS_OO_$(d) += pin/internal/pb/header.pb.go unixfs/pb/unixfs.pb.go

$(d)_flags =-ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=$(git-hash)"
$(d)_flags =-ldflags="-X "github.com/ipfs/kubo".CurrentCommit=$(git-hash)"

$(d)-try-build $(IPFS_BIN_$(d)): GOFLAGS += $(cmd/ipfs_flags)

Expand Down Expand Up @@ -42,7 +42,7 @@ CLEAN += $(COVER_BIN_$(d))

$(COVER_BIN_$(d)): GOTAGS += testrunmain
$(COVER_BIN_$(d)): $(d) $$(DEPS_GO) ALWAYS
$(eval TMP_PKGS := $(shell $(GOCC) list -f '{{range .Deps}}{{.}} {{end}}' $(go-flags-with-tags) ./cmd/ipfs | sed 's/ /\n/g' | grep ipfs/go-ipfs) $(call go-pkg-name,$<))
$(eval TMP_PKGS := $(shell $(GOCC) list -f '{{range .Deps}}{{.}} {{end}}' $(go-flags-with-tags) ./cmd/ipfs | sed 's/ /\n/g' | grep ipfs/kubo) $(call go-pkg-name,$<))
$(eval TMP_LIST := $(call join-with,$(comma),$(TMP_PKGS)))
@echo $(GOCC) test $@ -c -covermode atomic -coverpkg ... $(go-flags-with-tags) ./$(@D) # for info
@$(GOCC) test -o $@ -c -covermode atomic -coverpkg $(TMP_LIST) $(go-flags-with-tags) ./$(@D) 2>&1 | (grep -v 'warning: no packages being tested' || true)
Expand Down
10 changes: 5 additions & 5 deletions cmd/ipfs/add_migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"path/filepath"

files "github.com/ipfs/go-ipfs-files"
"github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/core/coreapi"
"github.com/ipfs/go-ipfs/repo/fsrepo/migrations"
"github.com/ipfs/go-ipfs/repo/fsrepo/migrations/ipfsfetcher"
coreiface "github.com/ipfs/interface-go-ipfs-core"
"github.com/ipfs/interface-go-ipfs-core/options"
ipath "github.com/ipfs/interface-go-ipfs-core/path"
"github.com/ipfs/kubo/core"
"github.com/ipfs/kubo/core/coreapi"
"github.com/ipfs/kubo/repo/fsrepo/migrations"
"github.com/ipfs/kubo/repo/fsrepo/migrations/ipfsfetcher"
"github.com/libp2p/go-libp2p-core/peer"
)

Expand All @@ -36,7 +36,7 @@ func addMigrations(ctx context.Context, node *core.IpfsNode, fetcher migrations.
if err != nil {
return err
}
case *migrations.HttpFetcher, *migrations.RetryFetcher: // https://github.com/ipfs/go-ipfs/issues/8780
case *migrations.HttpFetcher, *migrations.RetryFetcher: // https://github.com/ipfs/kubo/issues/8780
// Add the downloaded migration files directly
if migrations.DownloadDirectory != "" {
var paths []string
Expand Down
32 changes: 16 additions & 16 deletions cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ import (

multierror "github.com/hashicorp/go-multierror"

version "github.com/ipfs/go-ipfs"
utilmain "github.com/ipfs/go-ipfs/cmd/ipfs/util"
oldcmds "github.com/ipfs/go-ipfs/commands"
config "github.com/ipfs/go-ipfs/config"
cserial "github.com/ipfs/go-ipfs/config/serialize"
"github.com/ipfs/go-ipfs/core"
commands "github.com/ipfs/go-ipfs/core/commands"
"github.com/ipfs/go-ipfs/core/coreapi"
corehttp "github.com/ipfs/go-ipfs/core/corehttp"
corerepo "github.com/ipfs/go-ipfs/core/corerepo"
libp2p "github.com/ipfs/go-ipfs/core/node/libp2p"
nodeMount "github.com/ipfs/go-ipfs/fuse/node"
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
"github.com/ipfs/go-ipfs/repo/fsrepo/migrations"
"github.com/ipfs/go-ipfs/repo/fsrepo/migrations/ipfsfetcher"
version "github.com/ipfs/kubo"
utilmain "github.com/ipfs/kubo/cmd/ipfs/util"
oldcmds "github.com/ipfs/kubo/commands"
config "github.com/ipfs/kubo/config"
cserial "github.com/ipfs/kubo/config/serialize"
"github.com/ipfs/kubo/core"
commands "github.com/ipfs/kubo/core/commands"
"github.com/ipfs/kubo/core/coreapi"
corehttp "github.com/ipfs/kubo/core/corehttp"
corerepo "github.com/ipfs/kubo/core/corerepo"
libp2p "github.com/ipfs/kubo/core/node/libp2p"
nodeMount "github.com/ipfs/kubo/fuse/node"
fsrepo "github.com/ipfs/kubo/repo/fsrepo"
"github.com/ipfs/kubo/repo/fsrepo/migrations"
"github.com/ipfs/kubo/repo/fsrepo/migrations/ipfsfetcher"
sockets "github.com/libp2p/go-socket-activation"

cmds "github.com/ipfs/go-ipfs-cmds"
Expand Down Expand Up @@ -801,7 +801,7 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e
}

if len(cfg.Gateway.PathPrefixes) > 0 {
log.Error("Support for X-Ipfs-Gateway-Prefix and Gateway.PathPrefixes is deprecated and will be removed in the next release. Please comment on the issue if you're using this feature: https://github.com/ipfs/go-ipfs/issues/7702")
log.Error("Support for X-Ipfs-Gateway-Prefix and Gateway.PathPrefixes is deprecated and will be removed in the next release. Please comment on the issue if you're using this feature: https://github.com/ipfs/kubo/issues/7702")
}

node, err := cctx.ConstructNode()
Expand Down
2 changes: 1 addition & 1 deletion cmd/ipfs/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"net/http"

"github.com/ipfs/go-ipfs/profile"
"github.com/ipfs/kubo/profile"
)

func init() {
Expand Down
12 changes: 6 additions & 6 deletions cmd/ipfs/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ import (
"path/filepath"
"strings"

assets "github.com/ipfs/go-ipfs/assets"
oldcmds "github.com/ipfs/go-ipfs/commands"
core "github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/core/commands"
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
path "github.com/ipfs/go-path"
unixfs "github.com/ipfs/go-unixfs"
assets "github.com/ipfs/kubo/assets"
oldcmds "github.com/ipfs/kubo/commands"
core "github.com/ipfs/kubo/core"
"github.com/ipfs/kubo/core/commands"
fsrepo "github.com/ipfs/kubo/repo/fsrepo"

cmds "github.com/ipfs/go-ipfs-cmds"
files "github.com/ipfs/go-ipfs-files"
config "github.com/ipfs/go-ipfs/config"
options "github.com/ipfs/interface-go-ipfs-core/options"
config "github.com/ipfs/kubo/config"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/ipfs/ipfs.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
commands "github.com/ipfs/go-ipfs/core/commands"
commands "github.com/ipfs/kubo/core/commands"

cmds "github.com/ipfs/go-ipfs-cmds"
)
Expand Down
18 changes: 9 additions & 9 deletions cmd/ipfs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
"runtime/pprof"
"time"

util "github.com/ipfs/go-ipfs/cmd/ipfs/util"
oldcmds "github.com/ipfs/go-ipfs/commands"
core "github.com/ipfs/go-ipfs/core"
corecmds "github.com/ipfs/go-ipfs/core/commands"
corehttp "github.com/ipfs/go-ipfs/core/corehttp"
loader "github.com/ipfs/go-ipfs/plugin/loader"
repo "github.com/ipfs/go-ipfs/repo"
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
"github.com/ipfs/go-ipfs/tracing"
util "github.com/ipfs/kubo/cmd/ipfs/util"
oldcmds "github.com/ipfs/kubo/commands"
core "github.com/ipfs/kubo/core"
corecmds "github.com/ipfs/kubo/core/commands"
corehttp "github.com/ipfs/kubo/core/corehttp"
loader "github.com/ipfs/kubo/plugin/loader"
repo "github.com/ipfs/kubo/repo"
fsrepo "github.com/ipfs/kubo/repo/fsrepo"
"github.com/ipfs/kubo/tracing"
"go.opentelemetry.io/otel"

cmds "github.com/ipfs/go-ipfs-cmds"
Expand Down
4 changes: 2 additions & 2 deletions cmd/ipfs/pinmfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
logging "github.com/ipfs/go-log"
pinclient "github.com/ipfs/go-pinning-service-http-client"

config "github.com/ipfs/go-ipfs/config"
"github.com/ipfs/go-ipfs/core"
config "github.com/ipfs/kubo/config"
"github.com/ipfs/kubo/core"
)

// mfslog is the logger for remote mfs pinning
Expand Down
2 changes: 1 addition & 1 deletion cmd/ipfs/pinmfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"testing"
"time"

config "github.com/ipfs/go-ipfs/config"
ipld "github.com/ipfs/go-ipld-format"
merkledag "github.com/ipfs/go-merkledag"
config "github.com/ipfs/kubo/config"
"github.com/libp2p/go-libp2p-core/host"
peer "github.com/libp2p/go-libp2p-core/peer"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/ipfswatch/ipfswatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package main
import (
"testing"

"github.com/ipfs/go-ipfs/thirdparty/assert"
"github.com/ipfs/kubo/thirdparty/assert"
)

func TestIsHidden(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions cmd/ipfswatch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"path/filepath"
"syscall"

commands "github.com/ipfs/go-ipfs/commands"
core "github.com/ipfs/go-ipfs/core"
coreapi "github.com/ipfs/go-ipfs/core/coreapi"
corehttp "github.com/ipfs/go-ipfs/core/corehttp"
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
commands "github.com/ipfs/kubo/commands"
core "github.com/ipfs/kubo/core"
coreapi "github.com/ipfs/kubo/core/coreapi"
corehttp "github.com/ipfs/kubo/core/corehttp"
fsrepo "github.com/ipfs/kubo/repo/fsrepo"

fsnotify "github.com/fsnotify/fsnotify"
files "github.com/ipfs/go-ipfs-files"
Expand Down
8 changes: 4 additions & 4 deletions commands/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
"strings"
"time"

core "github.com/ipfs/go-ipfs/core"
coreapi "github.com/ipfs/go-ipfs/core/coreapi"
loader "github.com/ipfs/go-ipfs/plugin/loader"
core "github.com/ipfs/kubo/core"
coreapi "github.com/ipfs/kubo/core/coreapi"
loader "github.com/ipfs/kubo/plugin/loader"

cmds "github.com/ipfs/go-ipfs-cmds"
config "github.com/ipfs/go-ipfs/config"
logging "github.com/ipfs/go-log"
coreiface "github.com/ipfs/interface-go-ipfs-core"
options "github.com/ipfs/interface-go-ipfs-core/options"
config "github.com/ipfs/kubo/config"
)

var log = logging.Logger("command")
Expand Down
2 changes: 1 addition & 1 deletion config/experiments.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package config
type Experiments struct {
FilestoreEnabled bool
UrlstoreEnabled bool
ShardingEnabled bool `json:",omitempty"` // deprecated by autosharding: https://github.com/ipfs/go-ipfs/pull/8527
ShardingEnabled bool `json:",omitempty"` // deprecated by autosharding: https://github.com/ipfs/kubo/pull/8527
GraphsyncEnabled bool
Libp2pStreamMounting bool
P2pHttpProxy bool
Expand Down
2 changes: 1 addition & 1 deletion config/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type Gateway struct {
// Setting to 0 will enable fast listings for all directories.
FastDirIndexThreshold *OptionalInteger `json:",omitempty"`

// FIXME: Not yet implemented: https://github.com/ipfs/go-ipfs/issues/8059
// FIXME: Not yet implemented: https://github.com/ipfs/kubo/issues/8059
APICommands []string

// NoFetch configures the gateway to _not_ fetch blocks in response to
Expand Down
2 changes: 1 addition & 1 deletion config/serialize/serialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"path/filepath"

"github.com/ipfs/go-ipfs/config"
"github.com/ipfs/kubo/config"

"github.com/facebookgo/atomicfile"
)
Expand Down
2 changes: 1 addition & 1 deletion config/serialize/serialize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime"
"testing"

config "github.com/ipfs/go-ipfs/config"
config "github.com/ipfs/kubo/config"
)

func TestConfig(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions core/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"sync"
"time"

"github.com/ipfs/go-ipfs/core/bootstrap"
"github.com/ipfs/go-ipfs/core/node"
"github.com/ipfs/kubo/core/bootstrap"
"github.com/ipfs/kubo/core/node"

"github.com/ipfs/go-metrics-interface"
"go.uber.org/dig"
Expand Down
2 changes: 1 addition & 1 deletion core/commands/active.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"text/tabwriter"
"time"

oldcmds "github.com/ipfs/go-ipfs/commands"
oldcmds "github.com/ipfs/kubo/commands"

cmds "github.com/ipfs/go-ipfs-cmds"
)
Expand Down
2 changes: 1 addition & 1 deletion core/commands/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"path"
"strings"

"github.com/ipfs/go-ipfs/core/commands/cmdenv"
"github.com/ipfs/kubo/core/commands/cmdenv"

"github.com/cheggaaa/pb"
cmds "github.com/ipfs/go-ipfs-cmds"
Expand Down
4 changes: 2 additions & 2 deletions core/commands/bitswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"io"

cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
e "github.com/ipfs/go-ipfs/core/commands/e"
cmdenv "github.com/ipfs/kubo/core/commands/cmdenv"
e "github.com/ipfs/kubo/core/commands/e"

humanize "github.com/dustin/go-humanize"
bitswap "github.com/ipfs/go-bitswap"
Expand Down
4 changes: 2 additions & 2 deletions core/commands/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

files "github.com/ipfs/go-ipfs-files"

cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
"github.com/ipfs/go-ipfs/core/commands/cmdutils"
cmdenv "github.com/ipfs/kubo/core/commands/cmdenv"
"github.com/ipfs/kubo/core/commands/cmdutils"

cmds "github.com/ipfs/go-ipfs-cmds"
options "github.com/ipfs/interface-go-ipfs-core/options"
Expand Down
Loading