Commit Graph

64 Commits

Author SHA1 Message Date
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
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
Tom O'Donnell (te0d)
7add1b3b52 Added Name Option to ipfs-cluster-ctl pin add
I added an option called --name or -n which specifies the name for
the added pin to be stored in consensus. Also added quotes around
name for allocations formatter.
2017-11-30 10:14:24 -05:00
Tom O'Donnell (te0d)
bd829c3f31 Added Name to Pinned Items
Added Name field to be a part of the stored state of a Pin. This
allows the name to be stored as a part of the consensus if needed.

This is the bare minimum to use. Some other calls like status need
to be checked out.
2017-11-30 10:14:24 -05:00
Hector Sanjuan
e824aea55e RecoverAll: Implement RecoverAllLocal() which recovers all pins in a peer
This adds API, RPC calls to support RecoverAllLocal() (and expose RecoverLocal()
on the Rest API too). cluster-ctl is updated accordingly.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-11-30 01:53:31 +01:00
Tom O'Donnell (te0d)
c6c8512a27 Added Hostname Property to Configuration
I added a "hostname" property to a node's configuration file. Its
value defaults to the hostname provided by the OS, but can be
modified to anything beside an empty string in the config file.

The "hostname" was added to the output of the "id" call. Thus, peer
hostnames are available when listing peers.
2017-11-29 15:44:31 -05:00
Hector Sanjuan
16acaa67c0 Release 0.3.0
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-11-15 23:39:50 +01:00
Hector Sanjuan
15bb953afd Issue #192: Update docs to the new peerset handling
Also, start removing mentions of `PeerAdd` operation, as things should
happen with `--bootstrap` (Join). PeerAdd should not be part of the user
workflow and might disappear or be hidden in the future.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-11-14 22:06:59 +01:00
Hector Sanjuan
2a616aeddb Issue #219: Provide a list of peers and a list of addresses in the ID object.
Fix cluster-ctl to show right number of peers

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-11-10 16:11:09 +01:00
Hector Sanjuan
f5e5ed1e6e Release 0.2.1
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-10-26 17:01:04 +02:00
Hector Sanjuan
7c5f40babf Release 0.2.0
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-10-23 19:39:37 +02:00
ZenGround0
03b21bf97d Merge pull request #177 from ipfs/162-new-configs
Issue #162: Rework configuration format
2017-10-20 09:29:33 -04:00
Hector Sanjuan
26e126d7f4 Check request error in cluster-ctl
An error check is missing and this triggers panics when a response is nil
2017-10-18 19:04:29 +02:00
Hector Sanjuan
8f06baa1bf Issue #162: Rework configuration format
The following commit reimplements ipfs-cluster configuration under
the following premises:

  * Each component is initialized with a configuration object
  defined by its module
  * Each component decides how the JSON representation of its
  configuration looks like
  * Each component parses and validates its own configuration
  * Each component exposes its own defaults
  * Component configurations are make the sections of a
  central JSON configuration file (which replaces the current
  JSON format)
  * Component configurations implement a common interface
  (config.ComponentConfig) with a set of common operations
  * The central configuration file is managed by a
  config.ConfigManager which:
    * Registers ComponentConfigs
    * Assigns the correspondent sections from the JSON file to each
    component and delegates the parsing
    * Delegates the JSON generation for each section
    * Can be notified when the configuration is updated and must be
    saved to disk

The new service.json would then look as follows:

```json
{
  "cluster": {
    "id": "QmTVW8NoRxC5wBhV7WtAYtRn7itipEESfozWN5KmXUQnk2",
    "private_key": "<...>",
    "secret": "00224102ae6aaf94f2606abf69a0e278251ecc1d64815b617ff19d6d2841f786",
    "peers": [],
    "bootstrap": [],
    "leave_on_shutdown": false,
    "listen_multiaddress": "/ip4/0.0.0.0/tcp/9096",
    "state_sync_interval": "1m0s",
    "ipfs_sync_interval": "2m10s",
    "replication_factor": -1,
    "monitor_ping_interval": "15s"
  },
  "consensus": {
    "raft": {
      "heartbeat_timeout": "1s",
      "election_timeout": "1s",
      "commit_timeout": "50ms",
      "max_append_entries": 64,
      "trailing_logs": 10240,
      "snapshot_interval": "2m0s",
      "snapshot_threshold": 8192,
      "leader_lease_timeout": "500ms"
    }
  },
  "api": {
    "restapi": {
      "listen_multiaddress": "/ip4/127.0.0.1/tcp/9094",
      "read_timeout": "30s",
      "read_header_timeout": "5s",
      "write_timeout": "1m0s",
      "idle_timeout": "2m0s"
    }
  },
  "ipfs_connector": {
    "ipfshttp": {
      "proxy_listen_multiaddress": "/ip4/127.0.0.1/tcp/9095",
      "node_multiaddress": "/ip4/127.0.0.1/tcp/5001",
      "connect_swarms_delay": "7s",
      "proxy_read_timeout": "10m0s",
      "proxy_read_header_timeout": "5s",
      "proxy_write_timeout": "10m0s",
      "proxy_idle_timeout": "1m0s"
    }
  },
  "monitor": {
    "monbasic": {
      "check_interval": "15s"
    }
  },
  "informer": {
    "disk": {
      "metric_ttl": "30s",
      "metric_type": "freespace"
    },
    "numpin": {
      "metric_ttl": "10s"
    }
  }
}
```

This new format aims to be easily extensible per component. As such,
it already surfaces quite a few new options which were hardcoded
before.

Additionally, since Go API have changed, some redundant methods have been
removed and small refactoring has happened to take advantage of the new
way.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-10-18 00:00:12 +02:00
dgrisham
25a910faad BasicAuth implementation -- CLI, server, and tests. 2017-10-14 15:55:21 -06:00
Hector Sanjuan
81518e0d68 Release 0.1.0
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-07-29 14:21:06 +02:00
Hector Sanjuan
0d9c7ddc0c Make sure dist READMEs are up to date (#137)
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-07-27 14:42:23 +02:00
Hector Sanjuan
46bda442b5 Merge pull request #127 from ipfs/release-fixes
Release fixes
2017-07-25 12:11:29 +02:00
Hector Sanjuan
f9d9c0c9a7 Add a space so peer ids can be copy-pasted more easily
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-07-25 00:16:08 +02:00
dgrisham
31cee53a55 Added --no-check-certificate flag for TLS API client 2017-07-23 10:11:10 -06:00
Hector Sanjuan
dcf9502d07 Address feedback in review
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-07-14 21:22:52 +02:00
Hector Sanjuan
5b0460f514 Fix #101: Sort peers on output from ipfs-cluster ctl
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-07-03 20:15:59 +02:00
Hector Sanjuan
235a9fc069 improve ipfs-cluster-ctl command help.
It seems that urfave/cli acts differently handling Description and Usage
depending on whether it is dealing with a command or a subcommand.

This fixes most of these issues, as well as the commands output which was
printing some blank lines.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-07-03 18:36:00 +02:00
Hector Sanjuan
cc8c9da28d Fixes #100: EOF responses when cluster peer is not responding
The ReadTimeout for the API was the same as for RPC. So the error
did not have time to be correctly returned to the client.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-05-18 13:16:27 +02:00
Hector Sanjuan
bb82c27b25 Fix #87: Implement ipfs-cluster-ctl pin ls <cid>
I have updated API endpoints to be /allocations rather than /pinlinst

It's more self-explanatory.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-04-06 21:12:16 +02:00
Hector Sanjuan
257077c5b2 Release 0.0.12
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-30 14:03:04 +02:00
Hector Sanjuan
db6956b737 Fix #77: ipfs-cluster-ctl output tweaks.
Be more consistent when printing errors (i.e. if json encoding
is requested then it should be used for errors too). Do not
print "Request accepted".

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-28 19:10:50 +02:00
Hector Sanjuan
39683460c6 Release 0.0.11
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-28 11:57:11 +02:00
Hector Sanjuan
20b0a3382e ctl: fix some outputs
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-13 11:10:53 +01:00
Hector Sanjuan
7ce5961aba Release 0.0.10
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-09 15:04:42 +01:00
Hector Sanjuan
f93538aed1 Release 0.0.9
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-09 13:15:18 +01:00
Hector Sanjuan
6a4863e623 Release 0.0.8
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-09 13:15:08 +01:00
Hector Sanjuan
b19b3c6882 Release 0.0.7
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-09 12:41:52 +01:00
Hector Sanjuan
76707d4b9b Release 0.0.6
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-09 12:24:27 +01:00
Hector Sanjuan
a5275ad02e Merge branch 'small-fixes' into pin-options 2017-03-09 12:04:49 +01:00
Hector Sanjuan
e5c5909e42 Support a replication factor flag in "ipfs-cluster-ctl pin add".
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-08 18:51:03 +01:00
Hector Sanjuan
01d65a1595 Support replication factor as a pin parameter
This adds a replication_factor query argument to the API
endpoint which allows to set a replication factor per Pin.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-08 18:50:54 +01:00
Hector Sanjuan
9b652bcfb3 Rename CidArg to Pin.
CidArg used to be an internal name for an argument that carried a Cid.
Now it has surfaced to API level and makes no sense. It is a Pin. It
represents a Pin (Cid, Allocations, Replication Factor)

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-08 16:57:27 +01:00
Hector Sanjuan
e014ba7751 Fix output when global pin info comes with an error
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-08 01:10:24 +01:00
Hector Sanjuan
7be6399433 Release 0.0.5
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-07 17:38:53 +01:00
Hector Sanjuan
135a222301 Release 0.0.4
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-03 18:49:45 +01:00
Hector Sanjuan
36c12fc297 Put tools README into dist/ folder
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-03 17:52:43 +01:00
Hector Sanjuan
85651ae8cb Issue #55: Move tooling information to it's own README in the subprojects.
Add LICENSE there too, so that the build tool for distributions includes
it in the tar files.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-03 16:13:09 +01:00
Hector Sanjuan
df3c190fc8 Release 0.0.3
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-03 15:08:31 +01:00