Skip to content

Commit e13f39c

Browse files
committed
fix: conflict
2 parents a60580a + 2506c75 commit e13f39c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+26
-5713
lines changed

lib/API.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const fclone = require('fclone');
1717
var conf = require('../constants.js');
1818
var Client = require('./Client');
1919
var Common = require('./Common');
20-
var KMDaemon = require('./Interactor/InteractorDaemonizer');
20+
var KMDaemon = require('keymetrics-agent/src/InteractorClient');
2121
var Config = require('./tools/Config');
2222
var Modularizer = require('./API/Modules/Modularizer.js');
2323
var path_structure = require('../paths.js');

lib/API/Configuration.js

+1-32
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11

2-
var Password = require('../Interactor/Password.js');
32
var Common = require('../Common.js');
43
var cst = require('../../constants.js');
54
var UX = require('./CliUx');
65
var chalk = require('chalk');
76
var async = require('async');
87
var Configuration = require('../Configuration.js');
98
//@todo double check that imported methods works
10-
var InteractorDaemonizer = require('../Interactor/InteractorDaemonizer');
9+
var InteractorDaemonizer = require('keymetrics-agent/src/InteractorClient');
1110

1211
module.exports = function(CLI) {
1312

@@ -63,36 +62,6 @@ module.exports = function(CLI) {
6362
return false;
6463
}
6564

66-
/**
67-
* Specific when setting pm2 password
68-
* Used for restricted remote actions
69-
* Also alert Interactor that password has been set
70-
*/
71-
if (key.indexOf('pm2:passwd') > -1) {
72-
value = Password.generate(value);
73-
Configuration.set(key, value, function(err) {
74-
if (err)
75-
return cb ? cb(Common.retErr(err)) : that.exitCli(cst.ERROR_EXIT);
76-
InteractorDaemonizer.launchRPC(that._conf, function(err) {
77-
if (err) {
78-
displayConf('pm2', function() {
79-
return cb ? cb(null, {success:true}) : that.exitCli(cst.SUCCESS_EXIT)
80-
});
81-
return false;
82-
}
83-
InteractorDaemonizer.rpc.passwordSet(function() {
84-
InteractorDaemonizer.disconnectRPC(function() {
85-
displayConf('pm2', function() {
86-
return cb ? cb(null, {success:true}) : that.exitCli(cst.SUCCESS_EXIT);
87-
});
88-
});
89-
});
90-
return false;
91-
});
92-
});
93-
return false;
94-
}
95-
9665
/**
9766
* Set value
9867
*/

lib/API/Interaction.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ var chalk = require('chalk');
66
var async = require('async');
77
var path = require('path');
88
var fs = require('fs');
9-
var KMDaemon = require('../Interactor/InteractorDaemonizer');
9+
var KMDaemon = require('keymetrics-agent/src/InteractorClient');
10+
var pkg = require('../../package.json')
1011

1112
module.exports = function(CLI) {
1213

@@ -45,7 +46,8 @@ module.exports = function(CLI) {
4546
KMDaemon.launchAndInteract(that._conf, {
4647
secret_key : secret_key || null,
4748
public_key : public_key || null,
48-
machine_name : machine_name || null
49+
machine_name : machine_name || null,
50+
pm2_version: pkg.version
4951
}, function(err, dt) {
5052
if (err) {
5153
return cb ? cb(err) : that.exitCli(cst.ERROR_EXIT);
@@ -118,7 +120,8 @@ module.exports = function(CLI) {
118120
public_key : null,
119121
secret_key : null,
120122
machine_name : null,
121-
info_node : null
123+
info_node : null,
124+
pm2_version: pkg.version
122125
}, function(err, dt) {
123126
if (err) {
124127
Common.printError(err);
@@ -143,7 +146,8 @@ module.exports = function(CLI) {
143146
public_key : public_key,
144147
secret_key : cmd,
145148
machine_name : machine,
146-
info_node : info_node.infoNode || null
149+
info_node : info_node.infoNode || null,
150+
pm2_version: pkg.version
147151
}
148152

149153
KMDaemon.launchAndInteract(that._conf, infos, function(err, dt) {

lib/API/Keymetrics/cli-api.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ var chalk = require('chalk');
55
var async = require('async');
66
var path = require('path');
77
var fs = require('fs');
8-
var KMDaemon = require('../../Interactor/InteractorDaemonizer');
8+
var KMDaemon = require('keymetrics-agent/src/InteractorClient');
99
var KM = require('./kmapi.js');
1010
var Table = require('cli-table-redemption');
1111
var open = require('../../tools/open.js');
1212
var promptly = require('promptly');
13+
var pkg = require('../../../package.json')
1314

1415
module.exports = function(CLI) {
1516

@@ -127,7 +128,8 @@ module.exports = function(CLI) {
127128
function linkOpenExit(target_bucket) {
128129
KMDaemon.launchAndInteract(cst, {
129130
public_key : target_bucket.public_id,
130-
secret_key : target_bucket.secret_id
131+
secret_key : target_bucket.secret_id,
132+
pm2_version: pkg.version
131133
}, function(err, dt) {
132134
open('https://app.keymetrics.io/#/r/' + target_bucket.public_id);
133135
setTimeout(function() {
@@ -194,7 +196,8 @@ module.exports = function(CLI) {
194196

195197
KMDaemon.launchAndInteract(cst, {
196198
public_key : target_bucket.public_id,
197-
secret_key : target_bucket.secret_id
199+
secret_key : target_bucket.secret_id,
200+
pm2_version: pkg.version
198201
}, function(err, dt) {
199202
linkOpenExit(target_bucket);
200203
});

lib/Client.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
var debug = require('debug')('pm2:client');
88
var Common = require('./Common.js');
9-
var KMDaemon = require('./Interactor/InteractorDaemonizer.js');
9+
var KMDaemon = require('keymetrics-agent/src/InteractorClient');
1010
var rpc = require('pm2-axon-rpc');
1111
var async = require('async');
1212
var axon = require('pm2-axon');
@@ -15,6 +15,7 @@ var fs = require('fs');
1515
var path = require('path');
1616
var mkdirp = require('mkdirp');
1717
var shelljs = require('shelljs');
18+
var pkg = require('../package.json')
1819

1920
function noop() {}
2021

@@ -79,7 +80,8 @@ Client.prototype.start = function(cb) {
7980
KMDaemon.launchAndInteract(that.conf, {
8081
machine_name : that.machine_name,
8182
public_key : that.public_key,
82-
secret_key : that.secret_key
83+
secret_key : that.secret_key,
84+
pm2_version : pkg.version
8385
}, function(err, data, interactor_proc) {
8486
that.interactor_process = interactor_proc;
8587
});
@@ -278,7 +280,8 @@ Client.prototype.launchDaemon = function(opts, cb) {
278280
KMDaemon.launchAndInteract(that.conf, {
279281
machine_name : that.machine_name,
280282
public_key : that.public_key,
281-
secret_key : that.secret_key
283+
secret_key : that.secret_key,
284+
pm2_version : pkg.version
282285
}, function(err, data, interactor_proc) {
283286
that.interactor_process = interactor_proc;
284287
return cb(null, child);

lib/Common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var isBinary = require('./tools/isbinaryfile.js');
2323
var cst = require('../constants.js');
2424
var extItps = require('./API/interpreter.json');
2525
var Config = require('./tools/Config');
26-
var KMDaemon = require('./Interactor/InteractorDaemonizer.js');
26+
var KMDaemon = require('keymetrics-agent/src/InteractorClient');
2727

2828
var Common = module.exports;
2929

lib/Interactor/Cipher.js

-50
This file was deleted.

0 commit comments

Comments
 (0)