mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
(interactor) add randomized bytes to default hostname when linking #2906
This commit is contained in:
parent
4d07d66c10
commit
ebddff2db0
@ -18,6 +18,7 @@ var cst = require('../../constants.js');
|
||||
var Common = require('../Common');
|
||||
var json5 = require('../tools/json5.js');
|
||||
var UX = require('../API/CliUx.js');
|
||||
var crypto = require('crypto');
|
||||
|
||||
var InteractorDaemonizer = module.exports = {};
|
||||
|
||||
@ -375,7 +376,7 @@ InteractorDaemonizer.getOrSetConf = function(conf, infos, cb) {
|
||||
return cb(new Error('public key is not defined'));
|
||||
|
||||
if (!machine_name)
|
||||
machine_name = os.hostname();
|
||||
machine_name = os.hostname() + '-' + crypto.randomBytes(4).toString('hex');
|
||||
|
||||
/**
|
||||
* Write new data to configuration file
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user