Commit Graph

1735 Commits

Author SHA1 Message Date
Andrew Gillis
0ae9b2b903
Update migration sharness tests for new migrations (#8053)
* Update migration sharness tests for new migrations

With the new migrations, go-ipfs no longer uses fs-repo-migrations to do repo migrations, and was downloading real migration binaries from the network and running them.  This caused failure, but was not caught because the test was expecting `ipfs daemon --migrate` to fail for other reasons.

This PR fixes the migration tests by creating the appropriate fake migration binaries in the PATH so that those get run and avoid downloading the real ones.  This also fixes a test that was previously marked broken.
2021-04-15 14:47:11 -04:00
Steven Allen
873b913858
Merge pull request #8020 from ipfs/dependabot/go_modules/contrib.go.opencensus.io/exporter/prometheus-0.3.0
build(deps): bump contrib.go.opencensus.io/exporter/prometheus from 0.2.0 to 0.3.0
2021-04-01 12:10:16 -07:00
Steven Allen
4cdb67f37d
Merge pull request #7890 from ipfs/fix/remove-clear-site-data
fix(gw): remove use of Clear-Site-Data in subdomain router
2021-03-31 16:24:24 -07:00
Steven Allen
ca53af5adb test(sharness): fix for opencensus updates 2021-03-30 17:07:55 -07:00
Steven Allen
18cbd490d7
Merge pull request #7987 from ipfs/test/metrics
test(sharness): verify the list of exported metrics
2021-03-24 16:00:46 -07:00
Steven Allen
d30f1e5d44
Merge pull request #7930 from ipfs/fix/redundant-ns-on-gateway
feat(gw): /ipfs/ipfs/{cid} → /ipfs/{cid}
2021-03-24 13:12:16 -07:00
Steven Allen
60e2c54db1 test(sharness): verify the list of exported metrics
We'll have to update this "golden" list as we add/remove metrics, but
this will at least warn us if something changes.
2021-03-17 15:04:38 -07:00
Steven Allen
eb53fc7c34 test(sharness): pass correct timeout format to go-timeout
It takes a number, not a duration. Unfortunately, it will _also_ exit
with a status of 1 in this case so the test passes.
2021-03-10 17:34:13 -08:00
Marcin Rataj
dae7387584
refactor: show error, delay redirect
This implements error page that does not hide the problem,
but still redirects to a valid path after short delay:
https://github.com/ipfs/go-ipfs/pull/7930#issuecomment-786882748
2021-02-27 00:57:05 +01:00
Steven Allen
6a13d86148 test(sharness): correctly use test_must_fail 2021-02-25 14:17:09 -08:00
Steven Allen
ccc2d23730 feat: remove secio support
We've had a reliable and enabled by default TLS implementation since
0.4.23 (over a year ago) and turned off SECIO in September of last year.
We might as well remove support entirely in the next release and
encourage users to upgrade their networks.

Noise is faster, anyways.
2021-02-25 13:36:40 -08:00
Marcin Rataj
15e3732afd
feat(gw): /ipfs/ipfs/{cid} → /ipfs/{cid}
This will try to recover from invalid paths like  /ipfs/ipfs/{cid}
and redirect to proper one, when possible.
2021-02-20 00:09:17 +01:00
Steven Allen
fed5f05134 build: simplify on gofmt 2021-02-08 12:44:15 -08:00
Marcin Rataj
d61ae2bcb4
fix: remove use of Clear-Site-Data
We used Clear-Site-Data to cushion transition period for local gateway
exposed at http://localhost while we were still figuring out
security-related details.

In the final implementation subdomain gateways are not tied to a
hostname explicitly, which removes the risk of cookies leaking,
removing the need for the header.

Turns out it causes issues for Firefox users, so let's just remove it.

Closes https://github.com/ipfs-shipyard/ipfs-companion/issues/977
2021-01-29 22:08:16 +01:00
Petar Maymounkov
8794928c31
add remote pinning policy for mfs (#7798)
* remote pinning service MFS policy
* update go-ipfs-config
* hardening secret sanitization in `ipfs config` commands

Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-01-28 18:58:44 -05:00
Andrew Gillis
6f6f04543b
Improve error message when running key command that locks repo (#7821)
* Improve error message when running key commands that must be run when the daemon is not already running

Fixes Issue #7814

`ipfs key export` now does a PreRun check like `ipfs key rotate` was to give a better error to the user then "someone else has the lock" in the event that the daemon is running while trying to execute these offline-only commands.

While unlikely the "someone else has the lock" error can still be shown if two processes try and grab the repo lock at the same time.

This PreRun function is also exported so it can be used by `ipfs init` where it was originally copied from.

* Added more `ipfs key` command tests

When daemon is running:
- Test that import works
- Test that export fails
- Test that rotate fails
2021-01-28 15:15:49 -05:00
Adin Schmahmann
e0d484431a test: add sharness tests for remote pinning service endpoints that are not http(s) URIs 2021-01-27 19:28:58 -05:00
Adin Schmahmann
7588a6a52a
Merge pull request #7829 from ipfs/fix/pin-remote-service-ls-json
fix: remote services ls always return a list
2021-01-14 17:37:40 -05:00
Marcin Rataj
216b858f8a
test: JSON response on empty remote service ls 2021-01-14 21:07:23 +01:00
Marcin Rataj
cdad39479c test: sharness for ?uri= router
Additional tests to ensure there are no regressions, as this will be
used by browser vendors in the future.
2021-01-14 20:53:17 +01:00
Adin Schmahmann
4ccb526b94
Merge pull request #7847 from ipfs/fix/dnslink-in-subdomain-gw
feat(gw): DNSLink names on https:// subdomains
2021-01-14 14:50:04 -05:00
Marcin Rataj
09178aa717
feat(gw): support inlined DNSLink names with TLS
Problem statement and rationale for doing this can be found under
"Option C" at: https://github.com/ipfs/in-web-browsers/issues/169

TLDR is:

`https://dweb.link/ipns/my.v-long.example.com` can be loaded from a
subdomain gateway with a wildcard TLS cert if represented as a single
DNS label: `https://my-v--long-example-com.ipns.dweb.link`
2021-01-01 21:39:42 +01:00
gammazero
e777adf04d Test ls and add with escaped character 2020-12-17 19:32:03 -08:00
Petar Maymounkov
a8c7980721
add remote pinning to ipfs command (#7661)
Added support for remote pinning services

A pinning service is a service that accepts CIDs from a user in order to host the data associated with them.
The spec for these services is defined at https://github.com/ipfs/pinning-services-api-spec

Support is available via the `ipfs pin remote` CLI and the corresponding HTTP API

Co-authored-by: Petar Maymounkov <petarm@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
2020-12-08 20:32:33 -05:00
Adin Schmahmann
76f3395ee6 p2p-proxy: earlier peerID validation check 2020-12-01 12:24:18 -05:00
Steven Allen
7a50636f9a fix: return an error when an unknown object type is passed
fixes #7785
2020-11-30 17:59:37 -08:00
Adin Schmahmann
499e011df9
Merge pull request #7699 from ipfs/fix/dnslink-dir-listing
fix(dnslink-gw): breadcrumbs and CID column when dir listing
2020-11-10 15:03:36 -05:00
Adin Schmahmann
0700c74bad
Merge pull request #7727 from ipfs/fix/preserver-query-on-website-redirect
fix(gw): preserve query on website redirect
2020-11-10 14:36:11 -05:00
Marcin Rataj
d1c20bdff7
fix: localhost API access via ipv6
This adds localhost ipv6 addresses to the allowlist for use in browser
context and fixes WebUI on ipv6-only deployments: http://[::1]:5001/webui

We were missing CORS/Origin tests for API port so I've added basic ones
and included localhost/127.0.0.1/::1 variants.
2020-10-20 00:46:40 +02:00
Marcin Rataj
6ffd0aa22e
fix(gw): preserve query on website redirect 2020-10-14 00:46:57 +02:00
Marcin Rataj
4deaf050d7
chore: dir-index-html 1.2.1
release notes:
https://github.com/ipfs/dir-index-html/releases/tag/1.2.1
2020-09-29 02:40:49 +02:00
Marcin Rataj
3ed46d995f
test(gw): add t0115-gateway-dir-listing.sh to sharness
This adds proper end-to-end tests for directory listing on Gateway port
that protects us against regressions oni each gw type:
- path gateway
- subdomain gateway
- dnslink website gateway

Tests cover:
- etag/unicode support
- breadcrumbs
- file name column
- hash column
2020-09-29 02:27:28 +02:00
Marcin Rataj
19ec5f4a51
feat(gateway): Content-Disposition for legacy clients
This adds ASCII-only filename for clients that do not implement RFC 5987

Closes #7648
2020-09-16 22:39:04 +02:00
Marcin Rataj
fd01acdfc0
feat(gateway): ?filename with download=true
This implements 'attachment' mode triggered then
?filename parameter is accompanied with &download=true

When Content-Disposition: attachment is detected by a modern browser
it will skip rendering and immediately open the "save as" dialog,
making this useful feature for using IPFS gateway as target of
"Download" links on various websites.

Parameter name was suggested in:
https://github.com/ipfs/go-ipfs/pull/4177#issuecomment-414870327
2020-09-16 22:15:18 +02:00
Adin Schmahmann
2ecde1a18c chore: update dht and kbucket 2020-08-25 21:13:18 -04:00
Adin Schmahmann
aedd6f0431 sharness: switch p2p dnsaddr that was supposed to have only a single address in it to use a specific example 2020-08-24 19:11:01 -04:00
Jacob Heun
edfd3c9743
test: add rotate self test 2020-08-21 20:08:24 +02:00
Marcin Rataj
887de89cac test(gateway): breadcrumb links in dir listing
This adds subdomain tests for breadcrumbs added in:
https://github.com/ipfs/go-ipfs/pull/7536

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2020-08-19 20:31:23 -04:00
Kevin Neaton
2feff33235 test: update gateway tests for dir-index-html v1.1.0 2020-08-19 20:31:23 -04:00
Adin Schmahmann
2d0cca800c
Merge pull request #7579 from ipfs/petar/ed25519-default
use ed25519 keys by default
2020-08-19 19:19:39 -04:00
Petar Maymounkov
ece0cda10d switch ipfs init default key 2020-08-19 08:31:44 -07:00
Adin Schmahmann
0c57e9dcf8
Merge pull request #7319 from MichaelMure/wildcard-gateways
feat: wildcard support for public gateways
2020-08-19 11:02:28 -04:00
Adin Schmahmann
40738e4fec
Merge pull request #7598 from ipfs/chore/bump-graphsync-dep
Upgrade graphsync deps
2020-08-18 19:53:52 -04:00
Petar Maymounkov
b4ad66eda4 add --ipns-base to publish and subs commands
add sharness tests for --ipns-base in name publish and subs commands
2020-08-17 21:43:02 -07:00
Petar Maymounkov
3e25355eeb fix keystore sharness default case 2020-08-17 21:43:01 -07:00
Petar Maymounkov
2b013a1ac5 use standard multibase format labels 2020-08-17 21:43:01 -07:00
Petar Maymounkov
23a26c05d3 rename -f to --ipns-base 2020-08-17 21:43:01 -07:00
Petar Maymounkov
80e859ef6f add format flag to key rename and remove, defaulting to b36cid; update sharness 2020-08-17 21:43:01 -07:00
Petar Maymounkov
a7629a27c0 fix rotate sharness 2020-08-17 21:43:01 -07:00
Petar Maymounkov
3cbe111b2d use b36 keys by default for keys and IPNS 2020-08-17 21:43:01 -07:00