kubo/core/commands
Hector Sanjuan a0f34b16dd
feat: built-in content blocking based on IPIP-383 (#10161)
Fixes #8492

This introduces "nopfs" as a preloaded plugin into Kubo
with support for denylists from https://github.com/ipfs/specs/pull/383

It automatically makes Kubo watch *.deny files found in:

- /etc/ipfs/denylists
- $XDG_CONFIG_HOME/ipfs/denylists
- $IPFS_PATH/denylists

* test: Gateway.NoFetch and GatewayOverLibp2p

adds missing tests for "no fetch" gateways one can expose,
in both cases the offline mode is done by passing custom
blockservice/exchange into path resolver, which means
global path resolver that has nopfs intercept is not used,
and the content blocking does not happen on these gateways.

* fix: use offline path resolvers where appropriate

this fixes the problem described in
https://github.com/ipfs/kubo/pull/10161#issuecomment-1782175955
by adding explicit offline path resolvers that are backed
by offline exchange, and using them in NoFetch gateways
instead of the default online ones

---------

Co-authored-by: Henrique Dias <hacdias@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-10-28 05:34:14 +02:00
..
cmdenv style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
cmdutils feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
dag feat: built-in content blocking based on IPIP-383 (#10161) 2023-10-28 05:34:14 +02:00
e Fix typo in an error.go comment: "is adds" -> "adds". 2018-01-17 15:25:54 -08:00
keyencode chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
name refactor: namesys cleanup, gateway /ipns/ ttl (#10115) 2023-10-18 10:23:50 +02:00
object chore: update boxo for structification of ImmutablePath 2023-10-09 09:44:39 +02:00
pin feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
unixfs feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
active.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
add.go chore: update boxo for structification of ImmutablePath 2023-10-09 09:44:39 +02:00
bitswap.go chore: migrate go-libipfs to boxo 2023-03-28 22:05:25 -04:00
block.go feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
bootstrap.go style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
cat.go feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
cid_test.go fix(commands/cid): error on CIDv0 w/ custom -b, upgrade to CIDv1 w/ custom -b, empty -v 2023-09-27 10:36:49 +02:00
cid.go fix(commands/cid): error on CIDv0 w/ custom -b, upgrade to CIDv1 w/ custom -b, empty -v 2023-09-27 10:36:49 +02:00
commands_test.go feat: add zsh completions (#10040) 2023-08-17 16:43:27 +02:00
commands.go feat: add zsh completions (#10040) 2023-08-17 16:43:27 +02:00
completion.go feat: add zsh completions (#10040) 2023-08-17 16:43:27 +02:00
config_test.go style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
config.go style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
dht_test.go refactor: namesys cleanup, gateway /ipns/ ttl (#10115) 2023-10-18 10:23:50 +02:00
dht.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
diag.go feat: add an "ipfs diag profile" command 2021-07-21 14:51:47 -07:00
dns.go refactor: namesys cleanup, gateway /ipns/ ttl (#10115) 2023-10-18 10:23:50 +02:00
external.go style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
extra.go refactor: get rid of cmdDetails awkwardness 2020-08-04 18:28:40 -04:00
files.go feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
filestore.go chore: migrate go-libipfs to boxo 2023-03-28 22:05:25 -04:00
get_test.go cmdkit -> cmds 2019-05-10 23:00:20 -07:00
get.go feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
helptext_test.go gx: unrewrite 2019-03-05 18:33:56 +01:00
id.go libp2p: stop reporting ProtocolVersion 2023-07-26 14:48:19 +02:00
keystore.go style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
log.go docs: note log tail is broken (#9383) 2022-11-10 00:20:53 +01:00
ls.go feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
mount_nofuse.go chore: mark fuse experimental (#8962) 2022-05-12 10:32:54 -07:00
mount_unix.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
mount_windows.go cmdkit -> cmds 2019-05-10 23:00:20 -07:00
multibase.go ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
p2p.go style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
ping.go refactor: stop using go-libp2p deprecated peer.ID.Pretty 2023-09-18 15:58:15 +02:00
profile.go feat: add heap allocs to 'ipfs diag profile' 2023-03-17 10:09:33 -04:00
pubsub.go refactor: stop using go-libp2p deprecated peer.ID.Pretty 2023-09-18 15:58:15 +02:00
refs.go feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
repo.go chore: migrate go-libipfs to boxo 2023-03-28 22:05:25 -04:00
resolve.go refactor: namesys cleanup, gateway /ipns/ ttl (#10115) 2023-10-18 10:23:50 +02:00
root_test.go pre-populate required arguments from request body 2018-03-18 13:04:25 -07:00
root.go style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
routing.go feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
shutdown.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
stat_dht.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
stat_provide.go feat: warn users who are falling behind reprovides 2023-06-08 10:05:30 +02:00
stat.go ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
swarm.go refactor: stop using go-libp2p deprecated peer.ID.Pretty 2023-09-18 15:58:15 +02:00
sysdiag.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
tar.go feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
urlstore.go feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
version.go fix: kubo in daemon and cli stdout 2022-07-20 16:26:49 +02:00