Skip to content

Commit

Permalink
fix role, add option to alow externel connections, update envelope, b…
Browse files Browse the repository at this point in the history
…ump version
  • Loading branch information
nunziotocci committed Jun 29, 2018
1 parent 6759c12 commit 58c9e8a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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 + '/')) {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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"
}
}

0 comments on commit 58c9e8a

Please sign in to comment.