Commit Graph

1639 Commits

Author SHA1 Message Date
Hector Sanjuan
765987ef2c Improvements
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-29 12:03:32 +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
Hector Sanjuan
85a7dc5114 Allocate memory for response rpc types
Might trigger a very weird race when pointing to nil

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-29 12:03:03 +01:00
Hector Sanjuan
2deecf3f8d
Merge pull request #589 from ipfs/fix/health-metrics
Make metrics human
2018-10-26 15:12:10 +02:00
Hector Sanjuan
19b1124999 Make metrics human
Issue #572 exposes metrics but they carry the peer ID in binary.

This was ok with our internal codecs but it doesn't seem to work
very well with json, and makes the output format unusable.

This makes the Metric.Peer field a string.

Additinoally, fixes calling the command without arguments and displaying
the date in the right format.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-26 14:11:30 +02:00
Hector Sanjuan
53a16fba8f
Merge pull request #595 from ipfs/fix/libp2p
Fix tests with latest libp2p
2018-10-26 14:02:53 +02: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
9330ac82e2 Fix tests with latest libp2p
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-25 14:55:01 +02:00
Hector Sanjuan
372b70ada9
Merge pull request #594 from ipfs/workaround-broken-snaps
Fix publishing snaps
2018-10-25 13:53:14 +02:00
Hector Sanjuan
f52a5fd702 Fix publishing snaps
Snaps won't publish with classic confimement or non-edge.
For the moment this works around that so that, at least,
there is releases on 'edge'  with strict confinement.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-25 12:40:33 +02:00
Hector Sanjuan
8e892043e4
Merge pull request #592 from ipfs/libp2p-6.0.23
Upgrade to libp2p 6.0.23
2018-10-25 12:10:31 +02: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
cd30ae603a
Merge pull request #588 from ipfs/docker-compose
Add a docker-compose.yml example with 2 peers and auto-bootstrap.
2018-10-25 10:25:29 +02:00
Hector Sanjuan
0bab730030 Set CLUSTER_SECRET from shell
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-24 21:20:53 +02:00
Hector Sanjuan
2a62edd32a Nitpicks
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-24 13:12:36 +02:00
Hector Sanjuan
5f3ee631f1
Merge pull request #590 from ipfs/update/go-ipfs-files
Files package has been extracted from cmdkit
2018-10-24 12:49:41 +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
ce6ed6ae7a Test docker compose
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-23 18:25:43 +02:00
Hector Sanjuan
e4fddbc4d7 Add a docker-compose.yml example with 2 peers and auto-bootstrap.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-23 18:25:43 +02:00
Hector Sanjuan
2714852827
Merge pull request #586 from ipfs/fix/query-encode-filter
Fix: escape filter parameter query
2018-10-23 13:31:44 +02:00
Hector Sanjuan
79fe5919d2 Fix: escape filter parameter query
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-22 23:45:33 +02:00
Hector Sanjuan
48c89fbe4d
Merge pull request #572 from kishansagathiya/issue_449
Issue #449 API endpoint for Peer Monitor metrics
2018-10-22 23:32:50 +02:00
Hector Sanjuan
50d4876443
Merge pull request #553 from kishansagathiya/issue_532
Issue #532 `ipfs-cluster-service -f init` should clean up state as well
2018-10-22 10:31:33 +02:00
Hector Sanjuan
40e223d845
Merge pull request #581 from ipfs/feat/use-ipfs-to-download-gx
Fix #577: Try downloading gx and gx-go from local ipfs gateway first
2018-10-22 10:21:31 +02:00
Hector Sanjuan
17b3a959d3
Merge pull request #583 from ipfs/fix/add-with-spaces-in-name
Fix: escape the add query parameters correctly in the client
2018-10-22 10:19:35 +02:00
Kishan Sagathiya
ec4588a5ce Issue #449 API endpoint for Peer Monitor metrics
Rename method PeerMonitorLatestMetrics to Metrics
Addressing first round of comment as in
https://github.com/ipfs/ipfs-cluster/pull/572#pullrequestreview-165367171

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-21 13:36:20 +05:30
Kishan Sagathiya
3ac7d6c9cc Issue #449 API endpoint for Peer Monitor metrics
Support the new endpoint for later metrics in `rest/api/client`

Support the new method created in `rest/api/client` in
ipfs-cluster-ctl. i.e. `ipfs-cluster-ctl health metrics <name>` would
show the peers and the last list of metrics logged for each as returned
by the Peer Monitor, in a friendly way.

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-21 12:49:56 +05:30
Kishan Sagathiya
fafbf7b929 Issue #449 API endpoint for Peer Monitor metrics
Opened new endpoint `GET /health/metrics/<name>` which would respond
with metrics of type <name>

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-21 12:49:56 +05:30
Hector Sanjuan
4e3553fb1f Fix: escape the add query parameters correctly in the client
When adding something that has a name with spaces, things fail
very badly.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-19 20:19:52 +02:00
Kishan Sagathiya
c370e86cca Issue #532 -f init should clean up state
Cosmetic changes

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-18 19:06:07 +05:30
Kishan Sagathiya
687f49d1b7 Issue #532 -f init should clean up state
Cosmetic changes

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-18 19:06:07 +05:30
Kishan Sagathiya
5f52cc60a8 Issue #532 -f init should clean up state
Change to more appropriate prompt message

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-18 19:06:07 +05:30
Kishan Sagathiya
f77bb9dbcc Issue #532 -f init should clean up state
Fix sharness tests by using commands with local flags

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-18 19:06:07 +05:30
Kishan Sagathiya
7fd42cff44 Issue #532 -f init should clean up state
Remove force from global flags and use it as a local flag

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-18 19:06:07 +05:30
Kishan Sagathiya
dbc5f97d5e Issue #532 -f init should clean up state
Prompt on init and skip the prompt in init -f (and not have a -y flag)
This would be in line with other state subcommands which ask by default
and -f skips the prompt.

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-18 19:06:07 +05:30
Kishan Sagathiya
d599ef891b Issue #532 -f init should clean up state
Prompt before cleaning up the state

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-18 19:06:07 +05:30
Kishan Sagathiya
d80532d032 Issue #532 -f init should clean up state
Do cleanup after configuration in service.json is created

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-18 19:06:07 +05:30
Kishan Sagathiya
96944d0ffb Issue #532 -f init should clean up state
ipfs-cluster-service -f init` should clean up state

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
2018-10-18 19:06:07 +05:30
Hector Sanjuan
96af118144 Fix #577: Try downloading gx and gx-go from local ipfs gateway first
This modifies the Makefile so that gx and gx-go downloads are first
attempted from the local ipfs gateway (127.0.0.1:8080) and then
from the offical gateway (ipfs.io).

Make and wget doesn't work well dealing with stuff in subfolders,
so I have moved deptools-related rules to the deptools folder in its own
Makefile.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-18 14:09:19 +02:00
Hector Sanjuan
b0b826de39
Merge pull request #580 from ipfs/libp2p-6.0.19
Upgrade to libp2p-6.0.19. Update deps.
2018-10-18 12:07:46 +02:00
Hector Sanjuan
3c9945f8a3
Merge pull request #573 from ipfs/feat/gossipsub
Pubsubmon: Gossipsub
2018-10-18 12:07:19 +02:00
Hector Sanjuan
f669d759d9
Merge pull request #578 from ipfs/feat/api-headers
Restapi: Add configurable response headers
2018-10-18 11:19:55 +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
7544306ae3 Fix golint in travis
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-17 14:25:22 +02:00
Hector Sanjuan
80baf7d00a Fix changed peer ID String() output.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-17 14:08:56 +02:00
Hector Sanjuan
86b74c059a Fix using new libp2p-http
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-17 13:47:23 +02:00
Hector Sanjuan
562ad713fc Update docs for sendResponse
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-17 13:43:57 +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
322e87dd59 Restapi: Add configurable response headers
By default, CORS headers allowing GET requests from everywhere are
set. This should facilitate the IPFS Web UI integration with the
Cluster API.

This commit refactors the sendResponse methods in the API, merging
them into one as it was difficult to follow the flows that actually
send something to the client. All tests now check the presence of
the configured headers too, to make sure no route was missed.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-17 11:42:25 +02:00