Commit Graph

1660 Commits

Author SHA1 Message Date
Hector Sanjuan
10331e2678
gx publish 0.3.1
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 14:11:28 +01:00
Hector Sanjuan
91b3763869
Release 0.3.1
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 14:11:10 +01:00
Hector Sanjuan
620886366d release.sh: clean before releasing
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 14:10:16 +01:00
Hector Sanjuan
847a8a78c4 Do not leave tag annotation file around when releasing
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 14:05:26 +01:00
Hector Sanjuan
5200aadac6 Docs/guide: describe upgrade procedures in more detail
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 13:33:32 +01:00
Hector Sanjuan
e2e2c98eb1 ROADMAP.md: Q4 update. Better late than never.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 13:08:47 +01:00
Hector Sanjuan
313494a2f6 Changelog: v0.3.1
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 13:08:43 +01:00
Hector Sanjuan
7f06c9aed7 # This is a combination of 2 commits.
# This is the 1st commit message:

Captain.log.update

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>

# The commit message #2 will be skipped:

# Captain log
#
# License: MIT
# Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 13:07:12 +01:00
Hector Sanjuan
4409df681b
Merge pull request #267 from ipfs/codeclimate
Adjust some codeclimate settings
2017-12-08 21:08:53 +01:00
Hector Sanjuan
2fa54ff9d7
Merge pull request #266 from ipfs/feat/client_features
Feat/client features
2017-12-08 17:28:41 +01:00
Hector Sanjuan
d6bb5bb538 cluster-ctl: use standard error types
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 17:05:21 +01:00
Hector Sanjuan
b2651b52ea Refactor some stuff to please codeclimate
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 17:05:21 +01:00
Hector Sanjuan
763bd060a5 Increase lines of code per method in codeclimate
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 16:57:44 +01:00
Hector Sanjuan
a0025587eb Adjust some codeclimate settings
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 16:47:15 +01:00
Hector Sanjuan
b21d313547 rest/client: Return regular errors.
We had a problem happening when assigning the returned *api.Error
to default 'error' type.

Things like "if err != nil" would not work even when *api.Error is nil
I'm not sure why this happens, but this is very confusing for the user
integrating on top. It is better that we just return plain go errors.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 15:39:30 +01:00
Hector Sanjuan
62e8a011d0 rest/client: Allow passing Host and Port in the config.
This is easier in many cases and does not make the user
parse a multiaddress.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 15:38:30 +01:00
Hector Sanjuan
146e8672c4
Merge pull request #265 from ipfs/fix/api-client
Fix: client requests and multiaddresses parsing
2017-12-08 12:31:52 +01:00
Hector Sanjuan
faeaf5dc6a api: attempt to trick code climate on dup code
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 01:09:52 +01:00
Hector Sanjuan
6bf24ccca7 migrate.go: gofmt
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 01:05:49 +01:00
Hector Sanjuan
7dc9798894 cluster_config: de-duplicate multiaddress parsing code
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 01:05:49 +01:00
Hector Sanjuan
50859a8954 codeclimate: add .codeclimate.yml
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 01:05:49 +01:00
Hector Sanjuan
6a243df4da api: Support /ws/ and /dns/ multiaddresses parsing. Log all errors
The multiaddresses protocols for websockets and dns are only registered
with init() function when loading the modules. ipfs-cluster-ctl
uses just the api, which did not load these modules so converting
from serialized types caused bad panics.

We have also ignored errors in the api library under the thinking that it
would only parse things serialized by us, but this has made parsing errors
to go unnoticed. From now, all errors are logged and some precautions
are taking to better handle the possibility of nil objects.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 01:05:49 +01:00
Hector Sanjuan
72928d5e3b client: do not cancel request context while reading the answer
Apparently, cancelling the request context closes the response body
prematurely, before it's being fully read.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 00:22:01 +01:00
Hector Sanjuan
34c815b0ee
Merge pull request #263 from ipfs/feat/260-api-client
Fix #260: Add REST API client and use it in ipfs-cluster-ctl
2017-12-07 17:08:50 +01:00
Hector Sanjuan
0c469b85e1 cluster-ctl: exit with error on errors.
As before, exit status 1 means a client application error and
exit status 2 means a server-returned error.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-07 12:00:28 +01:00
Hector Sanjuan
7b9ef115a2 rest/api/client: re-use the http client
This allows taking advantage of connection keep alive by having the
api client re-use the same connection. Additionally, an option
to close connections after every request is provided.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-07 11:27:37 +01:00
Hector Sanjuan
660b2375fd cluster-ctl: Fix json output for slice responses.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-07 11:27:01 +01:00
Hector Sanjuan
6d7c65aaa6 Review #260: Address comments
* Set default logging facility
* Remove old keep-alive comment in tests
* Use a port for TestPeersWithErrors which is not default

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-07 00:04:51 +01:00
Hector Sanjuan
e0e32025de cluster-service: Do not export Locker. Fix golint.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 20:12:55 +01:00
Hector Sanjuan
de41394180 Makefile: Update to latest gx and gx-go
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 20:12:55 +01:00
Hector Sanjuan
0a8edc17c9 Fix #260: Add REST API client and use it in ipfs-cluster-ctl
This adds the pakage api/rest/client which implements a go-client
for the REST API component. It also update the ipfs-cluster-ctl
tool to rely on it.

Originally, I wanted this to live it in it's own separate repository,
but the api client uses /api/types.go, which is part of cluster.

Therefore it would need to import all of cluster as a dependency.
ipfs-cluster-ctl would also need to import go-ipfs-cluster-api-client
as a dependency, creating circular gx deps which would be a mess to
maintain.

Only the splitting of cluster in multiple repositories (at least for
api, rest, ipfs-cluster-ctl, rest/client and test) would allow better
dependency management by allowing rest/client and the ctl tool
to only import what is needed, but this is something which brings
maintenance costs and can probably wait a bit until cluster is more stable.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 20:12:01 +01:00
Hector Sanjuan
bde7b4e3d9
Merge pull request #264 from ipfs/feat/code_quality
Feat/code quality
2017-12-06 18:46:53 +01:00
Hector Sanjuan
9f8849fb18
Merge pull request #262 from ipfs/fix/lock-service
ipfs-cluster-service lock
2017-12-06 17:58:41 +01:00
Wyatt
ad492d20ae fix #254, execution locking:
ipfs-cluster-service now locks before running the daemon and state
upgrade commands.  Locking mechanism heavily inspired by ipfs, see
go-ipfs fsrepo.  Unlock called on exit to free up repo.  one lockfile
per repo. A very simple sharness test checks that two service
invocations cannot occur.

A longstanding sharness/ci logging issue is addressed by exporting
verbose=t into the travis environment.  Now output of commands from
within sharness test strings are displayed during travis runs.

License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2017-12-06 11:14:53 -05:00
Hector Sanjuan
f289394985 fix gofmt: format some files with gofmt -s
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:54 +01:00
Hector Sanjuan
0693ff429e fix spelling: Fix spelling errors
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:54 +01:00
Hector Sanjuan
7cd2d3d0e1 fix inef assignments: fix some unused assignments
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:52 +01:00
Hector Sanjuan
6d3edbb4a5 feat contribution guidelines: add guidelines
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:50 +01:00
Hector Sanjuan
b0d61ab9cb feat make check: add make check to run go vet and golint
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:43 +01:00
Hector Sanjuan
9a246a237d fix go vet: address go vet warnings
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:41 +01:00
Hector Sanjuan
c0628e43ff fix golint: Address a few golint warnings
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:38 +01:00
Hector Sanjuan
1e87fccf0e
Merge pull request #257 from te0d/feat/add-peer-identifier
Added Hostname Property to Configuration
2017-12-04 14:25:49 +01:00
Hector Sanjuan
84816729ff
Merge pull request #252 from te0d/feat/add-pin-name
Feat/add pin name
2017-12-04 14:25:39 +01:00
Hector Sanjuan
36f692069e
Merge pull request #259 from ipfs/pin-bot
Fix #155: Changes to run ipfs-cluster in the gateways
2017-12-04 14:25:00 +01:00
Hector Sanjuan
d6a7caf7a4 Issue #259: Address CR comments
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-04 13:59:48 +01:00
Tom O'Donnell (te0d)
7d43be33a4 Added Peername Configuration Test and Renamed to Peername
I've modified the peer identifier to be 'peername'. I've also
modified the TestLoadJSON to check that it is correctly read from
config and set to a default if empty.

Also added 'peername' fields to configurations for various tests.
2017-12-01 13:50:13 -05:00
Hector Sanjuan
4922c95589 Support --local parameter for Status[Local] and Sync[Local] operations
This allows to call the Rest API's status and sync endpoints with a
"?local=true" parameter. This will trigger operations but only on the
local peer. Cluster *Local and RPC-*Local methods have been accordingly,
although they are aliases for the PinTracker methods (but otherwise they
would not be exposed in external APIs). ipfs-cluster-ctl has been updated to
support the new flag.

The rationaly behind this feature is that sometimes, a single cluster peer
(or the ipfs daemon in it) is misbehaving. The user then wants to Sync,
Recover, or see Status for that single peer. This is specially relevant
when working with big pinsets in larger clusters, as a Status() call will
be considerably more expensive when broadcasted everywhere.

Note that the Rest API keeps returning GlobalPinInfo objects even on local=true
calls. This ensures that the user always gets the same datatype from an endpoint.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-01 12:56:26 +01:00
Tom O'Donnell (te0d)
8746f58b93 Fixed Pin ls Formatter for grep
Removed single quotes from pin name for ease of grepping.
2017-11-30 15:25:43 -05:00
Tom O'Donnell (te0d)
d1ef3d0493 Fixes for Adding Peer Identifier from Code Review
I renamed Hostname to simply Name as to not imply relation to DNS.
Removed quotes from formatter, used helper function setting config,
and added defensive error check.
2017-11-30 15:21:53 -05:00
Tom O'Donnell (te0d)
8f8f74acc5 Fixed URL Encoding for Add Pin Name Parameter and Reduced Version
URL encoding was added for `ipfs-cluster-ctl pin add --name`. The
Map State version was return to version 2. I did not notice errors,
but if there are, Version 2 still is not in a stable release.
2017-11-30 14:58:35 -05:00