antietcd 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/anticli.js CHANGED
@@ -23,7 +23,7 @@ anticli.js [OPTIONS] load [--with-lease] < dump.json
23
23
  Options:
24
24
 
25
25
  [--endpoints|-e http://node1:2379,http://node2:2379,http://node3:2379]
26
- [--cert cert.pem] [--key key.pem] [--timeout 1000] [--json]
26
+ [--cert cert.pem] [--key key.pem] [--ca ca.pem] [--timeout 1000] [--json]
27
27
  `;
28
28
 
29
29
  class AntiEtcdCli
@@ -98,12 +98,15 @@ class AntiEtcdCli
98
98
  {
99
99
  this.options.endpoints = [ 'http://localhost:2379' ];
100
100
  }
101
+ this.tls = {};
101
102
  if (this.options.cert && this.options.key)
102
103
  {
103
- this.tls = {
104
- key: await fsp.readFile(this.options.key),
105
- cert: await fsp.readFile(this.options.cert),
106
- };
104
+ this.tls.key = await fsp.readFile(this.options.key);
105
+ this.tls.cert = await fsp.readFile(this.options.cert);
106
+ }
107
+ if (this.options.ca)
108
+ {
109
+ this.tls.ca = await fsp.readFile(this.options.ca);
107
110
  }
108
111
  if (cmd[0] == 'get')
109
112
  {
@@ -281,7 +284,7 @@ function POST(url, options, body, timeout)
281
284
  req = null;
282
285
  ok({ error: 'timeout' });
283
286
  }, timeout) : null;
284
- let req = (url.substr(0, 6).toLowerCase() == 'https://' ? https : http).request(url, { method: 'POST', headers: {
287
+ let req = (url.substr(0, 8).toLowerCase() == 'https://' ? https : http).request(url, { method: 'POST', headers: {
285
288
  'Content-Type': 'application/json',
286
289
  'Content-Length': body_text.length,
287
290
  }, timeout, ...options }, (res) =>
package/antietcd.js CHANGED
@@ -17,7 +17,7 @@ const AntiPersistence = require('./antipersistence.js');
17
17
  const AntiCluster = require('./anticluster.js');
18
18
  const { runCallbacks, de64, b64, RequestError } = require('./common.js');
19
19
 
20
- const VERSION = '1.1.3';
20
+ const VERSION = '1.1.4';
21
21
 
22
22
  class AntiEtcd extends EventEmitter
23
23
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antietcd",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Simplistic etcd replacement based on TinyRaft",
5
5
  "main": "antietcd.js",
6
6
  "scripts": {
@@ -49,7 +49,7 @@
49
49
  "ws": "^8.17.0"
50
50
  },
51
51
  "bin": {
52
- "antietcd": "./antietcd-app.js",
53
- "anticli": "./anticli.js"
52
+ "antietcd": "antietcd-app.js",
53
+ "anticli": "anticli.js"
54
54
  }
55
55
  }