Browse Source

Merge pull request #196 from SuperNETorg/master

update
pkg_automation_electrum
pbca26 7 years ago
committed by GitHub
parent
commit
06be806c22
  1. 11
      main.js
  2. 47
      routes/shepherd.js

11
main.js

@ -116,6 +116,15 @@ process.once('loaded', () => {
} }
}); });
// silent errors
if (!appConfig.debug ||
!appConfig.dev) {
process.on('uncaughtException', (err) => {
shepherd.log(`${(new Date).toUTCString()} uncaughtException: ${err.message}`);
shepherd.log(err.stack);
});
}
guiapp.use(bodyParser.json({ limit: '50mb' })); // support json encoded bodies guiapp.use(bodyParser.json({ limit: '50mb' })); // support json encoded bodies
guiapp.use(bodyParser.urlencoded({ guiapp.use(bodyParser.urlencoded({
limit: '50mb', limit: '50mb',
@ -289,7 +298,7 @@ function createAppSettingsWindow() {
// initialise window // initialise window
appSettingsWindow = new BrowserWindow({ // dirty hack to prevent main window flash on quit appSettingsWindow = new BrowserWindow({ // dirty hack to prevent main window flash on quit
width: 750, width: 750,
height: 820, height: !appConfig.experimentalFeatures ? 570 : 700,
frame: false, frame: false,
icon: iguanaIcon, icon: iguanaIcon,
show: false, show: false,

47
routes/shepherd.js

@ -129,7 +129,6 @@ shepherd.startKMDNative = function(selection, isManual) {
'-daemon=0', '-daemon=0',
'-addnode=78.47.196.146', '-addnode=78.47.196.146',
], ],
'manualStart': isManual,
}; };
const options = { const options = {
@ -517,7 +516,7 @@ shepherd.testBins = function(daemonName) {
_fs.access(`${iguanaTestDir}/${daemonName}Test.log`, fs.constants.R_OK, function(err) { _fs.access(`${iguanaTestDir}/${daemonName}Test.log`, fs.constants.R_OK, function(err) {
if (!err) { if (!err) {
try { try {
_fs.unlink(`${iguanaTestDir}/${daemonName}Test.log`); _fs.unlinkSync(`${iguanaTestDir}/${daemonName}Test.log`);
} catch (e) {} } catch (e) {}
} else { } else {
shepherd.log(`path ${iguanaTestDir}/${daemonName}Test.log doesnt exist`); shepherd.log(`path ${iguanaTestDir}/${daemonName}Test.log doesnt exist`);
@ -1369,7 +1368,7 @@ shepherd.updateAgama = function() {
status: 'done', status: 'done',
}, },
}); });
fs.unlink(`${rootLocation}patch.zip`); fs.unlinkSync(`${rootLocation}patch.zip`);
} else { } else {
cache.io.emit('patch', { cache.io.emit('patch', {
msg: { msg: {
@ -2386,7 +2385,7 @@ shepherd.post('/herd', function(req, res) {
shepherd.log(req.body); shepherd.log(req.body);
if (req.body.options && if (req.body.options &&
!req.body.options.manualStart) { !shepherd.kmdMainPassiveMode) {
function testCoindPort(skipError) { function testCoindPort(skipError) {
if (!lockDownAddCoin) { if (!lockDownAddCoin) {
const _port = assetChainPorts[req.body.options.ac_name]; const _port = assetChainPorts[req.body.options.ac_name];
@ -2836,24 +2835,26 @@ function herder(flock, data) {
shepherd.writeLog(`selected data: ${data}`); shepherd.writeLog(`selected data: ${data}`);
// truncate debug.log // truncate debug.log
try { if (!shepherd.kmdMainPassiveMode) {
const _confFileAccess = _fs.accessSync(kmdDebugLogLocation, fs.R_OK | fs.W_OK); try {
const _confFileAccess = _fs.accessSync(kmdDebugLogLocation, fs.R_OK | fs.W_OK);
if (_confFileAccess) { if (_confFileAccess) {
shepherd.log(`error accessing ${kmdDebugLogLocation}`); shepherd.log(`error accessing ${kmdDebugLogLocation}`);
shepherd.writeLog(`error accessing ${kmdDebugLogLocation}`); shepherd.writeLog(`error accessing ${kmdDebugLogLocation}`);
} else { } else {
try { try {
fs.unlink(kmdDebugLogLocation); fs.unlinkSync(kmdDebugLogLocation);
shepherd.log(`truncate ${kmdDebugLogLocation}`); shepherd.log(`truncate ${kmdDebugLogLocation}`);
shepherd.writeLog(`truncate ${kmdDebugLogLocation}`); shepherd.writeLog(`truncate ${kmdDebugLogLocation}`);
} catch (e) { } catch (e) {
shepherd.log('cant unlink debug.log'); shepherd.log('cant unlink debug.log');
}
} }
} catch(e) {
shepherd.log(`komodod debug.log access err: ${e}`);
shepherd.writeLog(`komodod debug.log access err: ${e}`);
} }
} catch(e) {
shepherd.log(`komodod debug.log access err: ${e}`);
shepherd.writeLog(`komodod debug.log access err: ${e}`);
} }
// get komodod instance port // get komodod instance port
@ -2894,7 +2895,7 @@ function herder(flock, data) {
shepherd.log(`daemon param ${data.ac_custom_param}`); shepherd.log(`daemon param ${data.ac_custom_param}`);
coindInstanceRegistry[data.ac_name] = true; coindInstanceRegistry[data.ac_name] = true;
if (!data.manualStart) { if (!shepherd.kmdMainPassiveMode) {
let _arg = `${coindACParam}${data.ac_options.join(' ')}${_customParam}`; let _arg = `${coindACParam}${data.ac_options.join(' ')}${_customParam}`;
_arg = _arg.trim().split(' '); _arg = _arg.trim().split(' ');
execFile(`${komododBin}`, _arg, { execFile(`${komododBin}`, _arg, {
@ -2918,7 +2919,7 @@ function herder(flock, data) {
}); });
} }
} else { } else {
if (data.manualStart) { if (shepherd.kmdMainPassiveMode) {
coindInstanceRegistry[data.ac_name] = true; coindInstanceRegistry[data.ac_name] = true;
} }
shepherd.log(`port ${_port} (${data.ac_name}) is already in use`); shepherd.log(`port ${_port} (${data.ac_name}) is already in use`);
@ -3308,8 +3309,8 @@ function setConf(flock) {
return FixFilePermissions(); return FixFilePermissions();
}) })
.then(RemoveLines) .then(RemoveLines)
.then(CheckConf) .then(CheckConf);
.then(MakeConfReadOnly); // .then(MakeConfReadOnly);
} }
function getConf(flock) { function getConf(flock) {

Loading…
Cancel
Save