packages/ipfs: 0.16.0 -> 0.23.0

This commit is contained in:
Max Headroom 2023-10-27 19:20:19 +02:00
parent 15261f5aa8
commit 1df4295d48
4 changed files with 33 additions and 54 deletions

View file

@ -1,51 +1,54 @@
{ lib, buildGo118Module, fetchurl, nixosTests, openssl, pkg-config }:
{ lib
, buildGoModule
, fetchurl
, nixosTests
, callPackage
}:
buildGo118Module rec {
pname = "ipfs";
version = "0.16.0"; # When updating, also check if the repo version changed and adjust repoVersion below
buildGoModule rec {
pname = "kubo";
version = "0.23.0"; # When updating, also check if the repo version changed and adjust repoVersion below
rev = "v${version}";
repoVersion = "12"; # Also update ipfs-migrator when changing the repo version
passthru.repoVersion = "15"; # Also update kubo-migrator when changing the repo version
# go-ipfs makes changes to it's source tarball that don't match the git source.
# Kubo makes changes to its source tarball that don't match the git source.
src = fetchurl {
url = "https://github.com/ipfs/kubo/releases/download/${rev}/kubo-source.tar.gz";
sha256 = "sha256-FS7lwQS7ybyoIKPkcUtPIe3srO1O/cZN+x1nzWUlF20=";
hash = "sha256-ycXn8h8sFGJXVMldneN51lZgXoPaZ/XeXLtqqJ4w6H0=";
};
# tarball contains multiple files/directories
postUnpack = ''
mkdir ipfs-src
mkdir kubo-src
shopt -s extglob
mv !(ipfs-src) ipfs-src || true
cd ipfs-src
mv !(kubo-src) kubo-src || true
cd kubo-src
'';
patches = [
./ipfs-allow-publish-with-ipns-mounted.patch
./ipfs-fuse-nuke-getxattr.patch
];
sourceRoot = ".";
subPackages = [ "cmd/ipfs" ];
buildInputs = [ openssl ];
nativeBuildInputs = [ pkg-config ];
tags = [ "openssl" ];
passthru.tests = {
inherit (nixosTests) kubo;
repoVersion = callPackage ./test-repoVersion.nix {};
};
passthru.tests.ipfs = nixosTests.ipfs;
vendorSha256 = null;
vendorHash = null;
outputs = [ "out" "systemd_unit" "systemd_unit_hardened" ];
patches = [
./ipfs-allow-publish-with-ipns-mounted.patch
./ipfs-fuse-nuke-getxattr.patch
./ipfs-unsafe-allow-all-paths-for-filestore.patch
];
postPatch = ''
substituteInPlace 'misc/systemd/ipfs.service' \
--replace '/usr/bin/ipfs' "$out/bin/ipfs"
--replace '/usr/local/bin/ipfs' "$out/bin/ipfs"
substituteInPlace 'misc/systemd/ipfs-hardened.service' \
--replace '/usr/bin/ipfs' "$out/bin/ipfs"
--replace '/usr/local/bin/ipfs' "$out/bin/ipfs"
'';
postInstall = ''
@ -59,10 +62,11 @@ buildGo118Module rec {
'';
meta = with lib; {
description = "A global, versioned, peer-to-peer filesystem";
description = "An IPFS implementation in Go";
homepage = "https://ipfs.io/";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ fpletz ];
mainProgram = "ipfs";
maintainers = with maintainers; [ Luflosi fpletz ];
};
}

View file

@ -1,11 +1,11 @@
diff --git a/core/coreapi/coreapi.go b/core/coreapi/coreapi.go
index 5b638826b..32747fe53 100644
index 81d05b58d..66460326f 100644
--- a/core/coreapi/coreapi.go
+++ b/core/coreapi/coreapi.go
@@ -191,9 +191,6 @@ func (api *CoreAPI) WithOptions(opts ...options.ApiOption) (coreiface.CoreAPI, e
@@ -205,9 +205,6 @@ func (api *CoreAPI) WithOptions(opts ...options.ApiOption) (coreiface.CoreAPI, e
}
subApi.checkPublishAllowed = func() error {
subAPI.checkPublishAllowed = func() error {
- if n.Mounts.Ipns != nil && n.Mounts.Ipns.IsActive() {
- return errors.New("cannot manually publish while IPNS is mounted")
- }

View file

@ -1,14 +0,0 @@
diff --git a/vendor/github.com/ipfs/go-filestore/fsrefstore.go b/vendor/github.com/ipfs/go-filestore/fsrefstore.go
index 9eb2b43..43e336c 100644
--- a/vendor/github.com/ipfs/go-filestore/fsrefstore.go
+++ b/vendor/github.com/ipfs/go-filestore/fsrefstore.go
@@ -291,9 +291,6 @@ func (f *FileManager) putTo(ctx context.Context, b *posinfo.FilestoreNode, to pu
return ErrFilestoreNotEnabled
}
//lint:ignore SA1019 // ignore staticcheck
- if !filepath.HasPrefix(b.PosInfo.FullPath, f.root) {
- return fmt.Errorf("cannot add filestore references outside ipfs root (%s)", f.root)
- }
p, err := filepath.Rel(f.root, b.PosInfo.FullPath)
if err != nil {

View file

@ -1,11 +0,0 @@
--- a/core/corehttp/webui.go 2020-05-09 04:58:18.000000000 +0200
+++ b/core/corehttp/webui.go 2020-07-15 00:22:00.439862559 +0200
@@ -1,7 +1,7 @@
package corehttp
// TODO: move to IPNS
-const WebUIPath = "/ipfs/bafybeibozpulxtpv5nhfa2ue3dcjx23ndh3gwr5vwllk7ptoyfwnfjjr4q" // v2.15.1
+const WebUIPath = "/ipns/webui.ipfs.privatevoid.net"
// this is a list of all past webUI paths.
var WebUIPaths = []string{