Commit Graph

1713 Commits

Author SHA1 Message Date
Hector Sanjuan
16297ced48 Fix #632: Handle "stream-channels" in /add endpoints
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2019-01-04 19:30:41 +01:00
Hector Sanjuan
b44c7fb990
Merge pull request #622 from ipfs/issue_587
Added tests for /monitor/metrics/{metrics_type}
2019-01-04 18:17:05 +01:00
Hector Sanjuan
c0cdaa4b3e
Merge pull request #626 from ipfs/fix/ctl-https
Fix ipfs-cluster-ctl with HTTPs multiaddresses
2019-01-03 15:02:32 +01:00
Kishan Mohanbhai Sagathiya
fc678242fb Added tests for /monitor/metrics/{metrics_type}
Move ctl-health sharness tests to apprpriate file

Since the API is using the RPC mock to request metrics and it always
returns a mocked test metric we might just do c.Metrics("somemetricstype")
and check that there is no error. Here we just want to check that the
client is hitting an API endpoint (and understands the response).

Fixes #587

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-12-21 08:24:40 +05:30
Kishan Sagathiya
6049b216bb Sharness tests for ipfs-cluster-ctl health metrics
Added sharness tests for `ipfs-cluster-ctl health metrics <metricname>`

Fixes #587

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-12-21 08:24:40 +05:30
Kishan Sagathiya
61f86be96c We are using https://github.com/chriscool/sharness
We aren't using https://github.com/mlafeldt/sharness, code reference
below
fdfe8def94/Makefile (L67)

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-12-21 08:24:40 +05:30
Kishan Sagathiya
e9cf8abb3a Added tests for /monitor/metrics/{metrics_type}
Added API and client tests for GET /monitor/metrics/{metrics_type}

Fixes #587

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-12-21 08:24:40 +05:30
Hector Sanjuan
17599dac63
Merge pull request #623 from ipfs/fix/proxy-headers
Fix #382: Extract headers from IPFS API requests and apply them to hijacked ones.
2018-12-20 15:36:24 +01:00
Hector Sanjuan
159243d845 proxy: Check all headers to decide if we need to request
And do it by only loading them from the sync.Map once.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-12-20 14:44:32 +01:00
Hector Sanjuan
3896858a83 proxy: Rename helper to ipfsHeadersKnown()
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-12-20 14:24:06 +01:00
Hector Sanjuan
b93b2fedd4 Fix interpreting Host parameter correctly.
We should deprecate passing in Host/Port in the config,
but in the meantime, it hardcoded /dns4/, meaning that if
someone placed an ipv6 address in there things would break badly
and weirdly.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-12-19 21:19:47 +01:00
Hector Sanjuan
7c26f1ecb8 Fix HTTPs with DNS multiaddresses
Before we resolved all /dns*/ multiaddresses before we used them.

When using HTTPs, the Go HTTP Client only sees the resolved IP address
and it is unable to negotiate TLS with a cerficate because the request
is not going to the hostname the certificate is signed for, but to
the IP. This leverages a recent feature in go-multiaddr-net
and uses directly the user-provided hostname.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-12-19 21:15:37 +01:00
Hector Sanjuan
319c41cbf1
Merge pull request #624 from ipfs/libp2p-6.0.29
Update to libp2p-6.0.29 (and general dep alignment)
2018-12-19 00:36:34 +01:00
Hector Sanjuan
5e35e97b36 Update to libp2p-6.0.29 (and general dep alignment)
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-12-18 23:53:11 +01:00
Hector Sanjuan
862c1eb3ea Fix #382: Extract headers from IPFS API requests & apply them to hijacked ones.
This commit makes the proxy extract useful fixed headers (like CORS) from
the IPFS daemon API responses and then apply them to the responses
from hijacked endpoints like /add or /repo/stat.

It does this by caching a list of headers from the first IPFS API
response which has them. If we have not performed any proxied request or
managed to obtain the headers we're interested in, this will try triggering a
request to "/api/v0/version" to obtain them first.

This should fix the issues with using Cluster proxy with IPFS Companion and
Chrome.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-12-18 16:05:12 +01:00
Hector Sanjuan
9f6a1736a5
Merge pull request #613 from ipfs/gx/files2
go-ipfs-files 2.0 updates
2018-12-17 15:46:59 +01:00
Hector Sanjuan
11cc0485c7 API/client: Do not clean folders mid-test.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-12-17 14:55:34 +01:00
Hector Sanjuan
ced9f2f7f1 Update to go-ipfs-files 2.0.3
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-12-17 14:29:44 +01:00
Hector Sanjuan
15413edbc6 Unrewrite deps
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-12-17 14:16:38 +01:00
Łukasz Magiera
406d2b53f8 files2.0: Close subfiles in adder
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-12-17 14:16:38 +01:00
Łukasz Magiera
9b0ff603b8 files2.0: use type helpers
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-12-17 14:16:38 +01:00
Łukasz Magiera
c6944e4376 files2.0: update for no errors from NewMultiFileReader
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-12-17 14:16:38 +01:00
Łukasz Magiera
d0678aad6e files2.0: fix ContextCancelled test
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-12-17 14:16:38 +01:00
Łukasz Magiera
00df384e1c go-ipfs-files 2.0 updates
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-12-17 14:16:38 +01:00
Hector Sanjuan
e039c71cdf
Merge pull request #617 from ipfs/issue_616
Remove `proxy_` and `Proxy` from proxy config
2018-12-17 13:07:13 +01:00
Hector Sanjuan
9b2f6f7522 Remove proxy_ prefix from testing configurations
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-12-17 12:34:04 +01:00
Hector Sanjuan
6eaadcd7c2 Fix proxy config compatibility
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-12-17 12:31:03 +01:00
Kishan Sagathiya
3b86a94418 Put a note for deprecating json fields
Put a note for deprecating json fields that they are only here to
maintain compatibility and they will be removed in future

Start using env vars starting with `CLUSTER_IPFSPROXY`

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-12-17 08:24:17 +05:30
Kishan Sagathiya
2da12bc59a Switch to root user to create data directory
License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-12-13 16:03:22 +05:30
Kishan Sagathiya
8b33dbec03 Remove proxy_ and Proxy from proxy config
Remove proxy_ and Proxy from proxy config objects without breaking
compatibility with previous revisions

Fixes #616

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-12-13 00:21:21 +05:30
Hector Sanjuan
fdfe8def94
Merge pull request #576 from kishansagathiya/issue_453
Extract the IPFS Proxy from ipfshttp
2018-12-10 10:38:57 +01:00
Kishan Sagathiya
e21d84dbee Issue #453 Extract the IPFS Proxy from ipfshttp
Warning about old config style(proxy inside ipfs connector) getting
removed in future

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-11-27 10:36:00 +05:30
Kishan Sagathiya
253185ad13 Merge branch 'master' of github.com:ipfs/ipfs-cluster into issue_453 2018-11-12 05:23:44 +05:30
Kishan Sagathiya
f98ed71ff7 Issue #453 Extract the IPFS Proxy from ipfshttp
Fixed some messages and comments

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-11-11 21:09:13 +05:30
Kishan Sagathiya
aef68f4101 Issue #453 Extract the IPFS Proxy from ipfshttp
Fixed breaking tests

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-11-11 16:23:36 +05:30
Hector Sanjuan
77148e59a8
Merge pull request #609 from ipfs/feat/component-env-cfg
add envcfg to rest api
2018-11-09 13:09:13 +01:00
Adrian Lanzafame
e115021fa7
add envcfg to rest api
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-11-09 13:20:25 +10:00
Kishan Sagathiya
41edb04486 Issue #453 Extract the IPFS Proxy from ipfshttp
Added test for ipfsproxy config

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-11-04 09:05:53 +05:30
Kishan Sagathiya
56cc3b88d7 Issue #453 Extract the IPFS Proxy from ipfshttp
Added test for ipfsproxy

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-11-04 08:57:09 +05:30
Kishan Sagathiya
411eea664c Merge branch 'master' of github.com:ipfs/ipfs-cluster into issue_453 2018-11-03 20:24:15 +05:30
Kishan Sagathiya
a741eb42ab Issue #453 Extract the IPFS Proxy from ipfshttp
We want to maintain configuration compatibility and still recognize the
proxy configuration options in the ipfshttp connector configuration
section.

Check if there is a proxy configuration section.
If not create one with the options from the ipfshttp section (if they
are defined, otherwise do nothing).

This implementation utilizes the fact that json object can be
unmarshelled to a struct whose elements are a subset of the json object

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-11-03 16:15:34 +05:30
Hector Sanjuan
6f72ab2e67
Update 0.7.0 date 2018-11-01 22:55:56 +01:00
Hector Sanjuan
1b33e2fc9f
gx publish 0.7.0
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-11-01 19:49:36 +01:00
Hector Sanjuan
7e1ddd90a7
Release 0.7.0
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-11-01 19:49:07 +01:00
Hector Sanjuan
8aae89a7e5
Merge pull request #607 from ipfs/test/clean-shard-testing
Remove shard testing folders
2018-11-01 19:46:50 +01:00
Hector Sanjuan
b47eca40b0 Update changelog
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-11-01 19:15:08 +01:00
Hector Sanjuan
1d924bfc49 Remove shard testing folders
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-11-01 19:15:08 +01:00
Hector Sanjuan
e20429f536
Merge pull request #606 from ipfs/0.7.0/changelog
Changelog for v0.7.0
2018-11-01 18:56:02 +01:00
Hector Sanjuan
d05e8627c5 Changelog for v0.7.0
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-11-01 18:54:55 +01:00
Hector Sanjuan
9ec6eb430a
Merge pull request #605 from ipfs/fix/proxy-paths
Fix the paths handled by the proxy
2018-11-01 14:20:35 +01:00