Commit Graph

121 Commits

Author SHA1 Message Date
Hector Sanjuan
881033bb4e Fix thing in go-libp2p-kad-dht
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2019-02-27 05:26:49 +00:00
Hector Sanjuan
bfaf1c7799 Update libp2p to 6.0.38
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2019-02-27 01:31:07 +00:00
Hector Sanjuan
596eb21c7b Update libp2p et al. ..... again
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2019-02-25 12:28:59 +00:00
Hector Sanjuan
d1617ac79c Update to libp2p-6.0.35 and general dep alignment
No more duplicates with protobuf

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2019-02-19 15:28:12 +00:00
Hector Sanjuan
cc8dd7eb53
Merge pull request #675 from ipfs/update/libp2p-6.0.33
Dependency alignment for libp2p-6.0.33, dag libraries and others
2019-02-19 13:27:34 +00:00
Adrian Lanzafame
bccccccbdc
gx publish 0.9.0
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-02-18 20:31:10 +10:00
Hector Sanjuan
d4a4b5526d Dependency alignment for libp2p-6.0.33, dag libraries and others
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2019-02-15 12:09:05 +00:00
Adrian Lanzafame
b4f0eb3c95
gx publish 0.9.0-rc1
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-02-12 21:01:53 +10:00
Adrian Lanzafame
3b3f786d68
add opencensus tracing and metrics
This commit adds support for OpenCensus tracing
and metrics collection. This required support for
context.Context propogation throughout the cluster
codebase, and in particular, the ipfscluster component
interfaces.

The tracing propogates across RPC and HTTP boundaries.
The current default tracing backend is Jaeger.

The metrics currently exports the metrics exposed by
the opencensus http plugin as well as the pprof metrics
to a prometheus endpoint for scraping.
The current default metrics backend is Prometheus.

Metrics are currently exposed by default due to low
overhead, can be turned off if desired, whereas tracing
is off by default as it has a much higher performance
overhead, though the extent of the performance hit can be
adjusted with smaller sampling rates.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2019-02-04 18:53:21 +10:00
Hector Sanjuan
44f4ff2b24
gx publish 0.8.0
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2019-01-16 13:27:26 +01:00
Hector Sanjuan
f7bc468765
gx publish 0.8.0-rc1
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2019-01-14 14:54:13 +01:00
Hector Sanjuan
a0185fac2a Fix #382 (again): A better strategy for handling proxy headers
This changes the current strategy to extract headers from the IPFS daemon to
use them for hijacked endpoints in the proxy. The ipfs daemon is a bit of a
mess and what we were doing is not really reliable, specially when it comes to
setting CORS headers right (which we were not doing).

The new approach is:

* For every hijacked request, make an OPTIONS request to the same path, with
the given Origin, to the IPFS daemon and extract some CORS headers from
that. Use those in the hijacked response

* Avoid hijacking OPTIONS request, they should always go through so the IPFS
daemon controls all the CORS-preflight things as it wants.

* Similar to before, have a only-once-triggered request to extract other
interesting or custom headers from a fixed IPFS endpoint.  This allows us to
have the proxy forward other custom headers and to catch
`Access-Control-Expose-Methods`. The difference is that the endpoint use for
this and the additional headers are configurable by the user (but with hidden
configuration options because this is quite exotic from regular usage).

Now the implementation:

* Replaced the standard Muxer with gorilla/mux (I have also taken the change
to update the gxed version to the latest tag). This gives us much better
matching control over routes and allows us to not handle OPTIONS requests.

* This allows also to remove the extractArgument code and have proper handlers
for the endpoints passing command arguments as the last segment of the URL. A
very simple handler that wraps the default ones can be used to extract the
argument from the url and put it in the query.  Overall much cleaner this way.

* No longer capture interesting headers from any random proxied request.  This
made things complicated with a wrapping handler. We will just trigger the one
request to do it when we need it.

* When preparing the headers for the hijacked responses:
  * Trigger the OPTIONS request and figure out which CORS things we should set
  * Set the additional headers (perhaps triggering a POST request to fetch them)
  * Set our own headers.

* Moved all the headers stuff to a new headers.go file.

* Added configuration options (hidden by default) to:
  * Customize the extract headers endpoint
  * Customize what additional headers are extracted
  * Use HTTPs when talking to the IPFS API
    * I haven't tested this, but I did not want to have hardcoded 'http://' urls
      around, as before.

* Added extra testing for this, and tested manually a lot comparing the
daemon original output with our hijacked endpoint outputs while looking
at the API traffic with ngrep and making sure the requets happen as expected.
Also tested with IPFS companion in FF and Chrome.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2019-01-10 21:35:44 +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
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
Ł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
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
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
a0dc644545
Merge pull request #597 from ipfs/race-fixes-picks
Race fixes picks
2018-10-30 12:05:50 +01:00
Hector Sanjuan
e787773ed4
gx publish 0.7.0-rc1
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-29 18:03:58 +01:00
Hector Sanjuan
8a045ae2d2 Update to latest go-libp2p-pubsub (with renames)
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-29 17:25:52 +01:00
Hector Sanjuan
1f29abf754
Merge pull request #596 from ipfs/feat/env-cfg
add env config; refactor LoadJSON tests
2018-10-29 16:01:16 +01:00
Hector Sanjuan
0b923f8d49 Set envconfig version (more or less), and move setDefaults down a bit.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-29 14:53:59 +01:00
Hector Sanjuan
de2848fb23 Upgrade ipld-related dependencies. Remove impoters DAG forced-Batching.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-29 12:50:36 +01:00
Hector Sanjuan
d5fa2cf9f2 fix race with go-libp2p-gorpc
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-29 12:03:15 +01:00
Adrian Lanzafame
3ab3c2afa0
add env config; refactor LoadJSON tests
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-10-26 19:38:30 +10:00
Hector Sanjuan
64bd1cb924 Upgrade to libp2p 6.0.23
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-25 12:08:37 +02:00
Hector Sanjuan
b86f3cedb4 Files package has been extracted from cmdkit
Related: https://github.com/ipfs/go-ipfs-cmdkit/pull/31

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-24 01:28:05 +02:00
Hector Sanjuan
72e19b4fa1 Use better version for gorpc
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-17 15:33:44 +02:00
Hector Sanjuan
7d16108751 Start using libp2p/go-libp2p-gorpc
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-17 15:28:03 +02:00
Hector Sanjuan
58d35f34ee Upgrade to libp2p-6.0.19. Update deps.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-17 13:40:40 +02:00
Hector Sanjuan
3e11445516
gx publish 0.6.0
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-03 15:21:55 +02:00
Hector Sanjuan
12e7695b1e
gx publish 0.6.0-rc1
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-01 16:35:35 +02:00
Hector Sanjuan
b27ae72ef0 Update to go-1.11
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-01 12:03:08 +02:00
Joseph Lukasik
b98e549d92 Add Client interface, implemented by defaultClient
License: MIT
Signed-off-by: Joseph Lukasik <joseph@jgl.me>
2018-09-27 16:51:34 -07:00
Hector Sanjuan
59714f69d4 Allow running peers with different cluster versions in the same cluster
This patch modifies the RPC protocol tag to use Major and Minor parts of the
version and not all of it.

This means all peers on the 0.5.x can run in the same cluster.

As cluster has become more mature and I see less risks in letting peers from
similar versions run together. This is useful when upgrading too.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-09-27 07:35:57 +02:00
Hector Sanjuan
275a8b2881
Merge pull request #544 from ipfs/fix/update-go-cid
update go-cid and go-libp2p
2018-09-24 13:54:30 +02:00
Adrian Lanzafame
31474f6490
update go-cid and go-libp2p
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-09-24 11:35:38 +10:00
Adrian Lanzafame
a34154ff25
gx update go-dot
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-09-13 13:29:34 +10:00
Hector Sanjuan
753322cdc1
gx publish 0.5.0
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-08-24 15:04:17 +02:00
Hector Sanjuan
2559655c81
gx publish 0.5.0-rc1
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-08-21 20:51:49 +02:00
Hector Sanjuan
d6e516b84a
Merge pull request #513 from ipfs/remove-go-ipfs-dep
AddParams: support "cid-version" and "hash" function.
2018-08-21 20:49:02 +02:00
Hector Sanjuan
0b60e330a3 Fix duplicate dep
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-08-21 20:06:12 +02:00
Hector Sanjuan
b266ff2fbf
Merge pull request #514 from ipfs/fix/466-proxy-repo-stat
Fix #466: Hijack repo/stat in the proxy and return aggregates from the cluster
2018-08-21 19:39:03 +02:00
Hector Sanjuan
05102c13a0 AddParams: support "cid-version" and "hash" function.
Additionally, remove dependency to go-ipfs after extraction from
"go-mfs".

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-08-21 19:38:41 +02:00
Hector Sanjuan
9c3826fdc5 Use cmdkit WebFile.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-08-21 02:12:36 +02:00
Hector Sanjuan
2ffa3d80de Fix 466: Hijack repo/stat in the proxy and return aggregates from the cluster.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-08-20 20:43:27 +02:00
Hector Sanjuan
00a757fc0b Proxy/add: flush AddedOutput
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-08-18 02:48:35 +02:00
Hector Sanjuan
5bbc699bb4 Issue #340: Fix some data races
Unfortunately, there are still some data races in yamux
https://github.com/libp2p/go-libp2p/issues/396 so we can't
enable this by default.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-08-15 12:27:01 +02:00
Hector Sanjuan
df768b0b17 Align go-libp2p-kad-dht version
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-08-14 12:09:13 +02:00
Hector Sanjuan
1b8967aa46 Merge branch 'master' into feat/sharding-v1
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-08-14 11:40:03 +02:00