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

Release v0.4.23 #6836

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
77298e1
build: fix build when we don't have a full git tree
Stebalien Sep 4, 2019
6131b7f
fix: close peerstore on stop
Stebalien Sep 6, 2019
71133b6
make: move all test deps to a separate module
Stebalien Sep 11, 2019
721c1ab
build: fix golangci again
Stebalien Sep 12, 2019
36c0cbf
namesys: set the correct cache TTL on publish
Stebalien Sep 23, 2019
c69e347
pin: fix pin update X Y where X==Y
Stebalien Sep 23, 2019
456137b
fix(pin): wait till after fetching to remove direct pin
Stebalien Oct 8, 2019
6ded0ba
fix bug 6748
Nov 8, 2019
745708b
fix(coreapi/add): close the fake repo used when adding with hash-only
Stebalien Nov 4, 2019
9aa2f07
fix issue 6760, adding with hash-only, high CPU usage.
Nov 15, 2019
455e498
fix: limit SW registration to content root
lidel Dec 17, 2019
d87686b
fix: update bbloom to fix race conditions
Stebalien Jan 17, 2020
15cdea8
chore(dep): update xerrors to fix go 1.13 build error
Stebalien Jan 17, 2020
85f0125
chore(dep): update go-cid/go-multihash
Stebalien Jan 17, 2020
5bbf20d
test: handle id -> identity rename
Stebalien Aug 23, 2019
cef8c3c
test: handle murmur3 rename
Stebalien Aug 24, 2019
557c627
chore(dep): update libp2p deps
Stebalien Jan 17, 2020
1045a31
fix: use pre-defined relays for autorelay
Stebalien Jan 17, 2020
f54016b
chore(dep): update go-bitswap
Stebalien Jan 17, 2020
7591a8d
ci: use executors
Stebalien Aug 13, 2019
c9adad2
ci: spit out junit reports from the interop tests
Stebalien Aug 15, 2019
2ea07b6
ci: send interop results to stdout and junit
Stebalien Aug 15, 2019
5a16869
ci: parallelize interop tests
Stebalien Aug 15, 2019
e8a64c9
test(interop): allow weak keys
Stebalien Dec 4, 2019
eb2ed1c
test(interop): explicitly install http client
Stebalien Dec 5, 2019
d0a6b37
ci: wait 30 seconds for the api tests daemon to start
Stebalien Dec 10, 2019
2155b73
test: E2E tests against ipfs-webui HEAD
lidel Jan 15, 2020
b54bdf3
test(ci): update node for webui tests
Stebalien Jan 17, 2020
b7af017
test(ci): use go 1.13 for api tests
Stebalien Jan 17, 2020
c81bcc0
release: bump to v0.4.23
Stebalien Jan 17, 2020
b2777ee
feat: webui 2.7.2
hacdias Dec 4, 2019
a932ab1
chore(dep): update go-libp2p-kad-dht
Stebalien Jan 21, 2020
e493390
Merge pull request #6844 from ipfs/chore/webui-2.7.2
Stebalien Jan 21, 2020
c0cd452
release: bump to v0.4.23-rc2
Stebalien Jan 21, 2020
29400bc
chore(dep): update go-libp2p-swarm
Stebalien Jan 28, 2020
6ce9a35
release: bump to v0.4.23
Stebalien Jan 30, 2020
8f80730
doc(changelog): release notes for 0.4.23
Stebalien Jan 30, 2020
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
161 changes: 115 additions & 46 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2.0
version: 2.1

aliases:
make_out_dirs: &make_out_dirs
run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_WORKSPACE $CIRCLE_TEST_REPORTS/{unit,sharness}
run: mkdir -p /tmp/circleci-artifacts /tmp/circleci-workspace /tmp/circleci-test-results/{unit,sharness}
restore_gomod: &restore_gomod
restore_cache:
keys:
Expand All @@ -17,28 +17,50 @@ aliases:
- ~/go/pkg/mod
- ~/.cache/go-build/

default_environment: &default_environment
SERVICE: circle-ci
TRAVIS: 1
CIRCLE: 1
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
GIT_PAGER: cat

defaults: &defaults
working_directory: ~/ipfs/go-ipfs
environment:
GIT_PAGER: cat
GO111MODULE: "on"
TEST_NO_DOCKER: 1
TEST_NO_FUSE: 1
GOPATH: /home/circleci/go
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
CIRCLE: 1
SERVICE: circle-ci
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_WORKSPACE: /tmp/circleci-workspace
TEST_VERBOSE: 1
TRAVIS: 1
executors:
golang:
parameters:
tag:
type: string
default: "1.12"
docker:
- image: circleci/golang:<< parameters.tag >>
working_directory: ~/ipfs/go-ipfs
environment:
<<: *default_environment
GO111MODULE: "on"
TEST_NO_DOCKER: 1
TEST_NO_FUSE: 1
GOPATH: /home/circleci/go
TEST_VERBOSE: 1
node:
docker:
- image: circleci/node:10
working_directory: ~/ipfs/go-ipfs
environment:
<<: *default_environment
node-browsers:
docker:
- image: circleci/node:12-browsers
working_directory: ~/ipfs/go-ipfs
environment:
<<: *default_environment
NO_SANDBOX: true
IPFS_REUSEPORT: false
LIBP2P_ALLOW_WEAK_RSA_KEYS: 1
E2E_IPFSD_TYPE: go

jobs:
gobuild:
docker:
- image: circleci/golang:1.12
<<: *defaults
executor: golang
steps:
- checkout
- *make_out_dirs
Expand All @@ -53,9 +75,7 @@ jobs:
TEST_NO_FUSE: 1
- *store_gomod
golint:
<<: *defaults
docker:
- image: circleci/golang:1.12
executor: golang
steps:
- checkout
- *make_out_dirs
Expand All @@ -64,9 +84,7 @@ jobs:
make -O test_go_lint
- *store_gomod
gotest:
docker:
- image: circleci/golang:1.12
<<: *defaults
executor: golang
steps:
- checkout
- *make_out_dirs
Expand All @@ -93,9 +111,7 @@ jobs:
- store_artifacts:
path: /tmp/circleci-test-results
sharness:
docker:
- image: circleci/golang:1.12
<<: *defaults
executor: golang
steps:
- run: sudo apt install socat
- checkout
Expand All @@ -122,9 +138,7 @@ jobs:
- store_artifacts:
path: /tmp/circleci-test-results
build:
docker:
- image: circleci/golang:1.12
<<: *defaults
executor: golang
steps:
- checkout
- *make_out_dirs
Expand All @@ -143,9 +157,8 @@ jobs:
- bin/ipfs
- *store_gomod
interop:
docker:
- image: circleci/node:10
<<: *defaults
executor: node
parallelism: 4
steps:
- *make_out_dirs
- attach_workspace:
Expand All @@ -160,23 +173,43 @@ jobs:
- v1-interop-{{ checksum "~/ipfs/go-ipfs/interop/package-lock.json" }}
- v1-interop-
- run:
command: npm install
name: Installing dependencies
command: |
npm install
working_directory: ~/ipfs/go-ipfs/interop
environment:
IPFS_GO_EXEC: /tmp/circleci-workspace/bin/ipfs
- save_cache:
key: v1-interop-{{ checksum "~/ipfs/go-ipfs/interop/package-lock.json" }}
paths:
- ~/ipfs/go-ipfs/interop/node_modules
- run:
command: npm run test:node
name: Installing js-ipfs
command: |
npm install ipfs ipfs-http-client
working_directory: ~/ipfs/go-ipfs/interop
- run:
name: Installing reporting tools
command: |
npm install --save-dev mocha-junit-reporter@1.23.1 mocha-multi-reporters@1.1.0
working_directory: ~/ipfs/go-ipfs/interop
- run:
name: Running tests
command: |
mkdir -p /tmp/test-results/interop/
export MOCHA_FILE="$(mktemp /tmp/test-results/interop/unit.XXXXXX.xml)"
echo '{"reporterEnabled": "mocha-junit-reporter, spec"}' > mocha-conf.json
node_modules/.bin/mocha -R mocha-multi-reporters --reporter-options "configFile=mocha-conf.json" \
$(sed -n -e "s|^require('\(.*\)')$|test/\1|p" test/node.js | circleci tests split)
working_directory: ~/ipfs/go-ipfs/interop
environment:
IPFS_REUSEPORT: false
LIBP2P_ALLOW_WEAK_RSA_KEYS: 1
IPFS_GO_EXEC: /tmp/circleci-workspace/bin/ipfs
- store_test_results:
path: /tmp/test-results
go-ipfs-api:
docker:
- image: circleci/golang:1.12
<<: *defaults
executor:
name: golang
tag: "1.13"
steps:
- *make_out_dirs
- attach_workspace:
Expand All @@ -192,7 +225,7 @@ jobs:
background: true
- run:
name: Waiting for the daemon
no_output_timeout: 10s
no_output_timeout: 30s
command: |
while ! /tmp/circleci-workspace/bin/ipfs id --api=/ip4/127.0.0.1/tcp/5001 2>/dev/null; do
sleep 1
Expand All @@ -213,9 +246,7 @@ jobs:
name: Stopping the daemon
command: /tmp/circleci-workspace/bin/ipfs shutdown
go-ipfs-http-client:
docker:
- image: circleci/golang:1.12
<<: *defaults
executor: golang
steps:
- *make_out_dirs
- attach_workspace:
Expand All @@ -240,6 +271,41 @@ jobs:
paths:
- ~/go/pkg/mod
- ~/.cache/go-build/
ipfs-webui:
executor: node-browsers
steps:
- *make_out_dirs
- attach_workspace:
at: /tmp/circleci-workspace
- run:
name: Cloning
command: |
git clone https://github.com/ipfs-shipyard/ipfs-webui.git
git -C ipfs-webui log -1
- restore_cache:
keys:
- v1-ipfs-webui-{{ checksum "~/ipfs/go-ipfs/ipfs-webui/package-lock.json" }}
- v1-ipfs-webui-
- run:
name: Installing dependencies
command: |
npm install
working_directory: ~/ipfs/go-ipfs/ipfs-webui
- run:
name: Running upstream tests (finish early if they fail)
command: |
npm test || circleci-agent step halt
working_directory: ~/ipfs/go-ipfs/ipfs-webui
- run:
name: Running tests with go-ipfs built from current commit
command: npm test
working_directory: ~/ipfs/go-ipfs/ipfs-webui
environment:
IPFS_GO_EXEC: /tmp/circleci-workspace/bin/ipfs
- save_cache:
key: v1-ipfs-webui-{{ checksum "~/ipfs/go-ipfs/ipfs-webui/package-lock.json" }}
paths:
- ~/ipfs/go-ipfs/ipfs-webui/node_modules
workflows:
version: 2
test:
Expand All @@ -258,3 +324,6 @@ workflows:
- go-ipfs-http-client:
requires:
- build
- ipfs-webui:
requires:
- build
41 changes: 31 additions & 10 deletions core/coreapi/unixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package coreapi
import (
"context"
"fmt"
"sync"

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

Expand All @@ -28,6 +29,28 @@ import (

type UnixfsAPI CoreAPI

var nilNode *core.IpfsNode
var once sync.Once

func getOrCreateNilNode() (*core.IpfsNode,error) {
once.Do(func() {
if nilNode != nil {
return
}
node, err := core.NewNode(context.Background(), &core.BuildCfg{
//TODO: need this to be true or all files
// hashed will be stored in memory!
NilRepo: true,
})
if err != nil {
panic(err)
}
nilNode = node
})

return nilNode, nil
}

// Add builds a merkledag node from a reader, adds it to the blockstore,
// and returns the key representing that node.
func (api *UnixfsAPI) Add(ctx context.Context, files files.Node, opts ...options.UnixfsAddOption) (path.Resolved, error) {
Expand Down Expand Up @@ -61,17 +84,13 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.Node, opts ...options
pinning := api.pinning

if settings.OnlyHash {
nilnode, err := core.NewNode(ctx, &core.BuildCfg{
//TODO: need this to be true or all files
// hashed will be stored in memory!
NilRepo: true,
})
node, err := getOrCreateNilNode()
if err != nil {
return nil, err
}
addblockstore = nilnode.Blockstore
exch = nilnode.Exchange
pinning = nilnode.Pinning
addblockstore = node.Blockstore
exch = node.Exchange
pinning = node.Pinning
}

bserv := blockservice.New(addblockstore, exch) // hash security 001
Expand Down Expand Up @@ -127,8 +146,10 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.Node, opts ...options
return nil, err
}

if err := api.provider.Provide(nd.Cid()); err != nil {
return nil, err
if !settings.OnlyHash {
if err := api.provider.Provide(nd.Cid()); err != nil {
return nil, err
}
}

return path.IpfsPath(nd.Cid()), nil
Expand Down
13 changes: 13 additions & 0 deletions core/corehttp/gateway_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"net/url"
gopath "path"
"regexp"
"runtime/debug"
"strings"
"time"
Expand Down Expand Up @@ -151,6 +152,18 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request
ipnsHostname = true
}

// Service Worker registration request
if r.Header.Get("Service-Worker") == "script" {
// Disallow Service Worker registration on namespace roots
// https://github.com/ipfs/go-ipfs/issues/4025
matched, _ := regexp.MatchString(`^/ip[fn]s/[^/]+$`, r.URL.Path)
if matched {
err := fmt.Errorf("registration is not allowed for this scope")
webError(w, "navigator.serviceWorker", err, http.StatusBadRequest)
return
}
}

parsedPath := ipath.New(urlPath)
if err := parsedPath.IsValid(); err != nil {
webError(w, "invalid ipfs path", err, http.StatusBadRequest)
Expand Down
13 changes: 12 additions & 1 deletion core/corehttp/webui.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package corehttp

// TODO: move to IPNS
const WebUIPath = "/ipfs/QmfQkD8pBSBCBxWEwFSu4XaDVSWK6bjnNuaWZjMyQbyDub"
const WebUIPath = "/ipfs/Qmexhq2sBHnXQbvyP2GfUdbnY7HCagH2Mw5vUNSBn2nxip"

// this is a list of all past webUI paths.
var WebUIPaths = []string{
Expand All @@ -22,6 +22,17 @@ var WebUIPaths = []string{
"/ipfs/QmRyWyKWmphamkMRnJVjUTzSFSAAZowYP4rnbgnfMXC9Mr",
"/ipfs/QmU3o9bvfenhTKhxUakbYrLDnZU7HezAVxPM6Ehjw9Xjqy",
"/ipfs/QmPhnvn747LqwPYMJmQVorMaGbMSgA7mRRoyyZYz3DoZRQ",
"/ipfs/QmfQkD8pBSBCBxWEwFSu4XaDVSWK6bjnNuaWZjMyQbyDub",
"/ipfs/QmQNHd1suZTktPRhP7DD4nKWG46ZRSxkwHocycHVrK3dYW",
"/ipfs/QmNyMYhwJUS1cVvaWoVBhrW8KPj1qmie7rZcWo8f1Bvkhz",
"/ipfs/QmVTiRTQ72qiH4usAGT4c6qVxCMv4hFMUH9fvU6mktaXdP",
"/ipfs/QmYcP4sp1nraBiCYi6i9kqdaKobrK32yyMpTrM5JDA8a2C",
"/ipfs/QmUtMmxgHnDvQq4bpH6Y9MaLN1hpfjJz5LZcq941BEqEXs",
"/ipfs/QmPURAjo3oneGH53ovt68UZEBvsc8nNmEhQZEpsVEQUMZE",
"/ipfs/QmeSXt32frzhvewLKwA1dePTSjkTfGVwTh55ZcsJxrCSnk",
"/ipfs/QmcjeTciMNgEBe4xXvEaA4TQtwTRkXucx7DmKWViXSmX7m",
"/ipfs/QmfNbSskgvTXYhuqP8tb9AKbCkyRcCy3WeiXwD9y5LeoqK",
"/ipfs/QmPkojhjJkJ5LEGBDrAvdftrjAYmi9GU5Cq27mWvZTDieW",
}

var WebUIOption = RedirectOption("webui", WebUIPath)
Loading