Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate combination of hostname and uid on link #3788

Merged
merged 2 commits into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bin/pm2
Original file line number Diff line number Diff line change
Expand Up @@ -605,12 +605,16 @@ commander.command('plus [secret] [public] [name]')
infoNode: _opts.infoNode,
discrete: _opts.discrete,
installAll: _opts.installAll,
gen_uid: _opts.gen,
public: pub,
secret: sec,
name: name,
ws: true
}

if (!name)
opts.name = require('os').hostname() + '-' + require('crypto').randomBytes(2).toString('hex')

if (sec == null && pub == null) {
return pm2._pre_interact(null, null, null, opts, function(err, dt) {
pm2.speedList()
Expand Down
3 changes: 1 addition & 2 deletions lib/API/Interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ module.exports = function(CLI) {
}
KMDaemon.launchAndInteract(that._conf, infos, function(err, dt) {
if (err) {
Common.printError(chalk.red('[PM2 agent] ') + err)
Common.printError(chalk.cyan('[PM2 agent] ') + 'Run `$ pm2 plus` to connect')
Common.printError(chalk.cyan('[PM2.IO] ') + 'Run `$ pm2 plus` to connect')
return that.exitCli(cst.ERROR_EXIT);
}
if (!cb) {
Expand Down