Skip to content

Commit

Permalink
Merge pull request #7924 from ipfs/release-v0.8.0
Browse files Browse the repository at this point in the history
Release v0.8.0
  • Loading branch information
aschmahmann authored Feb 18, 2021
2 parents ea77213 + 30fa364 commit ce693d7
Show file tree
Hide file tree
Showing 86 changed files with 3,909 additions and 698 deletions.
40 changes: 34 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,42 @@ jobs:
- store_artifacts:
path: /tmp/circleci-test-results
sharness:
executor: golang
machine:
image: ubuntu-2004:202010-01
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
steps:
- run: sudo apt install socat
- checkout

- run:
mkdir rb-pinning-service-api &&
cd rb-pinning-service-api &&
git init &&
git remote add origin https://github.com/ipfs-shipyard/rb-pinning-service-api.git &&
git fetch --depth 1 origin 773c3adbb421c551d2d89288abac3e01e1f7c3a8 &&
git checkout FETCH_HEAD
- run:
cd rb-pinning-service-api &&
docker-compose pull &&
docker-compose up -d

- *make_out_dirs
- *restore_gomod

- run: make -O -j 10 coverage/sharness_tests.coverprofile test/sharness/test-results/sharness.xml TEST_GENERATE_JUNIT=1 CONTINUE_ON_S_FAILURE=1
- run:
name: Setup Environment Variables
# we need the docker host IP; all ports exported by child containers can be accessed there.
command: echo "export DOCKER_HOST=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')" >> $BASH_ENV
- run:
echo DOCKER_HOST=$DOCKER_HOST &&
make -O -j 3 coverage/sharness_tests.coverprofile test/sharness/test-results/sharness.xml TEST_GENERATE_JUNIT=1 CONTINUE_ON_S_FAILURE=1 DOCKER_HOST=$DOCKER_HOST

- run:
when: always
Expand Down Expand Up @@ -174,8 +202,8 @@ jobs:
name: Installing dependencies
command: |
npm init -y
npm install ipfs@^0.50.1
npm install ipfs-interop@^3.0.0
npm install ipfs@^0.52.2
npm install ipfs-interop@^4.0.0
npm install [email protected]
working_directory: ~/ipfs/go-ipfs/interop
- run:
Expand Down Expand Up @@ -294,7 +322,7 @@ jobs:
steps:
- checkout
- setup_remote_docker:
version: "18.09.3"
version: "19.03.13"
- run:
name: Build Docker image
command: |
Expand All @@ -311,7 +339,7 @@ jobs:
steps:
- checkout
- setup_remote_docker:
version: "18.09.3"
version: "19.03.13"
- attach_workspace:
at: /tmp/workspace
- run:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 'Documentation Issue'
about: 'Report missing, erroneous docs, broken links or propose new go-ipfs docs'
labels: topic/docs-ipfs, need/triage
---
<!-- Problems with documentation on https://docs.ipfs.io should be reported to https://github.com/ipfs/docs -->
<!-- Problems with documentation on https://docs.ipfs.io should be reported to https://github.com/ipfs/ipfs-docs -->

#### Location

Expand Down
560 changes: 560 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ When starting a container running ipfs for the first time with an empty data dir

docker run -d --name ipfs_host -e IPFS_PROFILE=server -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest

#### Private swarms inside Docker

It is possible to initialize the container with a swarm key file (`/data/ipfs/swarm.key`) using the variables `IPFS_SWARM_KEY` and `IPFS_SWARM_KEY_FILE`. The `IPFS_SWARM_KEY` creates `swarm.key` with the contents of the variable itself, whilst `IPFS_SWARM_KEY_FILE` copies the key from a path stored in the variable. The `IPFS_SWARM_KEY_FILE` **overwrites** the key generated by `IPFS_SWARM_KEY`.

docker run -d --name ipfs_host -e IPFS_SWARM_KEY=<your swarm key> -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
Expand All @@ -387,6 +389,20 @@ The swarm key initialization can also be done using docker secrets **(requires d
cat your_swarm.key | docker secret create swarm_key_secret -
docker run -d --name ipfs_host --secret swarm_key_secret -e IPFS_SWARM_KEY_FILE=/run/secrets/swarm_key_secret -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest

#### Key rotation inside Docker

If needed, it is possible to do key rotation in an ephemeral container that is temporarily executing against a volume that is mounted under `/data/ipfs`:

```sh
# given container named 'ipfs-test' that persists repo at /path/to/persisted/.ipfs
$ docker run -d --name ipfs-test -v /path/to/persisted/.ipfs:/data/ipfs ipfs/go-ipfs:v0.7.0
$ docker stop ipfs-test

# key rotation works like this (old key saved under 'old-self')
$ docker run --rm -it -v /path/to/persisted/.ipfs:/data/ipfs ipfs/go-ipfs:v0.7.0 key rotate -o old-self -t ed25519
$ docker start ipfs-test # will start with the new key
```

### Troubleshooting

If you have previously installed IPFS before and you are running into problems getting a newer version to work, try deleting (or backing up somewhere else) your IPFS config directory (~/.ipfs by default) and rerunning `ipfs init`. This will reinitialize the config file to its defaults and clear out the local datastore of any bad entries.
Expand Down
4 changes: 2 additions & 2 deletions assets/bindata.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/bindata_version_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
package assets

const (
BindataVersionHash = "514e5ae28d8adb84955801b56ef47aca44bf9cc8"
BindataVersionHash = "605b5945438e1fe2eaf8a6571cca7ecda12d5599"
)
2 changes: 1 addition & 1 deletion assets/dir-index-html
6 changes: 3 additions & 3 deletions blocks/blockstoreutil/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
)

// RemovedBlock is used to represent the result of removing a block.
// If a block was removed successfully than the Error string will be
// empty. If a block could not be removed than Error will contain the
// If a block was removed successfully, then the Error string will be
// empty. If a block could not be removed, then Error will contain the
// reason the block could not be removed. If the removal was aborted
// due to a fatal error Hash will be empty, Error will contain the
// due to a fatal error, Hash will be empty, Error will contain the
// reason, and no more results will be sent.
type RemovedBlock struct {
Hash string `json:",omitempty"`
Expand Down
22 changes: 16 additions & 6 deletions cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,20 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
}
}

identity, err := config.CreateIdentity(os.Stdout, []options.KeyGenerateOption{
options.Key.Type(algorithmDefault),
})
if err != nil {
return err
if conf == nil {
identity, err := config.CreateIdentity(os.Stdout, []options.KeyGenerateOption{
options.Key.Type(algorithmDefault),
})
if err != nil {
return err
}
conf, err = config.InitWithIdentity(identity)
if err != nil {
return err
}
}

if err = doInit(os.Stdout, cctx.ConfigRoot, false, &identity, profiles, conf); err != nil {
if err = doInit(os.Stdout, cctx.ConfigRoot, false, profiles, conf); err != nil {
return err
}
}
Expand Down Expand Up @@ -433,6 +439,9 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
// initialize metrics collector
prometheus.MustRegister(&corehttp.IpfsNodeCollector{Node: node})

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

// The daemon is *finally* ready.
fmt.Printf("Daemon is ready\n")
notifyReady()
Expand Down Expand Up @@ -522,6 +531,7 @@ func serveHTTPApi(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, error

var opts = []corehttp.ServeOption{
corehttp.MetricsCollectionOption("api"),
corehttp.MetricsOpenCensusCollectionOption(),
corehttp.CheckVersionOption(),
corehttp.CommandsOption(*cctx),
corehttp.WebUIOption,
Expand Down
67 changes: 23 additions & 44 deletions cmd/ipfs/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,7 @@ environment variable:
},
NoRemote: true,
Extra: commands.CreateCmdExtras(commands.SetDoesNotUseRepo(true), commands.SetDoesNotUseConfigAsInput(true)),
PreRun: func(req *cmds.Request, env cmds.Environment) error {
cctx := env.(*oldcmds.Context)
daemonLocked, err := fsrepo.LockedByOtherProcess(cctx.ConfigRoot)
if err != nil {
return err
}

log.Info("checking if daemon is running...")
if daemonLocked {
log.Debug("ipfs daemon is running")
e := "ipfs daemon is running. please stop it to run this command"
return cmds.ClientError(e)
}

return nil
},
PreRun: commands.DaemonNotRunning,
Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {
cctx := env.(*oldcmds.Context)
empty, _ := req.Options[emptyRepoOptionName].(bool)
Expand Down Expand Up @@ -113,24 +98,30 @@ environment variable:
}
}

var err error
var identity config.Identity
if nBitsGiven {
identity, err = config.CreateIdentity(os.Stdout, []options.KeyGenerateOption{
options.Key.Size(nBitsForKeypair),
options.Key.Type(algorithm),
})
} else {
identity, err = config.CreateIdentity(os.Stdout, []options.KeyGenerateOption{
options.Key.Type(algorithm),
})
}
if err != nil {
return err
if conf == nil {
var err error
var identity config.Identity
if nBitsGiven {
identity, err = config.CreateIdentity(os.Stdout, []options.KeyGenerateOption{
options.Key.Size(nBitsForKeypair),
options.Key.Type(algorithm),
})
} else {
identity, err = config.CreateIdentity(os.Stdout, []options.KeyGenerateOption{
options.Key.Type(algorithm),
})
}
if err != nil {
return err
}
conf, err = config.InitWithIdentity(identity)
if err != nil {
return err
}
}

profiles, _ := req.Options[profileOptionName].(string)
return doInit(os.Stdout, cctx.ConfigRoot, empty, &identity, profiles, conf)
return doInit(os.Stdout, cctx.ConfigRoot, empty, profiles, conf)
},
}

Expand All @@ -152,7 +143,7 @@ func applyProfiles(conf *config.Config, profiles string) error {
return nil
}

func doInit(out io.Writer, repoRoot string, empty bool, identity *config.Identity, confProfiles string, conf *config.Config) error {
func doInit(out io.Writer, repoRoot string, empty bool, confProfiles string, conf *config.Config) error {
if _, err := fmt.Fprintf(out, "initializing IPFS node at %s\n", repoRoot); err != nil {
return err
}
Expand All @@ -165,18 +156,6 @@ func doInit(out io.Writer, repoRoot string, empty bool, identity *config.Identit
return errRepoExists
}

if identity == nil {
return fmt.Errorf("No Identity provided for initialization")
}

if conf == nil {
var err error
conf, err = config.InitWithIdentity(*identity)
if err != nil {
return err
}
}

if err := applyProfiles(conf, confProfiles); err != nil {
return err
}
Expand Down
Loading

0 comments on commit ce693d7

Please sign in to comment.