Skip to content

Commit

Permalink
Merge master into update-libp2p-v018
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Apr 7, 2022
2 parents bc36572 + 7871a0b commit 75dda8d
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 29 deletions.
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Code owners are automatically requested for review when someone opens a pull
# request that modifies code that they own. Code owners are not automatically
# requested to review draft pull requests.

# HTTP Gateway
core/corehttp/ @lidel
test/sharness/*gateway*.sh @lidel
4 changes: 2 additions & 2 deletions cmd/ipfs/add_migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
"path/filepath"

"github.com/ipfs/go-ipfs-files"
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"
Expand Down Expand Up @@ -37,7 +37,7 @@ func addMigrations(ctx context.Context, node *core.IpfsNode, fetcher migrations.
if err != nil {
return err
}
case *migrations.HttpFetcher:
case *migrations.HttpFetcher, *migrations.RetryFetcher: // https://github.com/ipfs/go-ipfs/issues/8780
// Add the downloaded migration files directly
if migrations.DownloadDirectory != "" {
var paths []string
Expand Down
11 changes: 3 additions & 8 deletions core/commands/dag/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/ipfs/interface-go-ipfs-core/options"

cmds "github.com/ipfs/go-ipfs-cmds"
gocar "github.com/ipld/go-car"
gocarv2 "github.com/ipld/go-car/v2"
)

func dagImport(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {
Expand Down Expand Up @@ -160,17 +160,12 @@ func importWorker(req *cmds.Request, re cmds.ResponseEmitter, api iface.CoreAPI,
err := func() error {
defer file.Close()

car, err := gocar.NewCarReader(file)
car, err := gocarv2.NewBlockReader(file)
if err != nil {
return err
}

// Be explicit here, until the spec is finished
if car.Header.Version != 1 {
return errors.New("only car files version 1 supported at present")
}

for _, c := range car.Header.Roots {
for _, c := range car.Roots {
roots[c] = struct{}{}
}

Expand Down
3 changes: 3 additions & 0 deletions core/commands/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
)

var TarCmd = &cmds.Command{
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7951
Helptext: cmds.HelpText{
Tagline: "Utility functions for tar files in ipfs.",
},
Expand All @@ -24,6 +25,7 @@ var TarCmd = &cmds.Command{
}

var tarAddCmd = &cmds.Command{
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7951
Helptext: cmds.HelpText{
Tagline: "Import a tar file into IPFS.",
ShortDescription: `
Expand Down Expand Up @@ -74,6 +76,7 @@ represent it.
}

var tarCatCmd = &cmds.Command{
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7951
Helptext: cmds.HelpText{
Tagline: "Export a tar file from IPFS.",
ShortDescription: `
Expand Down
57 changes: 42 additions & 15 deletions docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,55 @@ Default: ~/.ipfs

## `IPFS_LOGGING`

Sets the log level for go-ipfs. It can be set to one of:
Specifies the log level for go-ipfs.

* `CRITICAL`
* `ERROR`
* `WARNING`
* `NOTICE`
* `INFO`
* `DEBUG`
`IPFS_LOGGING` is a deprecated alias for the `GOLOG_LOG_LEVEL` environment variable. See below.

Logging can also be configured (on a subsystem by subsystem basis) at runtime
with the `ipfs log` command.
## `IPFS_LOGGING_FMT`

Default: `ERROR`
Specifies the log message format.

## `IPFS_LOGGING_FMT`
`IPFS_LOGGING_FMT` is a deprecated alias for the `GOLOG_LOG_FMT` environment variable. See below.

## `GOLOG_LOG_LEVEL`

Specifies the log-level, both globally and on a per-subsystem basis. Level can be one of:

* `debug`
* `info`
* `warn`
* `error`
* `dpanic`
* `panic`
* `fatal`

Per-subsystem levels can be specified with `subsystem=level`. One global level and one or more per-subsystem levels
can be specified by separating them with commas.

Default: `error`

Example:

```console
GOLOG_LOG_LEVEL="error,core/server=debug" ipfs daemon
```

Sets the log message format. Can be one of:
Logging can also be configured at runtime, both globally and on a per-subsystem basis, with the `ipfs log` command.

* `color`
* `nocolor`
## `GOLOG_LOG_FMT`

Default: `color`
Specifies the log message format. It supports the following values:

- `color` -- human readable, colorized (ANSI) output
- `nocolor` -- human readable, plain-text output.
- `json` -- structured JSON.

For example, to log structured JSON (for easier parsing):

```bash
export GOLOG_LOG_FMT="json"
```
The logging format defaults to `color` when the output is a terminal, and `nocolor` otherwise.

## `GOLOG_FILE`

Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ require (
github.com/ipfs/interface-go-ipfs-core v0.6.2
github.com/ipfs/tar-utils v0.0.2
github.com/ipld/go-car v0.3.2
github.com/ipld/go-car/v2 v2.1.1
github.com/ipld/go-codec-dagpb v1.3.0
github.com/ipld/go-ipld-prime v0.14.1
github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c
Expand Down Expand Up @@ -95,7 +96,7 @@ require (
github.com/multiformats/go-multiaddr v0.5.0
github.com/multiformats/go-multiaddr-dns v0.3.1
github.com/multiformats/go-multibase v0.0.3
github.com/multiformats/go-multicodec v0.3.0
github.com/multiformats/go-multicodec v0.4.0
github.com/multiformats/go-multihash v0.1.0
github.com/opentracing/opentracing-go v1.2.0
github.com/pkg/errors v0.9.1
Expand Down
Loading

0 comments on commit 75dda8d

Please sign in to comment.