diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index d648b61814c..9472db123b9 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -22,7 +22,7 @@ body: required: true - label: I have searched on the [issue tracker](https://github.com/ipfs/kubo/issues?q=is%3Aissue) for my bug. required: true - - label: I am running the latest [kubo version](https://dist.ipfs.io/#kubo) or have an issue updating. + - label: I am running the latest [kubo version](https://dist.ipfs.tech/#kubo) or have an issue updating. required: true - type: dropdown id: install @@ -33,7 +33,7 @@ body: description: Please select your installation method options: - ipfs-desktop - - ipfs-update or dist.ipfs.io + - ipfs-update or dist.ipfs.tech - third-party binary - built from source - type: textarea diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index f9fa316c433..f3f53fe6cac 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -10,7 +10,7 @@ contact_links: url: https://github.com/ipfs/kubo/blob/master/docs/experimental-features.md#readme about: Documentation on Private Networks, Filestore and other experimental features. - name: RPC API Reference - url: https://docs.ipfs.io/reference/http/api/ + url: https://docs.ipfs.tech/reference/kubo/rpc/ about: Documentation of all Kubo RPC API endpoints. - name: IPFS Official Forum url: https://discuss.ipfs.io diff --git a/.github/ISSUE_TEMPLATE/doc.yml b/.github/ISSUE_TEMPLATE/doc.yml index cbb0c9fb046..aec5d6aa8de 100644 --- a/.github/ISSUE_TEMPLATE/doc.yml +++ b/.github/ISSUE_TEMPLATE/doc.yml @@ -7,13 +7,13 @@ body: - type: markdown attributes: value: | - Problems with documentation on https://docs.ipfs.io should be reported to https://github.com/ipfs/ipfs-docs + Problems with documentation on https://docs.ipfs.tech should be reported to https://github.com/ipfs/ipfs-docs - type: checkboxes attributes: label: Checklist description: Please verify the following. options: - - label: I am reporting a documentation issue in this repo, not https://docs.ipfs.io. + - label: I am reporting a documentation issue in this repo, not https://docs.ipfs.tech. required: true - label: I have searched on the [issue tracker](https://github.com/ipfs/kubo/issues?q=is%3Aissue) for my issue. required: true diff --git a/.github/workflows/sync-release-assets.yml b/.github/workflows/sync-release-assets.yml index bdafdbea79b..aa10b7cfb4b 100644 --- a/.github/workflows/sync-release-assets.yml +++ b/.github/workflows/sync-release-assets.yml @@ -1,4 +1,4 @@ -name: Sync github release assets with dist.ipfs.io +name: Sync github release assets with dist.ipfs.tech on: workflow_dispatch: @@ -10,7 +10,7 @@ concurrency: cancel-in-progress: true jobs: - sync-github-and-dist-ipfs-io: + sync-github-and-dist.ipfs.tech: if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch' runs-on: "ubuntu-latest" steps: @@ -50,8 +50,8 @@ jobs: github_assets.add(asset.name) } - // fetch asset info from dist.ipfs.io - p = '/ipns/dist.ipfs.io/kubo/' + release.tag_name + // fetch asset info from dist.ipfs.tech + p = '/ipns/dist.ipfs.tech/kubo/' + release.tag_name let stdout = '' const options = {} options.listeners = { @@ -74,7 +74,7 @@ jobs: } } - // if dist.ipfs.io has files not found in github, copy them over + // if dist.ipfs.tech has files not found in github, copy them over for (const file of missing_files) { file_sha = file + ".sha512" file_cid = file + ".cid" @@ -82,12 +82,12 @@ jobs: // skip files that don't have .cid and .sha512 checksum files if (!dist_assets.has(file_sha) || !dist_assets.has(file_cid)) { if (!file.endsWith('.cid') && !file.endsWith('.sha512')) { // silent skip of .sha512.sha512 :) - console.log(`skipping "${file}" as dist.ipfs.io does not provide .cid and .sha512 checksum files for it`) + console.log(`skipping "${file}" as dist.ipfs.tech does not provide .cid and .sha512 checksum files for it`) } continue } - console.log("fetching", file, "from dist.ipfs.io") + console.log("fetching", file, "from dist.ipfs.tech") await exec.exec('ipfs', ['get', p + '/' + file]) await exec.exec('ipfs', ['get', p + '/' + file_sha]) await exec.exec('ipfs', ['get', p + '/' + file_cid]) diff --git a/README.md b/README.md index d0d9b1d05a1..2304d637dfa 100644 --- a/README.md +++ b/README.md @@ -14,25 +14,25 @@ Kubo (go-ipfs) the earliest and most widely used implementation of IPFS. It includes: - an IPFS daemon server -- extensive [command line tooling](https://docs.ipfs.io/reference/cli/) +- extensive [command line tooling](https://docs.ipfs.tech/reference/kubo/cli/) - an [HTTP Gateway](https://github.com/ipfs/specs/tree/main/http-gateways#readme) (`/ipfs/`, `/ipns/`) for serving content to HTTP browsers - an HTTP RPC API (`/api/v0`) for controlling the daemon node -Note: [other implementations exist](https://docs.ipfs.io/basics/ipfs-implementations/). +Note: [other implementations exist](https://docs.ipfs.tech/basics/ipfs-implementations/). ## What is IPFS? IPFS is a global, versioned, peer-to-peer filesystem. It combines good ideas from previous systems such as Git, BitTorrent, Kademlia, SFS, and the Web. It is like a single BitTorrent swarm, exchanging git objects. IPFS provides an interface as simple as the HTTP web, but with permanence built-in. You can also mount the world at /ipfs. -For more info see: https://docs.ipfs.io/introduction/overview/ +For more info see: https://docs.ipfs.tech/concepts/what-is-ipfs/ Before opening an issue, consider using one of the following locations to ensure you are opening your thread in the right place: - kubo (previously named go-ipfs) _implementation_ bugs in [this repo](https://github.com/ipfs/kubo/issues). - Documentation issues in [ipfs/docs issues](https://github.com/ipfs/ipfs-docs/issues). - IPFS _design_ in [ipfs/specs issues](https://github.com/ipfs/specs/issues). - Exploration of new ideas in [ipfs/notes issues](https://github.com/ipfs/notes/issues). - - Ask questions and meet the rest of the community at the [IPFS Forum](https://discuss.ipfs.io). - - Or [chat with us](https://docs.ipfs.io/community/chat/). + - Ask questions and meet the rest of the community at the [IPFS Forum](https://discuss.ipfs.tech). + - Or [chat with us](https://docs.ipfs.tech/community/chat/). [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCdjsUXJ3QawK4O5L1kqqsew?label=Subscribe%20IPFS&style=social&cacheSeconds=3600)](https://www.youtube.com/channel/UCdjsUXJ3QawK4O5L1kqqsew) [![Follow @IPFS on Twitter](https://img.shields.io/twitter/follow/IPFS?style=social&cacheSeconds=3600)](https://twitter.com/IPFS) @@ -97,7 +97,7 @@ Please follow [`SECURITY.md`](SECURITY.md). ## Install -The canonical download instructions for IPFS are over at: https://docs.ipfs.io/guides/guides/install/. It is **highly recommended** you follow those instructions if you are not interested in working on IPFS development. +The canonical download instructions for IPFS are over at: https://docs.ipfs.tech/install/. It is **highly recommended** you follow those instructions if you are not interested in working on IPFS development. ### System Requirements @@ -115,7 +115,7 @@ If your system is resource-constrained, we recommend: [![Docker Image Version (latest semver)](https://img.shields.io/docker/v/ipfs/kubo?color=blue&label=kubo%20docker%20image&logo=docker&sort=semver&style=flat-square&cacheSeconds=3600)](https://hub.docker.com/r/ipfs/kubo/) --> -More info on how to run kubo (go-ipfs) inside Docker can be found [here](https://docs.ipfs.io/how-to/run-ipfs-inside-docker/). +More info on how to run kubo (go-ipfs) inside Docker can be found [here](https://docs.ipfs.tech/how-to/run-ipfs-inside-docker/). ### Native Linux package managers @@ -244,16 +244,16 @@ PS> scoop install go-ipfs ### Install prebuilt binaries -[![dist.ipfs.io Downloads](https://img.shields.io/github/v/release/ipfs/kubo?label=dist.ipfs.io&logo=ipfs&style=flat-square&cacheSeconds=3600)](https://dweb.link/ipns/dist.ipfs.io#kubo) +[![dist.ipfs.tech Downloads](https://img.shields.io/github/v/release/ipfs/kubo?label=dist.ipfs.tech&logo=ipfs&style=flat-square&cacheSeconds=3600)](https://dweb.link/ipns/dist.ipfs.tech#kubo) From there: - Click the blue "Download kubo" on the right side of the page. - Open/extract the archive. - Move kubo (`ipfs`) to your path (`install.sh` can do it for you). -If you are unable to access [dist.ipfs.io](https://dist.ipfs.io#kubo), you can also download kubo (go-ipfs) from: +If you are unable to access [dist.ipfs.tech](https://dist.ipfs.tech#kubo), you can also download kubo (go-ipfs) from: - this project's GitHub [releases](https://github.com/ipfs/kubo/releases/latest) page -- `/ipns/dist.ipfs.io` at [dweb.link](https://dweb.link/ipns/dist.ipfs.io#kubo) gateway +- `/ipns/dist.ipfs.tech` at [dweb.link](https://dweb.link/ipns/dist.ipfs.tech#kubo) gateway ### Build from Source @@ -329,42 +329,42 @@ dependencies as well. IPFS has an updating tool that can be accessed through `ipfs update`. The tool is not installed alongside IPFS in order to keep that logic independent of the main -codebase. To install `ipfs update`, [download it here](https://ipfs.io/ipns/dist.ipfs.io/#ipfs-update). +codebase. To install `ipfs update`, [download it here](https://dist.ipfs.tech/#ipfs-update). #### Downloading builds using IPFS - + List the available versions of kubo (go-ipfs) implementation: ``` -$ ipfs cat /ipns/dist.ipfs.io/go-ipfs/versions +$ ipfs cat /ipns/dist.ipfs.tech/go-ipfs/versions ``` Then, to view available builds for a version from the previous command ($VERSION): ``` -$ ipfs ls /ipns/dist.ipfs.io/go-ipfs/$VERSION +$ ipfs ls /ipns/dist.ipfs.tech/go-ipfs/$VERSION ``` To download a given build of a version: ``` -$ ipfs get /ipns/dist.ipfs.io/go-ipfs/$VERSION/go-ipfs_$VERSION_darwin-386.tar.gz # darwin 32-bit build -$ ipfs get /ipns/dist.ipfs.io/go-ipfs/$VERSION/go-ipfs_$VERSION_darwin-amd64.tar.gz # darwin 64-bit build -$ ipfs get /ipns/dist.ipfs.io/go-ipfs/$VERSION/go-ipfs_$VERSION_freebsd-amd64.tar.gz # freebsd 64-bit build -$ ipfs get /ipns/dist.ipfs.io/go-ipfs/$VERSION/go-ipfs_$VERSION_linux-386.tar.gz # linux 32-bit build -$ ipfs get /ipns/dist.ipfs.io/go-ipfs/$VERSION/go-ipfs_$VERSION_linux-amd64.tar.gz # linux 64-bit build -$ ipfs get /ipns/dist.ipfs.io/go-ipfs/$VERSION/go-ipfs_$VERSION_linux-arm.tar.gz # linux arm build -$ ipfs get /ipns/dist.ipfs.io/go-ipfs/$VERSION/go-ipfs_$VERSION_windows-amd64.zip # windows 64-bit build +$ ipfs get /ipns/dist.ipfs.tech/go-ipfs/$VERSION/go-ipfs_$VERSION_darwin-386.tar.gz # darwin 32-bit build +$ ipfs get /ipns/dist.ipfs.tech/go-ipfs/$VERSION/go-ipfs_$VERSION_darwin-amd64.tar.gz # darwin 64-bit build +$ ipfs get /ipns/dist.ipfs.tech/go-ipfs/$VERSION/go-ipfs_$VERSION_freebsd-amd64.tar.gz # freebsd 64-bit build +$ ipfs get /ipns/dist.ipfs.tech/go-ipfs/$VERSION/go-ipfs_$VERSION_linux-386.tar.gz # linux 32-bit build +$ ipfs get /ipns/dist.ipfs.tech/go-ipfs/$VERSION/go-ipfs_$VERSION_linux-amd64.tar.gz # linux 64-bit build +$ ipfs get /ipns/dist.ipfs.tech/go-ipfs/$VERSION/go-ipfs_$VERSION_linux-arm.tar.gz # linux arm build +$ ipfs get /ipns/dist.ipfs.tech/go-ipfs/$VERSION/go-ipfs_$VERSION_windows-amd64.zip # windows 64-bit build ``` ## Getting Started ### Usage -[![docs: Command-line quick start](https://img.shields.io/static/v1?label=docs&message=Command-line%20quick%20start&color=blue&style=flat-square&cacheSeconds=3600)](https://docs.ipfs.io/how-to/command-line-quick-start/) -[![docs: Command-line reference](https://img.shields.io/static/v1?label=docs&message=Command-line%20reference&color=blue&style=flat-square&cacheSeconds=3600)](https://docs.ipfs.io/reference/cli/) +[![docs: Command-line quick start](https://img.shields.io/static/v1?label=docs&message=Command-line%20quick%20start&color=blue&style=flat-square&cacheSeconds=3600)](https://docs.ipfs.tech/how-to/command-line-quick-start/) +[![docs: Command-line reference](https://img.shields.io/static/v1?label=docs&message=Command-line%20reference&color=blue&style=flat-square&cacheSeconds=3600)](https://docs.ipfs.tech/reference/kubo/cli/) To start using IPFS, you must first initialize IPFS's config files on your system, this is done with `ipfs init`. See `ipfs init --help` for information on @@ -385,13 +385,13 @@ Basic proof of 'ipfs working' locally: 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. -Please direct general questions and help requests to our [forum](https://discuss.ipfs.io) or our IRC channel (freenode #ipfs). +Please direct general questions and help requests to our [forums](https://discuss.ipfs.tech). -If you believe you've found a bug, check the [issues list](https://github.com/ipfs/kubo/issues) and, if you don't see your problem there, either come talk to us on [Matrix chat](https://docs.ipfs.io/community/chat/), or file an issue of your own! +If you believe you've found a bug, check the [issues list](https://github.com/ipfs/kubo/issues) and, if you don't see your problem there, either come talk to us on [Matrix chat](https://docs.ipfs.tech/community/chat/), or file an issue of your own! ## Packages -See [IPFS in GO](https://docs.ipfs.io/reference/go/api/) documentation. +See [IPFS in GO](https://docs.ipfs.tech/reference/go/api/) documentation. ## Development @@ -446,7 +446,7 @@ We ❤️ all [our contributors](docs/AUTHORS); this project wouldn’t be what This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). -Please reach out to us in one [chat](https://docs.ipfs.io/community/chat/) rooms. +Please reach out to us in one [chat](https://docs.ipfs.tech/community/chat/) rooms. ## License diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 907bdabf3a9..2e1f2c4f1bc 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -292,7 +292,7 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment if !domigrate { fmt.Println("Not running migrations of fs-repo now.") - fmt.Println("Please get fs-repo-migrations from https://dist.ipfs.io") + fmt.Println("Please get fs-repo-migrations from https://dist.ipfs.tech") return fmt.Errorf("fs-repo requires migration") } @@ -806,6 +806,12 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e return nil, fmt.Errorf("serveHTTPGateway: ConstructNode() failed: %s", err) } + if len(listeners) > 0 { + if err := node.Repo.SetGatewayAddr(listeners[0].Addr()); err != nil { + return nil, fmt.Errorf("serveHTTPGateway: SetGatewayAddr() failed: %w", err) + } + } + errc := make(chan error) var wg sync.WaitGroup for _, lis := range listeners { diff --git a/core/builder.go b/core/builder.go index 2b84c6d8399..aacb51884bd 100644 --- a/core/builder.go +++ b/core/builder.go @@ -15,6 +15,37 @@ import ( "go.uber.org/fx" ) +// FXNodeInfo contains information useful for adding fx options. +// This is the extension point for providing more info/context to fx plugins +// to make decisions about what options to include. +type FXNodeInfo struct { + FXOptions []fx.Option +} + +// fxOptFunc takes in some info about the IPFS node and returns the full set of fx opts to use. +type fxOptFunc func(FXNodeInfo) ([]fx.Option, error) + +var fxOptionFuncs []fxOptFunc + +// RegisterFXOptionFunc registers a function that is run before the fx app is initialized. +// Functions are invoked in the order they are registered, +// and the resulting options are passed into the next function's FXNodeInfo. +// +// Note that these are applied globally, by all invocations of NewNode. +// There are multiple places in Kubo that construct nodes, such as: +// - Repo initialization +// - Daemon initialization +// - When running migrations +// - etc. +// +// If your fx options are doing anything sophisticated, you should keep this in mind. +// +// For example, if you plug in a blockservice that disallows non-allowlisted CIDs, +// this may break migrations that fetch migration code over IPFS. +func RegisterFXOptionFunc(optFunc fxOptFunc) { + fxOptionFuncs = append(fxOptionFuncs, optFunc) +} + // from https://stackoverflow.com/a/59348871 type valueContext struct { context.Context @@ -41,12 +72,21 @@ func NewNode(ctx context.Context, cfg *BuildCfg) (*IpfsNode, error) { ctx: ctx, } - app := fx.New( + opts := []fx.Option{ node.IPFS(ctx, cfg), - fx.NopLogger, - fx.Extract(n), - ) + } + for _, optFunc := range fxOptionFuncs { + var err error + opts, err = optFunc(FXNodeInfo{FXOptions: opts}) + if err != nil { + cancel() + return nil, fmt.Errorf("building fx opts: %w", err) + } + } + opts = append(opts, fx.Extract(n)) + + app := fx.New(opts...) var once sync.Once var stopErr error diff --git a/core/corehttp/hostname.go b/core/corehttp/hostname.go index 658eb34d4b2..4d648d294ea 100644 --- a/core/corehttp/hostname.go +++ b/core/corehttp/hostname.go @@ -324,7 +324,7 @@ func isKnownHostname(hostname string, knownGateways gatewayHosts) (gw *config.Ga func knownSubdomainDetails(hostname string, knownGateways gatewayHosts) (gw *config.GatewaySpec, gwHostname, ns, rootID string, ok bool) { labels := strings.Split(hostname, ".") // Look for FQDN of a known gateway hostname. - // Example: given "dist.ipfs.io.ipns.dweb.link": + // Example: given "dist.ipfs.tech.ipns.dweb.link": // 1. Lookup "link" TLD in knownGateways: negative // 2. Lookup "dweb.link" in knownGateways: positive // diff --git a/core/corehttp/hostname_test.go b/core/corehttp/hostname_test.go index c2aa9b75726..60b53723994 100644 --- a/core/corehttp/hostname_test.go +++ b/core/corehttp/hostname_test.go @@ -91,7 +91,7 @@ func TestToDNSLinkFQDN(t *testing.T) { out string }{ {"singlelabel", "singlelabel"}, - {"docs-ipfs-io", "docs.ipfs.io"}, + {"docs-ipfs-tech", "docs.ipfs.tech"}, {"dnslink-long--name-example-com", "dnslink.long-name.example.com"}, } { out := toDNSLinkFQDN(test.in) @@ -261,7 +261,7 @@ func TestKnownSubdomainDetails(t *testing.T) { // dnslink in subdomain {"en.wikipedia-on-ipfs.org.ipns.localhost:8080", gwLocalhost, "localhost:8080", "ipns", "en.wikipedia-on-ipfs.org", true}, {"en.wikipedia-on-ipfs.org.ipns.localhost", gwLocalhost, "localhost", "ipns", "en.wikipedia-on-ipfs.org", true}, - {"dist.ipfs.io.ipns.localhost:8080", gwLocalhost, "localhost:8080", "ipns", "dist.ipfs.io", true}, + {"dist.ipfs.tech.ipns.localhost:8080", gwLocalhost, "localhost:8080", "ipns", "dist.ipfs.tech", true}, {"en.wikipedia-on-ipfs.org.ipns.dweb.link", gwDweb, "dweb.link", "ipns", "en.wikipedia-on-ipfs.org", true}, // edge case check: public gateway under long TLD (see: https://publicsuffix.org) {"foo.dweb.ipfs.pvt.k12.ma.us", nil, "", "", "", false}, diff --git a/core/node/groups.go b/core/node/groups.go index bb27a24f3eb..9f1795e1fe8 100644 --- a/core/node/groups.go +++ b/core/node/groups.go @@ -139,7 +139,7 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option { if cfg.Swarm.EnableRelayHop { logger.Fatal("The `Swarm.EnableRelayHop` config field was removed.\n" + "Use `Swarm.RelayService` to configure the circuit v2 relay.\n" + - "If you want to continue running a circuit v1 relay, please use the standalone relay daemon: https://dist.ipfs.io/#libp2p-relay-daemon (with RelayV1.Enabled: true)") + "If you want to continue running a circuit v1 relay, please use the standalone relay daemon: https://dist.ipfs.tech/#libp2p-relay-daemon (with RelayV1.Enabled: true)") } peerChan := make(libp2p.AddrInfoChan) diff --git a/docs/PATCH_RELEASE_TEMPLATE.md b/docs/PATCH_RELEASE_TEMPLATE.md index aaba58ce9f8..e777f8ad2c4 100644 --- a/docs/PATCH_RELEASE_TEMPLATE.md +++ b/docs/PATCH_RELEASE_TEMPLATE.md @@ -10,20 +10,20 @@ This process handles patch releases from version `vX.Y.Z` to `vX.Y.Z+1` assuming - [ ] Make a PR merging `release-vX.Y.Z+1` into the release branch - This may be unnecessary, e.g. for backports - [ ] Tag the merge commit in the `release` branch with `vX.Y.Z+1` (ensure the tag is signed) -- [ ] Upload to dist.ipfs.io - 1. Build: https://github.com/ipfs/distributions#usage. - 2. Pin the resulting release. - 3. Make a PR against ipfs/distributions with the updated versions, including the new hash in the PR comment. - - Note the DNSLink record for `dist.ipfs.io` points to the new distribution as part of [CI after merging into master](https://github.com/ipfs/distributions/blob/master/.github/workflows/main.yml#L154-L156). -- [ ] cut a release on [github](https://github.com/ipfs/go-ipfs/releases) and upload the result of the ipfs/distributions build in the previous step. +- [ ] Add artifacts to https://dist.ipfs.tech/kubo + 1. Make a PR against [ipfs/distributions](https://github.com/ipfs/distributions) with local changes produced by `add-version` (see [usage](https://github.com/ipfs/distributions#usage)) + 2. Wait for PR to build artifacts and generate diff + 3. Inspect results, merge if CI is green and the diff looks ok + 4. Wait for `master` branch to build and update DNSLink at https://dist.ipfs.tech +- [ ] Cut a release on [github](https://github.com/ipfs/kubo/releases) and reuse signed artifacts from https://dist.ipfs.tech/kubo (run [sync-release-assets.yml workflow](https://github.com/ipfs/kubo/actions/workflows/sync-release-assets.yml)). - [ ] Announce the Release: - - [ ] On [discuss.ipfs.io](https://discuss.ipfs.io) + - [ ] On [discuss.ipfs.tech](https://discuss.ipfs.tech) - This will automatically post to Matrix (`#lobby:ipfs.io`) and IPFS Discord (`#ipfs-chatter`) - - Examples from the past: [0.13.1](https://discuss.ipfs.io/t/go-ipfs-v0-13-1-has-been-released/14599) + - Examples from the past: [0.13.1](https://discuss.ipfs.tech/t/go-ipfs-v0-13-1-has-been-released/14599) - [ ] Pin the discuss topic - [ ] Release published - - [ ] to [dist.ipfs.io](https://dist.ipfs.io) - - [ ] to [npm](https://www.npmjs.com/package/go-ipfs) (should be done by [ipfs/npm-go-ipfs](https://github.com/ipfs/npm-go-ipfs), but ok to dispatch [this job](https://github.com/ipfs/npm-go-ipfs/actions/workflows/main.yml) manually) + - [ ] to [dist.ipfs.tech](https://dist.ipfs.tech) + - [ ] to [npm-go-ipfs](https://www.npmjs.com/package/go-ipfs) (should be done by [ipfs/npm-go-ipfs](https://github.com/ipfs/npm-go-ipfs), but ok to dispatch [this job](https://github.com/ipfs/npm-go-ipfs/actions/workflows/main.yml) manually) - [ ] to [chocolatey](https://chocolatey.org/packages/go-ipfs) (should be done by [ipfs/choco-go-ipfs](https://github.com/ipfs/choco-go-ipfs/), but ok to dispatch [this job](https://github.com/ipfs/choco-go-ipfs/actions/workflows/main.yml) manually) - [ ] to [snap](https://snapcraft.io/ipfs) (should happen automatically, see [snap/snapcraft.yaml](https://github.com/ipfs/kubo/blob/master/snap/snapcraft.yaml)) - [ ] to [github](https://github.com/ipfs/kubo/releases) diff --git a/docs/README.md b/docs/README.md index 7d867d3099b..78235622a6a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # Developer Documentation and Guides -If you are looking for User Documentation & Guides, please visit [docs.ipfs.io](https://docs.ipfs.io/). +If you are looking for User Documentation & Guides, please visit [docs.ipfs.tech](https://docs.ipfs.tech/). If you’re experiencing an issue with IPFS, **please follow [our issue guide](github-issue-guide.md) when filing an issue!** diff --git a/docs/RELEASE_ISSUE_TEMPLATE.md b/docs/RELEASE_ISSUE_TEMPLATE.md index bfa3bbca0e6..922497e4101 100644 --- a/docs/RELEASE_ISSUE_TEMPLATE.md +++ b/docs/RELEASE_ISSUE_TEMPLATE.md @@ -24,11 +24,11 @@ For each RC published in each stage: - version string in `version.go` has been updated (in the `release-vX.Y.Z` branch). - tag commit with `vX.Y.Z-rcN` -- upload to dist.ipfs.io +- upload to dist.ipfs.tech 1. Build: https://github.com/ipfs/distributions#usage. 2. Pin the resulting release. 3. Make a PR against ipfs/distributions with the updated versions, including the new hash in the PR comment. - 4. Ask the infra team to update the DNSLink record for dist.ipfs.io to point to the new distribution. + 4. Ask the infra team to update the DNSLink record for dist.ipfs.tech to point to the new distribution. - cut a pre-release on [github](https://github.com/ipfs/kubo/releases) and upload the result of the ipfs/distributions build in the previous step. - Announce the RC: - [ ] On Matrix (both #ipfs and #ipfs-dev) @@ -79,13 +79,13 @@ Checklist: - [ ] Merge `release-vX.Y.Z` into the `release` branch. - [ ] Tag this merge commit (on the `release` branch) with `vX.Y.Z`. - [ ] Release published - - [ ] to [dist.ipfs.io](https://dist.ipfs.io) + - [ ] to [dist.ipfs.tech](https://dist.ipfs.tech) - [ ] to [npm-go-ipfs](https://github.com/ipfs/npm-go-ipfs) - [ ] to [chocolatey](https://chocolatey.org/packages/go-ipfs) - [ ] Manually run [the release workflow](https://github.com/ipfs/choco-go-ipfs/actions/workflows/main.yml) - [ ] to [snap](https://snapcraft.io/ipfs) - [ ] to [github](https://github.com/ipfs/go-ipfs/releases) - - [ ] use the artifacts built in CI for dist.ipfs.io: `wget "https://ipfs.io/api/v0/get?arg=/ipns/dist.ipfs.io/kubo/$(curl -s https://dist.ipfs.io/kubo/versions | tail -n 1)"` + - [ ] reuse signed artifacts from https://dist.ipfs.tech/kubo (run [sync-release-assets.yml workflow](https://github.com/ipfs/kubo/actions/workflows/sync-release-assets.yml)) - [ ] to [arch](https://www.archlinux.org/packages/community/x86_64/go-ipfs/) (flag it out of date) - [ ] Cut a new ipfs-desktop release - [ ] Submit [this form](https://airtable.com/shrNH8YWole1xc70I) to publish a blog post, linking to the GitHub release notes diff --git a/docs/changelogs/v0.10.md b/docs/changelogs/v0.10.md index aeecb37924d..b4bbf104798 100644 --- a/docs/changelogs/v0.10.md +++ b/docs/changelogs/v0.10.md @@ -31,7 +31,7 @@ This is significant refactor of a core component that touches many parts of IPFS * **IPLD plugins**: * The `PluginIPLD` interface has been changed to utilize go-ipld-prime. There is a demonstration of the change in the [bundled git plugin](./plugin/plugins/git/). * **The semantics of `dag put` and `dag get` change**: - * `dag get` now takes the `output-codec` option which accepts a [multicodec](https://docs.ipfs.io/concepts/glossary/#multicodec) name used to encode the output. By default this is `dag-json`, which is a strict and deterministic subset of JSON created by the IPLD team. Users may notice differences from the previously plain Go JSON output, particularly where bytes are concerned which are now encoded using a form similar to CIDs: `{"/":{"bytes":"unpadded-base64-bytes"}}` rather than the previously Go-specific plain padded base64 string. See the [dag-json specification](https://ipld.io/specs/codecs/dag-json/spec/) for an explanation of these forms. + * `dag get` now takes the `output-codec` option which accepts a [multicodec](https://docs.ipfs.tech/concepts/glossary/#multicodec) name used to encode the output. By default this is `dag-json`, which is a strict and deterministic subset of JSON created by the IPLD team. Users may notice differences from the previously plain Go JSON output, particularly where bytes are concerned which are now encoded using a form similar to CIDs: `{"/":{"bytes":"unpadded-base64-bytes"}}` rather than the previously Go-specific plain padded base64 string. See the [dag-json specification](https://ipld.io/specs/codecs/dag-json/spec/) for an explanation of these forms. * `dag get` no longer prints an additional new-line character at the end of the encoded block output. This means that the output as presented by `dag get` are the exact bytes of the requested node. A round-trip of such bytes back in through `dag put` using the same codec should result in the same CID. * `dag put` uses the `input-codec` option to specify the multicodec name of the format data is being provided in, and the `store-codec` option to specify the multicodec name of the format the data should be stored in at rest. These formerly defaulted to `json` and `cbor` respectively. They now default to `dag-json` and `dag-cbor` respectively but may be changed to any supported codec (bundled or loaded via plugin) by its [multicodec name](https://github.com/multiformats/multicodec/blob/master/table.csv). * The `json` and `cbor` multicodec names (as used by `input-enc` and `format` options) are now no longer aliases for `dag-json` and `dag-cbor` respectively. Instead, they now refer to their proper [multicodec](https://github.com/multiformats/multicodec/blob/master/table.csv) types. `cbor` refers to a plain CBOR format, which will not encode CIDs and does not have strict deterministic encoding rules. `json` is a plain JSON format, which also won't encode CIDs and will encode bytes in the Go-specific padded base64 string format rather than the dag-json method of byte encoding. See https://ipld.io/specs/codecs/ for more information on IPLD codecs. @@ -47,7 +47,7 @@ This is significant refactor of a core component that touches many parts of IPFS #### Ⓜ Multibase Command -go-ipfs now provides utility commands for working with [multibase](https://docs.ipfs.io/concepts/glossary/#multibase): +go-ipfs now provides utility commands for working with [multibase](https://docs.ipfs.tech/concepts/glossary/#multibase): ```console $ echo -n hello | ipfs multibase encode -b base16 > file-mbase16 diff --git a/docs/changelogs/v0.11.md b/docs/changelogs/v0.11.md index c7baa7f2538..9a3d2b7c930 100644 --- a/docs/changelogs/v0.11.md +++ b/docs/changelogs/v0.11.md @@ -31,9 +31,9 @@ As usual, this release includes important fixes, some of which may be critical f ### 🛠 BREAKING CHANGES - UnixFS sharding is now automatic and enabled by default - - HAMT-based sharding is applied to large directories (i.e. those that would serialize into [block](https://docs.ipfs.io/concepts/glossary/#block) larger than ~256KiB)s. This means importing data via commands like `ipfs add -r ` may result in different [CID](https://docs.ipfs.io/concepts/glossary/#cid)s due to the different [DAG](https://docs.ipfs.io/concepts/glossary/#dag) representations. + - HAMT-based sharding is applied to large directories (i.e. those that would serialize into [block](https://docs.ipfs.tech/concepts/glossary/#block) larger than ~256KiB)s. This means importing data via commands like `ipfs add -r ` may result in different [CID](https://docs.ipfs.tech/concepts/glossary/#cid)s due to the different [DAG](https://docs.ipfs.tech/concepts/glossary/#dag) representations. - Support for `Experimental.ShardingEnabled` is removed. -- go-ipfs can no longer act as a [Circuit Relay](https://docs.ipfs.io/concepts/glossary/#circuit-relay) v1 +- go-ipfs can no longer act as a [Circuit Relay](https://docs.ipfs.tech/concepts/glossary/#circuit-relay) v1 - Node will refuse to start if `Swarm.EnableRelayHop` is set to `true` - If you depend on v1 relay service provider, see "Removal of v1 relay service" section for available migration options. - HTTP RPC wire format for experimental commands at `/api/v0/pubsub` changed. @@ -46,7 +46,7 @@ Keep reading to learn more details. #### 🗃 Automatic UnixFS sharding -Truly big directories can have so many items, that the root block with all of their names is too big to be exchanged with other peers. This was partially solved by [HAMT-sharding](https://docs.ipfs.io/concepts/glossary/#hamt-sharding), which was introduced a while ago as opt-in. The main downside of the implementation was that it was a global flag that sharded all imported directories (big and small). +Truly big directories can have so many items, that the root block with all of their names is too big to be exchanged with other peers. This was partially solved by [HAMT-sharding](https://docs.ipfs.tech/concepts/glossary/#hamt-sharding), which was introduced a while ago as opt-in. The main downside of the implementation was that it was a global flag that sharded all imported directories (big and small). This release solves that inconvenience by making UnixFS sharding smarter and applies it only to larger directories (i.e. directories that would be at least ~256KiB). This is now the default behavior in `ipfs add` and `ipfs files` commands, where UnixFS sharding works out-of-the-box. @@ -54,7 +54,7 @@ This release solves that inconvenience by making UnixFS sharding smarter and app This release adds support for the [circuit relay v2](https://github.com/libp2p/specs/blob/master/relay/circuit-v2.md) protocol based on the reference implementation from [go-libp2p 0.16](https://github.com/libp2p/go-libp2p/releases/tag/v0.16.0). -This is the cornerstone for maximizing p2p connections between IPFS peers. Every publicly dialable peer can now act as a limited relay v2, which can be used for [hole punching](https://docs.ipfs.io/concepts/glossary/#hole-punching) and other decentralized signaling protocols. +This is the cornerstone for maximizing p2p connections between IPFS peers. Every publicly dialable peer can now act as a limited relay v2, which can be used for [hole punching](https://docs.ipfs.tech/concepts/glossary/#hole-punching) and other decentralized signaling protocols. ##### Limited relay v2 configuration options @@ -73,7 +73,7 @@ Switching to v2 of the relay spec means removal or deprecation of configuration - `Swarm.DisableRelay` is deprecated, relay transport can be now disabled globally (both client and service) by setting `Swarm.Transports.Network.Relay` to `false` - Relay v1 service provider was replaced by v2: - `Swarm.EnableRelayHop` no longer starts an unlimited v1 relay. If you have it set to `true` the node will refuse to start and display an error message. - - Existing users who choose to continue running a v1 relay should migrate their setups to relay v1 based on js-ipfs running in node, or the standalone [libp2p-relay-daemon](https://dist.ipfs.io/#libp2p-relay-daemon) [configured](https://github.com/libp2p/go-libp2p-relay-daemon/#configuration) with `RelayV1.Enabled` set to `true`. Be mindful that v1 relays are unlimited, and one may want to set up some ACL based either on PeerIDs or Subnets. + - Existing users who choose to continue running a v1 relay should migrate their setups to relay v1 based on js-ipfs running in node, or the standalone [libp2p-relay-daemon](https://dist.ipfs.tech/#libp2p-relay-daemon) [configured](https://github.com/libp2p/go-libp2p-relay-daemon/#configuration) with `RelayV1.Enabled` set to `true`. Be mindful that v1 relays are unlimited, and one may want to set up some ACL based either on PeerIDs or Subnets. #### 🕳 Decentralized Hole Punching (DCUtR protocol client) @@ -93,7 +93,7 @@ This release fixed some edge cases that were reported by users of the PubSub exp If you use the HTTP RPC API with the [go-ipfs-http-client](https://github.com/ipfs/go-ipfs-http-client) library, make sure to update to the latest version. The next version of [js-ipfs-http-client](https://www.npmjs.com/package/ipfs-http-client) will use the new wire format as well, so you don't need to do anything. -If you use `/api/v0/pubsub/*` directly or maintain your own client library, you must adjust your HTTP client code. Byte fields and URL args are now encoded in `base64url` [Multibase](https://docs.ipfs.io/concepts/glossary/#multibase). Encode/decode bytes using the `ipfs multibase --help` commands, or use the multiformats libraries ([js-multiformats](https://github.com/multiformats/js-multiformats#readme), [go-multibase](https://github.com/multiformats/go-multibase)). +If you use `/api/v0/pubsub/*` directly or maintain your own client library, you must adjust your HTTP client code. Byte fields and URL args are now encoded in `base64url` [Multibase](https://docs.ipfs.tech/concepts/glossary/#multibase). Encode/decode bytes using the `ipfs multibase --help` commands, or use the multiformats libraries ([js-multiformats](https://github.com/multiformats/js-multiformats#readme), [go-multibase](https://github.com/multiformats/go-multibase)). Low level changes: - `topic` passed as URL `arg` in requests to `/api/v0/pubsub/*` must be encoded in URL-safe multibase (`base64url`) diff --git a/docs/changelogs/v0.12.md b/docs/changelogs/v0.12.md index 42356f01422..85639dd2b86 100644 --- a/docs/changelogs/v0.12.md +++ b/docs/changelogs/v0.12.md @@ -58,7 +58,7 @@ As usual, this release includes important fixes, some of which may be critical f - `ipfs refs local` will now list all blocks as if they were [raw]() CIDv1 instead of with whatever CID version and IPLD codecs they were stored with. All other functionality should remain the same. -Note: This change also effects [ipfs-update](https://github.com/ipfs/ipfs-update) so if you use that tool to mange your go-ipfs installation then grab ipfs-update v1.8.0 from [dist](https://dist.ipfs.io/#ipfs-update). +Note: This change also effects [ipfs-update](https://github.com/ipfs/ipfs-update) so if you use that tool to mange your go-ipfs installation then grab ipfs-update v1.8.0 from [dist](https://dist.ipfs.tech/#ipfs-update). Keep reading to learn more details. @@ -68,7 +68,7 @@ There is only one change since 0.11: ##### Blockstore migration from full CID to Multihash keys -We are switching the default low level [datastore](https://docs.ipfs.io/concepts/glossary/#datastore) to be keyed only by the [Multihash](https://docs.ipfs.io/concepts/glossary/#multihash) part of the [CID](https://docs.ipfs.io/concepts/glossary/#cid), and deduplicate some [blocks](https://docs.ipfs.io/concepts/glossary/#block) in the process. The blockstore will become [codec](https://docs.ipfs.io/concepts/glossary/#codec)-agnostic. +We are switching the default low level [datastore](https://docs.ipfs.tech/concepts/glossary/#datastore) to be keyed only by the [Multihash](https://docs.ipfs.tech/concepts/glossary/#multihash) part of the [CID](https://docs.ipfs.tech/concepts/glossary/#cid), and deduplicate some [blocks](https://docs.ipfs.tech/concepts/glossary/#block) in the process. The blockstore will become [codec](https://docs.ipfs.tech/concepts/glossary/#codec)-agnostic. ###### Rationale @@ -127,7 +127,7 @@ It is also possible to revert the migration after it has succeeded, for example The revert process does not delete any blocks--it only makes sure that blocks that were accessible with CIDv1s before the migration are again keyed with CIDv1s. This may result in a datastore becoming twice as large (i.e. if all the blocks were CIDv1-addressed before the migration). This is however done this way to cover corner cases: user can add CIDv1s after migration, which may reference blocks that existed as CIDv0 before migration. The revert aims to ensure that no data becomes unavailable on downgrade. -While go-ipfs will auto-run the migration for you, it will not run the reversion. To do so you can download the [latest migration binary](https://dist.ipfs.io/fs-repo-11-to-12) or use [ipfs-update](https://dist.ipfs.io/#ipfs-update). +While go-ipfs will auto-run the migration for you, it will not run the reversion. To do so you can download the [latest migration binary](https://dist.ipfs.tech/fs-repo-11-to-12) or use [ipfs-update](https://dist.ipfs.tech/#ipfs-update). ###### Custom datastores @@ -140,7 +140,7 @@ For this migration, if your datastore has fast renames you may want to consider - github.com/ipfs/go-ipfs: - Release v0.12.0 - docs: v0.12.0 release notes - - chore: bump migrations dist.ipfs.io CID to contain fs-repo-11-to-12 v1.0.2 + - chore: bump migrations dist.ipfs.tech CID to contain fs-repo-11-to-12 v1.0.2 - feat: refactor Fetcher interface used for downloading migrations (#8728) ([ipfs/go-ipfs#8728](https://github.com/ipfs/go-ipfs/pull/8728)) - feat: log multifetcher errors - Release v0.12.0-rc1 diff --git a/docs/changelogs/v0.13.md b/docs/changelogs/v0.13.md index 3386fb3c79d..9c524cf4a2a 100644 --- a/docs/changelogs/v0.13.md +++ b/docs/changelogs/v0.13.md @@ -6,7 +6,7 @@ Full Changelog This release includes security fixes for various DOS vectors when importing untrusted user input with `ipfs dag import` -and the [`v0/dag/import`](https://docs.ipfs.io/reference/http/api/#api-v0-dag-import) endpoint. +and the [`v0/dag/import`](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-dag-import) endpoint. View the linked [security advisory](https://github.com/ipfs/go-ipfs/security/advisories/GHSA-f2gr-7299-487h) for more information. @@ -215,7 +215,7 @@ For now, `{format}` is limited to two options: When not set, the default UnixFS response is returned. -*Why these two formats?* Requesting Block or CAR for `/ipfs/{cid}` allows a client to **use gateways in a trustless fashion**. These types of gateway responses can be verified locally and rejected if digest inside of requested CID does not match received bytes. This enables creation of "light IPFS clients" which use HTTP Gateways as inexpensive transport for [content-addressed](https://docs.ipfs.io/concepts/content-addressing/) data, unlocking use in Mobile and IoT contexts. +*Why these two formats?* Requesting Block or CAR for `/ipfs/{cid}` allows a client to **use gateways in a trustless fashion**. These types of gateway responses can be verified locally and rejected if digest inside of requested CID does not match received bytes. This enables creation of "light IPFS clients" which use HTTP Gateways as inexpensive transport for [content-addressed](https://docs.ipfs.tech/concepts/content-addressing/) data, unlocking use in Mobile and IoT contexts. Future releases will [add support for dag-json and dag-cbor responses](https://github.com/ipfs/go-ipfs/issues/8823). @@ -280,7 +280,7 @@ Gateway evaluates Etags sent by a client in [`If-None-Match`](https://developer. `X-Ipfs-Roots` is now returned with every Gateway response. It is a way to indicate all CIDs required for resolving path segments from `X-Ipfs-Path`. Together, these two headers are meant to improve interop with existing HTTP software (load-balancers, caches, CDNs). -This additional information allows HTTP caches and CDNs to make better decisions around cache invalidation: not just invalidate everything under specific IPNS website when the root changes, but do more fine-grained cache invalidation by detecting when only a specific subdirectory (branch of a [DAG](https://docs.ipfs.io/concepts/glossary/#dag)) changes. +This additional information allows HTTP caches and CDNs to make better decisions around cache invalidation: not just invalidate everything under specific IPNS website when the root changes, but do more fine-grained cache invalidation by detecting when only a specific subdirectory (branch of a [DAG](https://docs.ipfs.tech/concepts/glossary/#dag)) changes. ##### 🌡️ Added metrics per response type @@ -368,12 +368,12 @@ Docker images published at https://hub.docker.com/r/ipfs/go-ipfs/ now support c Scripts are executed sequentially and in lexicographic order, before the IPFS daemon is started and after `ipfs init` is run and the swarm keys are copied (if the IPFS repo needs initialization). For more information, see: -- Documentation: [ Run IPFS inside Docker](https://docs.ipfs.io/how-to/run-ipfs-inside-docker/) +- Documentation: [ Run IPFS inside Docker](https://docs.ipfs.tech/how-to/run-ipfs-inside-docker/) - Examples in [ipfs-shipyard/go-ipfs-docker-examples](https://github.com/ipfs-shipyard/go-ipfs-docker-examples). #### RPC API docs for experimental and deprecated commands -https://docs.ipfs.io/reference/http/api/ now includes separate sections for _experimental_ and _deprecated_ commands. +https://docs.ipfs.tech/reference/kubo/rpc/ now includes separate sections for _experimental_ and _deprecated_ commands. We also display a warning in the command line: diff --git a/docs/changelogs/v0.14.md b/docs/changelogs/v0.14.md index 4d52cc42bd2..d725c137454 100644 --- a/docs/changelogs/v0.14.md +++ b/docs/changelogs/v0.14.md @@ -51,13 +51,13 @@ We've renamed Go-IPFS to Kubo ([details](https://github.com/ipfs/go-ipfs/issues/ Published artifacts use `kubo` now, and are available at: -- https://dist.ipfs.io/kubo/ +- https://dist.ipfs.tech/kubo/ - https://hub.docker.com/r/ipfs/kubo/ To minimize the impact on infrastructure that autoupdates on a new release, the same binaries are still published under the old name at: -- https://dist.ipfs.io/go-ipfs/ +- https://dist.ipfs.tech/go-ipfs/ - https://hub.docker.com/r/ipfs/go-ipfs/ The libp2p identify useragent of Kubo has also been changed from `go-ipfs` to `kubo`. @@ -70,7 +70,7 @@ See `ipfs repo migrate --help` for more info. #### 🚀 Emoji support in Multibase -Kubo now supports [`base256emoji`](https://github.com/multiformats/multibase/blob/master/rfcs/Base256Emoji.md) encoding in all [Multibase](https://docs.ipfs.io/concepts/glossary/#multibase) contexts. Use it for testing Unicode support, as visual aid while explaining Multiformats, or just for fun: +Kubo now supports [`base256emoji`](https://github.com/multiformats/multibase/blob/master/rfcs/Base256Emoji.md) encoding in all [Multibase](https://docs.ipfs.tech/concepts/glossary/#multibase) contexts. Use it for testing Unicode support, as visual aid while explaining Multiformats, or just for fun: ```console $ echo -n "test" | ipfs multibase encode -b base256emoji - diff --git a/docs/changelogs/v0.4.md b/docs/changelogs/v0.4.md index 7a3691c94f4..7096d23272a 100644 --- a/docs/changelogs/v0.4.md +++ b/docs/changelogs/v0.4.md @@ -1237,7 +1237,7 @@ To initialize a go-ipfs instance with a randomly chosen port, run: #### 👂 Gateway Directory Listing IPNS (and/or DNSLink) directory listings on the gateway, e.g. -https://ipfs.io/ipns/dist.ipfs.io/go-ipfs/, will now display the _ipfs_ hash of +https://ipfs.io/ipns/dist.ipfs.tech/go-ipfs/, will now display the _ipfs_ hash of the current directory. This way users can more easily create permanent links to otherwise mutable data. @@ -3705,7 +3705,7 @@ This is the first Release Candidate. Unless there are vulnerabilities or regress - Security Vulnerability - The `master` branch if go-ipfs suffered from a vulnerability for about 3 weeks. It allowed an attacker to use an iframe to request malicious HTML and JS from the API of a local go-ipfs node. The attacker could then gain unrestricted access to the node's API, and e.g. extract the private key. We fixed this issue by reintroducing restrictions on which particular objects can be loaded through the API (@lgierth, [ipfs/go-ipfs#2949](https://github.com/ipfs/go-ipfs/pull/2949)), and by completely excluding the private key from the API (@Kubuxu, [ipfs/go-ipfs#2957](https://github.com/ipfs/go-ipfs/pull/2957)). We will also work on more hardening of the API in the next release. - - **The previous release 0.4.2 is not vulnerable. That means if you're using official binaries from [dist.ipfs.io](https://dist.ipfs.io) you're not affected.** If you're running go-ipfs built from the `master` branch between June 17th ([ipfs/go-ipfs@1afebc21](https://github.com/ipfs/go-ipfs/commit/1afebc21f324982141ca8a29710da0d6f83ca804)) and July 7th ([ipfs/go-ipfs@39bef0d5](https://github.com/ipfs/go-ipfs/commit/39bef0d5b01f70abf679fca2c4d078a2d55620e2)), please update to v0.4.3-rc1 immediately. + - **The previous release 0.4.2 is not vulnerable. That means if you're using official binaries from [dist.ipfs.tech](https://dist.ipfs.tech) you're not affected.** If you're running go-ipfs built from the `master` branch between June 17th ([ipfs/go-ipfs@1afebc21](https://github.com/ipfs/go-ipfs/commit/1afebc21f324982141ca8a29710da0d6f83ca804)) and July 7th ([ipfs/go-ipfs@39bef0d5](https://github.com/ipfs/go-ipfs/commit/39bef0d5b01f70abf679fca2c4d078a2d55620e2)), please update to v0.4.3-rc1 immediately. - We are grateful to the group of independent researchers who made us aware of this vulnerability. We wanna use this opportunity to reiterate that we're very happy about any additional review of pull requests and releases. You can contact us any time at security@ipfs.io (GPG [4B9665FB 92636D17 7C7A86D3 50AAE8A9 59B13AF3](https://pgp.mit.edu/pks/lookup?op=get&search=0x50AAE8A959B13AF3)). - Notable changes @@ -3860,12 +3860,12 @@ There are also a few other nice improvements. * Update gx and gx-go. (@chriscool) * Make blocks.Block an interface. (@kevina) * Silence check for Docker existance. (@chriscool) - * Add dist_get script for fetching tools from dist.ipfs.io. (@whyrusleeping) + * Add dist_get script for fetching tools from dist.ipfs.tech. (@whyrusleeping) * Add proper defaults to all `ipfs` commands. (@richardlitt) * Remove dead `count` option from `ipfs pin ls`. (@richardlitt) * Initialize pin mode strings only once. (@chriscool) * Add changelog for v0.4.2. (@lgierth) - * Specify a dist.ipfs.io hash for tool downloads instead of trusting DNS. (@lgierth) + * Specify a dist.ipfs.tech hash for tool downloads instead of trusting DNS. (@lgierth) * CI * Fix t0170-dht sharness test. (@chriscool) diff --git a/docs/changelogs/v0.5.md b/docs/changelogs/v0.5.md index ebbf6fc2dc0..0fa48884529 100644 --- a/docs/changelogs/v0.5.md +++ b/docs/changelogs/v0.5.md @@ -514,7 +514,7 @@ In general, migrations should not require significant manual intervention. Howev * If you update go-ipfs with `ipfs update`, `ipfs update` will run the migration for you. Note: `ipfs update` will refuse to run the migrations while ipfs itself is running. * If you start the ipfs daemon with `ipfs daemon --migrate`, ipfs will migrate your repo for you on start. -Otherwise, if you want more control over the repo migration process, you can manually install and run the [repo migration tool](http://dist.ipfs.io/#fs-repo-migrations). +Otherwise, if you want more control over the repo migration process, you can manually install and run the [repo migration tool](http://dist.ipfs.tech/#fs-repo-migrations). ##### Bootstrap Peer Changes diff --git a/docs/changelogs/v0.7.md b/docs/changelogs/v0.7.md index 63122ba3744..f962a680081 100644 --- a/docs/changelogs/v0.7.md +++ b/docs/changelogs/v0.7.md @@ -51,9 +51,9 @@ Size: 30362191, NumBlocks: 346 #### Plugin build changes -We have changed the build flags used by the official binary distributions on dist.ipfs.io (or `/ipns/dist.ipfs.io`) to use the simpler and more reliable `-trimpath` flag instead of the more complicated and brittle `-asmflags=all=-trimpath="$(GOPATH)" -gcflags=all=-trimpath="$(GOPATH)"` flags, however the build flags used by default in go-ipfs remain the same. +We have changed the build flags used by the official binary distributions on dist.ipfs.tech (or `/ipns/dist.ipfs.tech`) to use the simpler and more reliable `-trimpath` flag instead of the more complicated and brittle `-asmflags=all=-trimpath="$(GOPATH)" -gcflags=all=-trimpath="$(GOPATH)"` flags, however the build flags used by default in go-ipfs remain the same. -The scripts in https://github.com/ipfs/go-ipfs-example-plugin have been updated to reflect this change. This is a breaking change to how people have been building plugins against the dist.ipfs.io binary of go-ipfs and plugins should update their build processes accordingly see https://github.com/ipfs/go-ipfs-example-plugin/pull/9 for details. +The scripts in https://github.com/ipfs/go-ipfs-example-plugin have been updated to reflect this change. This is a breaking change to how people have been building plugins against the dist.ipfs.tech binary of go-ipfs and plugins should update their build processes accordingly see https://github.com/ipfs/go-ipfs-example-plugin/pull/9 for details. ### Changelog diff --git a/docs/changelogs/v0.9.md b/docs/changelogs/v0.9.md index a735a255a08..e210c7c2481 100644 --- a/docs/changelogs/v0.9.md +++ b/docs/changelogs/v0.9.md @@ -136,7 +136,7 @@ This means faster download times for upgrades, a much easier time building migra ##### Configurable migration downloads enable downloading over IPFS -Previously the migration downloader built into go-ipfs downloaded the migrations from [dist.ipfs.io](https://dist.ipfs.io). While users could use tools like [ipfs-update](https://github.com/ipfs/ipfs-update) to download the migrations over IPFS or manually download the migrations (over IPFS or otherwise) themselves, this is now automated and configurable. Users can choose to download the migrations over IPFS or from any specified IPFS Gateway. +Previously the migration downloader built into go-ipfs downloaded the migrations from [dist.ipfs.tech](https://dist.ipfs.tech). While users could use tools like [ipfs-update](https://github.com/ipfs/ipfs-update) to download the migrations over IPFS or manually download the migrations (over IPFS or otherwise) themselves, this is now automated and configurable. Users can choose to download the migrations over IPFS or from any specified IPFS Gateway. The configurable migration options are described in the config file [documentation](https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#migration), although most users should not need to change the default settings. @@ -159,7 +159,7 @@ While the Object API and commands are still usable they are now marked as deprec ##### `X-Ipfs-Gateway-Prefix` is now deprecated -IPFS community moved towards dedicated Origins (DNSLink and [subdomain gateways](https://docs.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway)) which are much easier to isolate and reason about. +IPFS community moved towards dedicated Origins (DNSLink and [subdomain gateways](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway)) which are much easier to isolate and reason about. Setting up `Gateway.PathPrefixes` and `X-Ipfs-Gateway-Prefix` is no longer necessary and support [will be removed in near future](https://github.com/ipfs/go-ipfs/issues/7702). diff --git a/docs/config.md b/docs/config.md index 6189b122494..7263f4ffa48 100644 --- a/docs/config.md +++ b/docs/config.md @@ -46,6 +46,7 @@ config file at runtime. - [`Discovery.MDNS`](#discoverymdns) - [`Discovery.MDNS.Enabled`](#discoverymdnsenabled) - [`Discovery.MDNS.Interval`](#discoverymdnsinterval) + - [`Experimental`](#experimental) - [`Gateway`](#gateway) - [`Gateway.NoFetch`](#gatewaynofetch) - [`Gateway.NoDNSLink`](#gatewaynodnslink) @@ -599,6 +600,10 @@ Type: `bool` **REMOVED:** this is not configurable any more in the [new mDNS implementation](https://github.com/libp2p/zeroconf#readme). +## `Experimental` + +Toggle and configure experimental features of Kubo. Experimental features are listed [here](./experimental-features.md). + ## `Gateway` Options for the HTTP gateway. @@ -748,7 +753,7 @@ Type: `array[string]` A boolean to configure whether the gateway at the hostname provides [Origin isolation](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) between content roots. -- `true` - enables [subdomain gateway](#https://docs.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://*.{hostname}/` +- `true` - enables [subdomain gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://*.{hostname}/` - **Requires whitelist:** make sure respective `Paths` are set. For example, `Paths: ["/ipfs", "/ipns"]` are required for `http://{cid}.ipfs.{hostname}` and `http://{foo}.ipns.{hostname}` to work: ```json @@ -764,7 +769,7 @@ between content roots. - **Backward-compatible:** requests for content paths such as `http://{hostname}/ipfs/{cid}` produce redirect to `http://{cid}.ipfs.{hostname}` - **API:** if `/api` is on the `Paths` whitelist, `http://{hostname}/api/{cmd}` produces redirect to `http://api.{hostname}/api/{cmd}` -- `false` - enables [path gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#path-gateway) at `http://{hostname}/*` +- `false` - enables [path gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#path-gateway) at `http://{hostname}/*` - Example: ```json "Gateway": { @@ -821,7 +826,7 @@ $ ipfs config --json Gateway.PublicGateways '{"localhost": null }' Below is a list of the most common public gateway setups. -* Public [subdomain gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://{cid}.ipfs.dweb.link` (each content root gets its own Origin) +* Public [subdomain gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://{cid}.ipfs.dweb.link` (each content root gets its own Origin) ```console $ ipfs config --json Gateway.PublicGateways '{ "dweb.link": { @@ -845,7 +850,7 @@ Below is a list of the most common public gateway setups. `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.example.com` -* Public [path gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#path-gateway) at `http://ipfs.io/ipfs/{cid}` (no Origin separation) +* Public [path gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#path-gateway) at `http://ipfs.io/ipfs/{cid}` (no Origin separation) ```console $ ipfs config --json Gateway.PublicGateways '{ "ipfs.io": { @@ -861,7 +866,7 @@ Below is a list of the most common public gateway setups. ``` * Note that `NoDNSLink: false` is the default (it works out of the box unless set to `true` manually) -* Hardened, site-specific [DNSLink gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#dnslink-gateway). +* Hardened, site-specific [DNSLink gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#dnslink-gateway). Disable fetching of remote data (`NoFetch: true`) and resolving DNSLink at unknown hostnames (`NoDNSLink: true`). Then, enable DNSLink gateway only for the specific hostname (for which data @@ -1931,7 +1936,7 @@ Type: `priority` ## `DNS` -Options for configuring DNS resolution for [DNSLink](https://docs.ipfs.io/concepts/dnslink/) and `/dns*` [Multiaddrs](https://github.com/multiformats/multiaddr/). +Options for configuring DNS resolution for [DNSLink](https://docs.ipfs.tech/concepts/dnslink/) and `/dns*` [Multiaddrs](https://github.com/multiformats/multiaddr/). ### `DNS.Resolvers` diff --git a/docs/gateway.md b/docs/gateway.md index 2f8c9182523..b24d10f0c19 100644 --- a/docs/gateway.md +++ b/docs/gateway.md @@ -4,15 +4,15 @@ An IPFS Gateway acts as a bridge between traditional web browsers and IPFS. Through the gateway, users can browse files and websites stored in IPFS as if they were stored in a traditional web server. -[More about Gateways](https://docs.ipfs.io/concepts/ipfs-gateway/) and [addressing IPFS on the web](https://docs.ipfs.io/how-to/address-ipfs-on-web/). +[More about Gateways](https://docs.ipfs.tech/concepts/ipfs-gateway/) and [addressing IPFS on the web](https://docs.ipfs.tech/how-to/address-ipfs-on-web/). Kubo's Gateway implementation follows [ipfs/specs: Specification for HTTP Gateways](https://github.com/ipfs/specs/tree/main/http-gateways#readme). ### Local gateway By default, Kubo nodes run -a [path gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#path-gateway) at `http://127.0.0.1:8080/` -and a [subdomain gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://localhost:8080/` +a [path gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#path-gateway) at `http://127.0.0.1:8080/` +and a [subdomain gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://localhost:8080/` Additional listening addresses and gateway behaviors can be set in the [config](#configuration) file. @@ -53,8 +53,8 @@ for details ## Static Websites You can use an IPFS gateway to serve static websites at a custom domain using -[DNSLink](https://docs.ipfs.io/concepts/glossary#dnslink). See [Example: IPFS -Gateway](https://dnslink.io/#example-ipfs-gateway) for instructions. +[DNSLink](https://docs.ipfs.tech/concepts/glossary/#dnslink). See [Example: IPFS +Gateway](https://dnslink.dev/#example-ipfs-gateway) for instructions. ## Filenames diff --git a/docs/plugins.md b/docs/plugins.md index 1c321300481..1feca834c0c 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -48,6 +48,28 @@ application without IPC and without forking Kubo. Note: We eventually plan to make Kubo usable as a library. However, this plugin type is likely the best interim solution. +### fx (experimental) + +Fx plugins let you customize the [fx](https://pkg.go.dev/go.uber.org/fx) dependency graph and configuration, +by customizing the`fx.Option`s that are passed to `fx` when the IPFS node is initialized. + +For example, you can inject custom implementations of interfaces such as [exchange.Interface](https://github.com/ipfs/go-ipfs-exchange-interface) +or [pin.Pinner](https://github.com/ipfs/go-ipfs-pinner) by adding an option like `fx.Replace(fx.Annotate(customExchange, fx.As(new(exchange.Interface))))`. + +Fx supports some advanced customization. Simple interface replacements like above are unlikely to break in the future, +but the more invasive your changes, the more likely they are to break between releases. Kubo cannot guarantee backwards +compatibility for invasive `fx` customizations. + +Fx options are applied across every execution of the `ipfs` binary, including: + +- Repo initialization +- Daemon +- Applying migrations +- etc. + +So if you plug in a blockservice that disallows non-allowlisted CIDs, then this may break migrations +that fetch migration code over IPFS. + ### Internal (never stable) diff --git a/docs/windows.md b/docs/windows.md index ed906dfdb21..590f270af32 100644 --- a/docs/windows.md +++ b/docs/windows.md @@ -1,7 +1,7 @@ # Building on Windows ![](https://ipfs.io/ipfs/QmccXW7JSZMVXidSc7tHsU6aktuaiV923q4yBGHUsdymYo/build.gif) -If you just want to install kubo, please download it from https://dist.ipfs.io/#kubo. This document explains how to build it from source. +If you just want to install kubo, please download it from https://dist.ipfs.tech/#kubo. This document explains how to build it from source. ## Install Go `kubo` is built on Golang and thus depends on it for all building methods. diff --git a/go.mod b/go.mod index 52488fdc107..27b5a410759 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/fsnotify/fsnotify v1.5.4 github.com/gabriel-vasile/mimetype v1.4.0 github.com/hashicorp/go-multierror v1.1.1 - github.com/ipfs/go-bitswap v0.8.0 + github.com/ipfs/go-bitswap v0.9.0 github.com/ipfs/go-block-format v0.0.3 github.com/ipfs/go-blockservice v0.4.0 github.com/ipfs/go-cid v0.2.0 @@ -57,7 +57,7 @@ require ( github.com/ipfs/go-pinning-service-http-client v0.1.1 github.com/ipfs/go-unixfs v0.4.0 github.com/ipfs/go-unixfsnode v1.4.0 - github.com/ipfs/go-verifcid v0.0.1 + github.com/ipfs/go-verifcid v0.0.2 github.com/ipfs/interface-go-ipfs-core v0.7.0 github.com/ipfs/tar-utils v0.0.2 github.com/ipld/go-car v0.4.0 @@ -88,7 +88,7 @@ require ( github.com/multiformats/go-multiaddr-dns v0.3.1 github.com/multiformats/go-multibase v0.1.0 github.com/multiformats/go-multicodec v0.5.0 - github.com/multiformats/go-multihash v0.2.0 + github.com/multiformats/go-multihash v0.2.1 github.com/opentracing/opentracing-go v1.2.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 @@ -113,7 +113,7 @@ require ( go.uber.org/zap v1.21.0 golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a ) require ( diff --git a/go.sum b/go.sum index 35c276367a3..1be40a58cc1 100644 --- a/go.sum +++ b/go.sum @@ -465,8 +465,9 @@ github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMi github.com/ipfs/go-bitswap v0.3.4/go.mod h1:4T7fvNv/LmOys+21tnLzGKncMeeXUYUd1nUiJ2teMvI= github.com/ipfs/go-bitswap v0.5.1/go.mod h1:P+ckC87ri1xFLvk74NlXdP0Kj9RmWAh4+H78sC6Qopo= github.com/ipfs/go-bitswap v0.6.0/go.mod h1:Hj3ZXdOC5wBJvENtdqsixmzzRukqd8EHLxZLZc3mzRA= -github.com/ipfs/go-bitswap v0.8.0 h1:UEV7kogQu2iGggkE9GhLykDrRCUpsNnpu2NODww/srw= github.com/ipfs/go-bitswap v0.8.0/go.mod h1:/h8sBij8UVEaNWl8ABzpLRA5Y1cttdNUnpeGo2AA/LQ= +github.com/ipfs/go-bitswap v0.9.0 h1:/dZi/XhUN/aIk78pI4kaZrilUglJ+7/SCmOHWIpiy8E= +github.com/ipfs/go-bitswap v0.9.0/go.mod h1:zkfBcGWp4dQTQd0D0akpudhpOVUAJT9GbH9tDmR8/s4= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= github.com/ipfs/go-block-format v0.0.3 h1:r8t66QstRp/pd/or4dpnbVfXT5Gt7lOqRvC+/dDTpMc= @@ -655,8 +656,9 @@ github.com/ipfs/go-unixfs v0.4.0/go.mod h1:I7Nqtm06HgOOd+setAoCU6rf/HgVFHE+peeNu github.com/ipfs/go-unixfsnode v1.1.2/go.mod h1:5dcE2x03pyjHk4JjamXmunTMzz+VUtqvPwZjIEkfV6s= github.com/ipfs/go-unixfsnode v1.4.0 h1:9BUxHBXrbNi8mWHc6j+5C580WJqtVw9uoeEKn4tMhwA= github.com/ipfs/go-unixfsnode v1.4.0/go.mod h1:qc7YFFZ8tABc58p62HnIYbUMwj9chhUuFWmxSokfePo= -github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2E= github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= +github.com/ipfs/go-verifcid v0.0.2 h1:XPnUv0XmdH+ZIhLGKg6U2vaPaRDXb9urMyNVCE7uvTs= +github.com/ipfs/go-verifcid v0.0.2/go.mod h1:40cD9x1y4OWnFXbLNJYRe7MpNvWlMn3LZAG5Wb4xnPU= github.com/ipfs/interface-go-ipfs-core v0.4.0/go.mod h1:UJBcU6iNennuI05amq3FQ7g0JHUkibHFAfhfUIy927o= github.com/ipfs/interface-go-ipfs-core v0.7.0 h1:7tb+2upz8oCcjIyjo1atdMk+P+u7wPmI+GksBlLE8js= github.com/ipfs/interface-go-ipfs-core v0.7.0/go.mod h1:lF27E/nnSPbylPqKVXGZghal2hzifs3MmjyiEjnc9FY= @@ -1277,8 +1279,8 @@ github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUj github.com/multiformats/go-multihash v0.0.15/go.mod h1:D6aZrWNLFTV/ynMpKsNtB40mJzmCl4jb1alC0OvHiHg= github.com/multiformats/go-multihash v0.0.16/go.mod h1:zhfEIgVnB/rPMfxgFw15ZmGoNaKyNUIE4IWHG/kC+Ag= github.com/multiformats/go-multihash v0.1.0/go.mod h1:RJlXsxt6vHGaia+S8We0ErjhojtKzPP2AH4+kYM7k84= -github.com/multiformats/go-multihash v0.2.0 h1:oytJb9ZA1OUW0r0f9ea18GiaPOo4SXyc7p2movyUuo4= -github.com/multiformats/go-multihash v0.2.0/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc= +github.com/multiformats/go-multihash v0.2.1 h1:aem8ZT0VA2nCHHk7bPJ1BjUbHNciqZC/d16Vve9l108= +github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc= github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= @@ -1924,8 +1926,9 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e h1:w36l2Uw3dRan1K3TyXriXvY+6T56GNmlKGcqiQUJDfM= golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= diff --git a/misc/systemd/ipfs-hardened.service b/misc/systemd/ipfs-hardened.service index dac21280e9c..261b82e2a06 100644 --- a/misc/systemd/ipfs-hardened.service +++ b/misc/systemd/ipfs-hardened.service @@ -18,7 +18,7 @@ [Unit] Description=InterPlanetary File System (IPFS) daemon -Documentation=https://docs.ipfs.io/ +Documentation=https://docs.ipfs.tech/ After=network.target [Service] diff --git a/misc/systemd/ipfs.service b/misc/systemd/ipfs.service index 52e8edb27ca..0051dffdd63 100644 --- a/misc/systemd/ipfs.service +++ b/misc/systemd/ipfs.service @@ -14,7 +14,7 @@ [Unit] Description=InterPlanetary File System (IPFS) daemon -Documentation=https://docs.ipfs.io/ +Documentation=https://docs.ipfs.tech/ After=network.target [Service] diff --git a/plugin/fx.go b/plugin/fx.go new file mode 100644 index 00000000000..90588942813 --- /dev/null +++ b/plugin/fx.go @@ -0,0 +1,20 @@ +package plugin + +import ( + "github.com/ipfs/kubo/core" + "go.uber.org/fx" +) + +// PluginFx can be used to customize the fx options passed to the go-ipfs app when it is initialized. +// +// This is invasive and depends on internal details such as the structure of the dependency graph, +// so breaking changes might occur between releases. +// So it's recommended to keep this as simple as possible, and stick to overriding interfaces +// with fx.Replace() or fx.Decorate(). +// +// The returned options become the complete array of options passed to fx. +// Generally you'll want to append additional options to NodeInfo.FXOptions and return that. +type PluginFx interface { + Plugin + Options(core.FXNodeInfo) ([]fx.Option, error) +} diff --git a/plugin/loader/loader.go b/plugin/loader/loader.go index 116c3dfce25..bb9c15befee 100644 --- a/plugin/loader/loader.go +++ b/plugin/loader/loader.go @@ -241,7 +241,6 @@ func (loader *PluginLoader) Inject() error { for _, pl := range loader.plugins { if pl, ok := pl.(plugin.PluginIPLD); ok { - err := injectIPLDPlugin(pl) if err != nil { loader.state = loaderFailed @@ -262,6 +261,13 @@ func (loader *PluginLoader) Inject() error { return err } } + if pl, ok := pl.(plugin.PluginFx); ok { + err := injectFxPlugin(pl) + if err != nil { + loader.state = loaderFailed + return err + } + } } return loader.transition(loaderInjecting, loaderInjected) @@ -347,3 +353,8 @@ func injectTracerPlugin(pl plugin.PluginTracer) error { opentracing.SetGlobalTracer(tracer) return nil } + +func injectFxPlugin(pl plugin.PluginFx) error { + core.RegisterFXOptionFunc(pl.Options) + return nil +} diff --git a/plugin/loader/preload.go b/plugin/loader/preload.go index 6b1607dc539..4304862119d 100644 --- a/plugin/loader/preload.go +++ b/plugin/loader/preload.go @@ -4,6 +4,7 @@ import ( pluginbadgerds "github.com/ipfs/kubo/plugin/plugins/badgerds" pluginiplddagjose "github.com/ipfs/kubo/plugin/plugins/dagjose" pluginflatfs "github.com/ipfs/kubo/plugin/plugins/flatfs" + pluginfxtest "github.com/ipfs/kubo/plugin/plugins/fxtest" pluginipldgit "github.com/ipfs/kubo/plugin/plugins/git" pluginlevelds "github.com/ipfs/kubo/plugin/plugins/levelds" pluginpeerlog "github.com/ipfs/kubo/plugin/plugins/peerlog" @@ -20,4 +21,5 @@ func init() { Preload(pluginflatfs.Plugins...) Preload(pluginlevelds.Plugins...) Preload(pluginpeerlog.Plugins...) + Preload(pluginfxtest.Plugins...) } diff --git a/plugin/loader/preload_list b/plugin/loader/preload_list index 048f4fd28e8..c18ea80ccd5 100644 --- a/plugin/loader/preload_list +++ b/plugin/loader/preload_list @@ -10,3 +10,4 @@ badgerds github.com/ipfs/kubo/plugin/plugins/badgerds * flatfs github.com/ipfs/kubo/plugin/plugins/flatfs * levelds github.com/ipfs/kubo/plugin/plugins/levelds * peerlog github.com/ipfs/kubo/plugin/plugins/peerlog * +fxtest github.com/ipfs/kubo/plugin/plugins/fxtest * diff --git a/plugin/plugins/fxtest/fxtest.go b/plugin/plugins/fxtest/fxtest.go new file mode 100644 index 00000000000..175dc6ec62b --- /dev/null +++ b/plugin/plugins/fxtest/fxtest.go @@ -0,0 +1,44 @@ +package fxtest + +import ( + "os" + + logging "github.com/ipfs/go-log" + "github.com/ipfs/kubo/core" + "github.com/ipfs/kubo/plugin" + "go.uber.org/fx" +) + +var log = logging.Logger("fxtestplugin") + +var Plugins = []plugin.Plugin{ + &fxtestPlugin{}, +} + +// fxtestPlugin is used for testing the fx plugin. +// It merely adds an fx option that logs a debug statement, so we can verify that it works in tests. +type fxtestPlugin struct{} + +var _ plugin.PluginFx = (*fxtestPlugin)(nil) + +func (p *fxtestPlugin) Name() string { + return "fx-test" +} + +func (p *fxtestPlugin) Version() string { + return "0.1.0" +} + +func (p *fxtestPlugin) Init(env *plugin.Environment) error { + return nil +} + +func (p *fxtestPlugin) Options(info core.FXNodeInfo) ([]fx.Option, error) { + opts := info.FXOptions + if os.Getenv("TEST_FX_PLUGIN") != "" { + opts = append(opts, fx.Invoke(func() { + log.Debug("invoked test fx function") + })) + } + return opts, nil +} diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index cbe1a31137c..cc11769bbae 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "io" + "net" "os" "path/filepath" "strings" @@ -63,6 +64,7 @@ func (err NoRepoError) Error() string { } const apiFile = "api" +const gatewayFile = "gateway" const swarmKeyFile = "swarm.key" const specFn = "datastore_spec" @@ -387,6 +389,44 @@ func (r *FSRepo) SetAPIAddr(addr ma.Multiaddr) error { return err } +// SetGatewayAddr writes the Gateway Addr to the /gateway file. +func (r *FSRepo) SetGatewayAddr(addr net.Addr) error { + // Create a temp file to write the address, so that we don't leave empty file when the + // program crashes after creating the file. + tmpPath := filepath.Join(r.path, "."+gatewayFile+".tmp") + f, err := os.Create(tmpPath) + if err != nil { + return err + } + var good bool + // Silently remove as worst last case with defers. + defer func() { + if !good { + os.Remove(tmpPath) + } + }() + defer f.Close() + + if _, err := fmt.Fprintf(f, "http://%s", addr.String()); err != nil { + return err + } + if err := f.Close(); err != nil { + return err + } + + // Atomically rename the temp file to the correct file name. + err = os.Rename(tmpPath, filepath.Join(r.path, gatewayFile)) + good = err == nil + if good { + return nil + } + // Remove the temp file when rename return error + if err1 := os.Remove(tmpPath); err1 != nil { + return fmt.Errorf("File Rename error: %w, File remove error: %s", err, err1.Error()) + } + return err +} + // openConfig returns an error if the config file is not present. func (r *FSRepo) openConfig() error { conf, err := serialize.Load(r.configFilePath) @@ -474,6 +514,11 @@ func (r *FSRepo) Close() error { log.Warn("error removing api file: ", err) } + err = os.Remove(filepath.Join(r.path, gatewayFile)) + if err != nil && !os.IsNotExist(err) { + log.Warn("error removing gateway file: ", err) + } + if err := r.ds.Close(); err != nil { return err } diff --git a/repo/fsrepo/migrations/fetch.go b/repo/fsrepo/migrations/fetch.go index c61e3a49ebd..986868f068d 100644 --- a/repo/fsrepo/migrations/fetch.go +++ b/repo/fsrepo/migrations/fetch.go @@ -173,7 +173,7 @@ func osWithVariant() (string, error) { // makeArchivePath composes the path, relative to the distribution site, from which to // download a binary. The path returned does not contain the distribution site path, -// e.g. "/ipns/dist.ipfs.io/", since that is know to the fetcher. +// e.g. "/ipns/dist.ipfs.tech/", since that is know to the fetcher. // // Returns the archive path and the base name. // diff --git a/repo/fsrepo/migrations/fetcher.go b/repo/fsrepo/migrations/fetcher.go index 6cdceffb1e6..87fa95b8b22 100644 --- a/repo/fsrepo/migrations/fetcher.go +++ b/repo/fsrepo/migrations/fetcher.go @@ -13,7 +13,7 @@ const ( // Current distribution to fetch migrations from CurrentIpfsDist = "/ipfs/QmdaCHYBDHEhXCMoynH5UcohEay6m1XayZCcxWZzKAHNVN" // fs-repo-11-to-12 v1.0.2 // Latest distribution path. Default for fetchers. - LatestIpfsDist = "/ipns/dist.ipfs.io" + LatestIpfsDist = "/ipns/dist.ipfs.tech" // Distribution environ variable envIpfsDistPath = "IPFS_DIST_PATH" diff --git a/repo/mock.go b/repo/mock.go index f33f64a2cc1..a50d448ed02 100644 --- a/repo/mock.go +++ b/repo/mock.go @@ -3,6 +3,7 @@ package repo import ( "context" "errors" + "net" filestore "github.com/ipfs/go-filestore" keystore "github.com/ipfs/go-ipfs-keystore" @@ -50,6 +51,8 @@ func (m *Mock) Close() error { return m.D.Close() } func (m *Mock) SetAPIAddr(addr ma.Multiaddr) error { return errTODO } +func (m *Mock) SetGatewayAddr(addr net.Addr) error { return errTODO } + func (m *Mock) Keystore() keystore.Keystore { return m.K } func (m *Mock) SwarmKey() ([]byte, error) { diff --git a/repo/repo.go b/repo/repo.go index c301fb39307..3c61031774b 100644 --- a/repo/repo.go +++ b/repo/repo.go @@ -4,6 +4,7 @@ import ( "context" "errors" "io" + "net" filestore "github.com/ipfs/go-filestore" keystore "github.com/ipfs/go-ipfs-keystore" @@ -51,6 +52,9 @@ type Repo interface { // SetAPIAddr sets the API address in the repo. SetAPIAddr(addr ma.Multiaddr) error + // SetGatewayAddr sets the Gateway address in the repo. + SetGatewayAddr(addr net.Addr) error + // SwarmKey returns the configured shared symmetric key for the private networks feature. SwarmKey() ([]byte, error) diff --git a/test/sharness/t0066-migration.sh b/test/sharness/t0066-migration.sh index 15e0da0ba6e..fa6a10e02fe 100755 --- a/test/sharness/t0066-migration.sh +++ b/test/sharness/t0066-migration.sh @@ -58,7 +58,7 @@ test_expect_success "ipfs daemon --migrate=false fails" ' ' test_expect_success "output looks good" ' - grep "Please get fs-repo-migrations from https://dist.ipfs.io" false_out + grep "Please get fs-repo-migrations from https://dist.ipfs.tech" false_out ' # The migrations will succeed, but the daemon will still exit with 1 because @@ -81,7 +81,7 @@ test_expect_success "'ipfs daemon' prompts to auto migrate" ' test_expect_success "output looks good" ' grep "Found outdated fs-repo" daemon_out > /dev/null && grep "Run migrations now?" daemon_out > /dev/null && - grep "Please get fs-repo-migrations from https://dist.ipfs.io" daemon_out > /dev/null + grep "Please get fs-repo-migrations from https://dist.ipfs.tech" daemon_out > /dev/null ' test_expect_success "ipfs repo migrate succeed" ' diff --git a/test/sharness/t0110-gateway.sh b/test/sharness/t0110-gateway.sh index a1e8f286491..484eefe4a0d 100755 --- a/test/sharness/t0110-gateway.sh +++ b/test/sharness/t0110-gateway.sh @@ -287,6 +287,12 @@ test_expect_success "GET compact blocks succeeds" ' test_cmp expected actual ' +test_expect_success "Verify gateway file" ' + cat "$IPFS_PATH/gateway" >> gateway_file_actual && + echo -n "http://$GWAY_ADDR" >> gateway_daemon_actual && + test_cmp gateway_daemon_actual gateway_file_actual +' + test_kill_ipfs_daemon diff --git a/test/sharness/t0275-cid-security.sh b/test/sharness/t0275-cid-security.sh index bfec54dd9b2..e8d26555052 100755 --- a/test/sharness/t0275-cid-security.sh +++ b/test/sharness/t0275-cid-security.sh @@ -23,7 +23,7 @@ test_expect_success "adding using too short of a hash function gives out an erro ' test_expect_success "error reason is pointed out" ' - grep "hashes must be at 20 least bytes long" block_out + grep "hashes must be at least 20 bytes long" block_out ' @@ -45,7 +45,7 @@ test_cat_get() { ' test_expect_success "error reason is pointed out" ' - grep "hashes must be at 20 least bytes long" ipfs_get + grep "hashes must be at least 20 bytes long" ipfs_get ' } diff --git a/test/sharness/t0280-plugin-fx.sh b/test/sharness/t0280-plugin-fx.sh new file mode 100755 index 00000000000..ca4d45f0784 --- /dev/null +++ b/test/sharness/t0280-plugin-fx.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +test_description="Test fx plugin" + +. lib/test-lib.sh + +test_init_ipfs + +export GOLOG_LOG_LEVEL="fxtestplugin=debug" +export TEST_FX_PLUGIN=1 +test_launch_ipfs_daemon + +test_expect_success "expected log entry should be present" ' + fgrep "invoked test fx function" daemon_err >/dev/null +' + +test_kill_ipfs_daemon + +test_done diff --git a/test/sharness/t0290-cid.sh b/test/sharness/t0290-cid.sh index 64e09777c06..905410d6287 100755 --- a/test/sharness/t0290-cid.sh +++ b/test/sharness/t0290-cid.sh @@ -173,6 +173,7 @@ cat < hashes_expect 27 keccak-256 28 keccak-384 29 keccak-512 + 30 blake3 86 dbl-sha2-256 45588 blake2b-160 45589 blake2b-168 diff --git a/test/sharness/t0800-blake3.sh b/test/sharness/t0800-blake3.sh new file mode 100755 index 00000000000..a90a676da46 --- /dev/null +++ b/test/sharness/t0800-blake3.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2020 Claudia Richoux +# MIT Licensed; see the LICENSE file in this repository. +# + +test_description="Test blake3 mhash support" + +. lib/test-lib.sh + +test_init_ipfs + +# the blake3 hash of "foo\n" in UTF8 (which is what comes out of echo when you pipe into `ipfs`) starts with "49dc870df1de7fd60794cebce449f5ccdae575affaa67a24b62acb03e039db92" +# without the newline it's "04e0bb39f30b1a3feb89f536c93be15055482df748674b00d26e5a75777702e9". so if you start seeing these values that's your problem +BLAKE3RAWCID32BYTE="bafkr4icj3sdq34o6p7lapfgoxtset5om3lsxll72uz5cjnrkzmb6aoo3si" +BLAKE3RAWCID64BYTE="bafkr4qcj3sdq34o6p7lapfgoxtset5om3lsxll72uz5cjnrkzmb6aoo3sknmbprpe27pbfrb67tonydgfot5ixuq4skiva76ppbgpjlzc4ua4" +BLAKE3RAWCID128BYTE="bafkr5aabjhoiodpr3z75mb4uz26oispvztnok5np7kthujfwflfqhybz3ojjvqf6f4tl54eweh36nzxamyv2pvc6sdsjjcud7z54ez5fpelsqdtax2k3rvuq3wdl5a4blxv3gvsroa3nakfzzknamhu2apf3vvytyiobabrn2bfnfajq66ikjy5lewsp5jyddsg5l7u3emr2ancimryay" + +### block tests, including for various sizes of hash ### + +test_expect_success "putting a block with an mhash blake3 succeeds (default 32 bytes)" ' + HASH=$(echo "foo" | ipfs block put --mhtype=blake3 --cid-codec=raw | tee actual_out) && + test $BLAKE3RAWCID32BYTE = "$HASH" +' + +test_expect_success "block get output looks right" ' + ipfs block get $BLAKE3RAWCID32BYTE > blk_get_out && + echo "foo" > blk_get_exp && + test_cmp blk_get_exp blk_get_out +' + +test_expect_success "putting a block with an mhash blake3 succeeds: 64 bytes" ' + HASH=$(echo "foo" | ipfs block put --mhtype=blake3 --mhlen=64 --cid-codec=raw | tee actual_out) && + test $BLAKE3RAWCID64BYTE = "$HASH" +' + +test_expect_success "64B block get output looks right" ' + ipfs block get $BLAKE3RAWCID64BYTE > blk_get_out && + echo "foo" > blk_get_exp && + test_cmp blk_get_exp blk_get_out +' + +test_expect_success "putting a block with an mhash blake3 succeeds: 128 bytes" ' + HASH=$(echo "foo" | ipfs block put --mhtype=blake3 --mhlen=128 --cid-codec=raw | tee actual_out) && + test $BLAKE3RAWCID128BYTE = "$HASH" +' + +test_expect_success "32B block get output looks right" ' + ipfs block get $BLAKE3RAWCID128BYTE > blk_get_out && + echo "foo" > blk_get_exp && + test_cmp blk_get_exp blk_get_out +' + +### dag tests ### + +test_expect_success "dag put works with blake3" ' + HASH=$(echo "foo" | ipfs dag put --input-codec=raw --store-codec=raw --hash=blake3 | tee actual_out) && + test $BLAKE3RAWCID32BYTE = "$HASH" +' + +test_expect_success "dag get output looks right" ' + ipfs dag get --output-codec=raw $BLAKE3RAWCID32BYTE > dag_get_out && + echo "foo" > dag_get_exp && + test_cmp dag_get_exp dag_get_out +' + +### add and cat tests ### + +test_expect_success "adding a file with just foo in it to ipfs" ' + echo "foo" > afile && + HASH=$(ipfs add -q --hash=blake3 --raw-leaves afile | tee actual_out) && + test $BLAKE3RAWCID32BYTE = "$HASH" +' + +test_expect_success "catting it" ' + ipfs cat $BLAKE3RAWCID32BYTE > cat_out && + echo "foo" > cat_exp && + test_cmp cat_exp cat_out +' + +test_done