From 58c9e8a02aa41939252151c8d3b4c62600c776f5 Mon Sep 17 00:00:00 2001 From: Nunzio Tocci Date: Fri, 29 Jun 2018 09:11:18 -0500 Subject: [PATCH] fix role, add option to alow externel connections, update envelope, bump version --- index.js | 16 ++++++++-------- package.json | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 3adeecb..431a49e 100644 --- a/index.js +++ b/index.js @@ -14,19 +14,19 @@ const BrowserWindow = electron.BrowserWindow; const child_process = require('child_process'); var envelopeProc = null; -const envelope_module_name = 'node_modules/envelope-portable-' + (os.platform() != 'win32' ? (os.platform() + (os.arch() === 'x64' ? '64' : '32')) : 'windows'); +const envelope_module_name = 'node_modules/envelope-portable-' + (os.platform() !== 'win32' ? (os.platform() + (os.arch() === 'x64' ? '64' : '32')) : 'windows'); -function spawnEnvelope(strAppName, callback) { +function spawnEnvelope(strAppName, callback, bolAllowExternal) { envelopeProc = child_process.spawn( - path.normalize(app.getAppPath() + '/' + envelope_module_name + '/bin/envelope' + (process.platform == 'win32' ? '.exe' : '')), [ + path.normalize(app.getAppPath() + '/' + envelope_module_name + '/bin/envelope' + (process.platform === 'win32' ? '.exe' : '')), [ '-c', path.normalize(os.homedir() + '/.' + strAppName + '/envelope.conf'), '-d', path.normalize(os.homedir() + '/.' + strAppName + '/envelope-connections.conf'), '-r', path.normalize(app.getAppPath() + '/web_root'), '-y', path.normalize(app.getAppPath() + '/app'), - //'-z', path.normalize(app.getAppPath() + '/envelope/role'), - '-x', 't', + '-z', path.normalize(app.getAppPath() + '/role'), + (bolAllowExternal ? '' : '-x'), (bolAllowExternal ? '' : 't'), '-g', 'envelope_g', - (process.platform == 'win32' ? '-o' : ''), (process.platform == 'win32' ? 'stderr' : '') + (process.platform === 'win32' ? '-o' : ''), (process.platform === 'win32' ? 'stderr' : '') ], { detached: true } @@ -49,13 +49,13 @@ function spawnEnvelope(strAppName, callback) { }); } -exports.init = function (strAppName, strPostgresHost, intPostgresPort, callback) { +exports.init = function (strAppName, strPostgresHost, intPostgresPort, callback, bolAllowExternal) { try { // Check for envelope-connections.conf fs.statSync(os.homedir() + '/.' + strAppName + '/envelope-connections.conf'); // Spawn Envelope - spawnEnvelope(strAppName, callback); + spawnEnvelope(strAppName, callback, bolAllowExternal); } catch (e) { fs.mkdirsSync(os.homedir() + '/.' + strAppName + '/'); if (!hidefile.isHiddenSync(os.homedir() + '/.' + strAppName + '/')) { diff --git a/package.json b/package.json index 2a14f09..2adba13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "letterbox", - "version": "2.0.14", + "version": "2.0.15", "description": "A database driven application platform using Envelope", "main": "index.js", "repository": { @@ -29,9 +29,9 @@ "electron": "^1.4.5" }, "optionalDependencies": { - "envelope-portable-darwin64": "3.2.7-build1", - "envelope-portable-linux32": "3.2.7-build1", - "envelope-portable-linux64": "3.2.7-build1", - "envelope-portable-windows": "3.2.7-build1" + "envelope-portable-darwin64": "3.2.18-build1", + "envelope-portable-linux32": "3.2.18-build1", + "envelope-portable-linux64": "3.2.18-build1", + "envelope-portable-windows": "3.2.18-build1" } }