Skip to content

Commit

Permalink
Merge branch 'master' into schomatis/fix/core/mfs-root-localy-only
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero authored Oct 3, 2024
2 parents 6d31769 + a178307 commit 2e5d980
Show file tree
Hide file tree
Showing 85 changed files with 2,921 additions and 1,041 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
shell: bash

- name: Log in to Docker Hub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand All @@ -72,7 +72,7 @@ jobs:
# builds, only one platform is being loaded into the cache. This would
# prevent us from testing the other platforms.
- name: Build Docker image (linux/amd64)
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
context: .
Expand All @@ -84,7 +84,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache-new

- name: Build Docker image (linux/arm/v7)
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
platforms: linux/arm/v7
context: .
Expand All @@ -96,7 +96,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache-new

- name: Build Docker image (linux/arm64/v8)
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
platforms: linux/arm64/v8
context: .
Expand All @@ -116,7 +116,7 @@ jobs:
# This will only push the previously built images.
- if: github.event_name != 'workflow_dispatch' || github.event.inputs.push == 'true'
name: Publish to Docker Hub
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
context: .
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Kubo Changelogs

- [v0.31](docs/changelogs/v0.31.md)
- [v0.30](docs/changelogs/v0.30.md)
- [v0.29](docs/changelogs/v0.29.md)
- [v0.28](docs/changelogs/v0.28.md)
Expand Down
47 changes: 44 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ Before opening an issue, consider using one of the following locations to ensure
- [Downloading builds using IPFS](#downloading-builds-using-ipfs)
- [Unofficial Linux packages](#unofficial-linux-packages)
- [ArchLinux](#arch-linux)
- [Gentoo Linux](#gentoo-linux)
- [Nix](#nix)
- [Solus](#solus)
- [openSUSE](#opensuse)
- [Guix](#guix)
- [Snap](#snap)
- [Ubuntu PPA](#ubuntu-ppa)
- [Unofficial Windows packages](#unofficial-windows-packages)
- [Chocolatey](#chocolatey)
- [Scoop](#scoop)
Expand Down Expand Up @@ -198,11 +200,13 @@ $ ipfs get /ipns/dist.ipfs.tech/kubo/$VERSION/kubo_$VERSION_windows-amd64.zip
</a>

- [ArchLinux](#arch-linux)
- [Gentoo Linux](#gentoo-linux)
- [Nix](#nix-linux)
- [Solus](#solus)
- [openSUSE](#opensuse)
- [Guix](#guix)
- [Snap](#snap)
- [Ubuntu PPA](#ubuntu-ppa)

#### Arch Linux

Expand All @@ -214,6 +218,16 @@ $ ipfs get /ipns/dist.ipfs.tech/kubo/$VERSION/kubo_$VERSION_windows-amd64.zip

[![kubo-git via AUR](https://img.shields.io/static/v1?label=kubo-git&message=latest%40master&color=1793d1&logo=arch-linux&style=flat-square&cacheSeconds=3600)](https://aur.archlinux.org/packages/kubo/)

#### <a name="gentoo-linux">Gentoo Linux</a>

https://wiki.gentoo.org/wiki/Kubo

```bash
# emerge -a net-p2p/kubo
```

https://packages.gentoo.org/packages/net-p2p/kubo

#### <a name="nix-linux">Nix</a>

With the purely functional package manager [Nix](https://nixos.org/nix/) you can install kubo (go-ipfs) like this:
Expand Down Expand Up @@ -246,6 +260,31 @@ You can also install it through the Solus software center.

No longer supported, see rationale in [kubo#8688](https://github.com/ipfs/kubo/issues/8688).

#### Ubuntu PPA

[PPA homepage](https://launchpad.net/~twdragon/+archive/ubuntu/ipfs) on Launchpad.

##### Latest Ubuntu (>= 20.04 LTS)
```sh
sudo add-apt-repository ppa:twdragon/ipfs
sudo apt update
sudo apt install ipfs-kubo
```

##### Any Ubuntu version

```sh
sudo su
echo 'deb https://ppa.launchpadcontent.net/twdragon/ipfs/ubuntu <<DISTRO>> main' >> /etc/apt/sources.list.d/ipfs
echo 'deb-src https://ppa.launchpadcontent.net/twdragon/ipfs/ubuntu <<DISTRO>> main' >> /etc/apt/sources.list.d/ipfs
exit
sudo apt update
sudo apt install ipfs-kubo
```
where `<<DISTRO>>` is the codename of your Ubuntu distribution (for example, `jammy` for 22.04 LTS). During the first installation the package maintenance script may automatically ask you about which networking profile, CPU accounting model, and/or existing node configuration file you want to use.

**NOTE**: this method also may work with any compatible Debian-based distro which has `libc6` inside, and APT as a package manager.

### Unofficial Windows packages

- [Chocolatey](#chocolatey)
Expand Down Expand Up @@ -432,9 +471,11 @@ If you make changes to the protocol buffers, you will need to install the [proto
Find more documentation for developers on [docs](./docs)

## Maintainer Info
* [Project Board for active and upcoming work](https://pl-strflt.notion.site/Kubo-GitHub-Project-Board-c68f9192e48e4e9eba185fa697bf0570)
* [Release Process](https://pl-strflt.notion.site/Kubo-Release-Process-5a5d066264704009a28a79cff93062c4)
* [Additional PL EngRes Kubo maintainer info](https://pl-strflt.notion.site/Kubo-go-ipfs-4a484aeeaa974dcf918027c300426c05)

Kubo is maintained by [Shipyard](https://ipshipyard.com/).

* This repository is part of [Shipyard's GO Triage triage](https://ipshipyard.notion.site/IPFS-Go-Triage-Boxo-Kubo-Rainbow-0ddee6b7f28d412da7dabe4f9107c29a).
* [Release Process](https://ipshipyard.notion.site/Kubo-Release-Process-6dba4f5755c9458ab5685eeb28173778)


## Contributing
Expand Down
46 changes: 25 additions & 21 deletions client/rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> IPFS CoreAPI implementation using HTTP API
This packages implements [`coreiface.CoreAPI`](https://pkg.go.dev/github.com/ipfs/boxo/coreiface#CoreAPI) over the HTTP API.
This package implements [`coreiface.CoreAPI`](https://pkg.go.dev/github.com/ipfs/kubo/core/coreiface#CoreAPI) over the HTTP API.

## Documentation

Expand All @@ -16,29 +16,33 @@ Pin file on your local IPFS node based on its CID:
package main

import (
"context"
"fmt"
"context"
"fmt"

"github.com/ipfs/kubo/client/rpc"
path "github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/path"
"github.com/ipfs/go-cid"
"github.com/ipfs/kubo/client/rpc"
)

func main() {
// "Connect" to local node
node, err := rpc.NewLocalApi()
if err != nil {
fmt.Printf(err)
return
}
// Pin a given file by its CID
ctx := context.Background()
cid := "bafkreidtuosuw37f5xmn65b3ksdiikajy7pwjjslzj2lxxz2vc4wdy3zku"
p := path.New(cid)
err = node.Pin().Add(ctx, p)
if err != nil {
fmt.Printf(err)
return
}
return
// "Connect" to local node
node, err := rpc.NewLocalApi()
if err != nil {
fmt.Println(err)
return
}
// Pin a given file by its CID
ctx := context.Background()
c, err := cid.Decode("bafkreidtuosuw37f5xmn65b3ksdiikajy7pwjjslzj2lxxz2vc4wdy3zku")
if err != nil {
fmt.Println(err)
return
}
p := path.FromCid(c)
err = node.Pin().Add(ctx, p)
if err != nil {
fmt.Println(err)
return
}
}
```
27 changes: 23 additions & 4 deletions client/rpc/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"net"
"net/http"
"os"
"path/filepath"
Expand Down Expand Up @@ -98,11 +99,29 @@ func ApiAddr(ipfspath string) (ma.Multiaddr, error) {

// NewApi constructs HttpApi with specified endpoint.
func NewApi(a ma.Multiaddr) (*HttpApi, error) {
transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
DisableKeepAlives: true,
}

network, address, err := manet.DialArgs(a)
if err != nil {
return nil, err
}
if network == "unix" {
transport.DialContext = func(_ context.Context, _, _ string) (net.Conn, error) {
return net.Dial("unix", address)
}
c := &http.Client{
Transport: transport,
}
// This will create an API client which
// makes requests to `http://unix`.
return NewURLApiWithClient(network, c)
}

c := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
DisableKeepAlives: true,
},
Transport: transport,
}

return NewApiWithClient(a, c)
Expand Down
Loading

0 comments on commit 2e5d980

Please sign in to comment.