diff options
-rw-r--r-- | config/default.yaml | 3 | ||||
-rw-r--r-- | config/test.yaml | 3 | ||||
-rw-r--r-- | server/initializers/checker.js | 2 | ||||
-rw-r--r-- | server/lib/webtorrent.js | 16 |
4 files changed, 17 insertions, 7 deletions
diff --git a/config/default.yaml b/config/default.yaml index 87b72aa3b..b5fd7b06d 100644 --- a/config/default.yaml +++ b/config/default.yaml | |||
@@ -20,3 +20,6 @@ storage: | |||
20 | 20 | ||
21 | network: | 21 | network: |
22 | friends: [] | 22 | friends: [] |
23 | |||
24 | electron: | ||
25 | debug: false | ||
diff --git a/config/test.yaml b/config/test.yaml index 8a667a001..7f893bc4f 100644 --- a/config/test.yaml +++ b/config/test.yaml | |||
@@ -7,3 +7,6 @@ webserver: | |||
7 | database: | 7 | database: |
8 | host: 'localhost' | 8 | host: 'localhost' |
9 | port: 27017 | 9 | port: 27017 |
10 | |||
11 | electron: | ||
12 | debug: false | ||
diff --git a/server/initializers/checker.js b/server/initializers/checker.js index cb62fabf4..7a2b5b132 100644 --- a/server/initializers/checker.js +++ b/server/initializers/checker.js | |||
@@ -16,7 +16,7 @@ function checkConfig () { | |||
16 | 'webserver.https', 'webserver.host', 'webserver.port', | 16 | 'webserver.https', 'webserver.host', 'webserver.port', |
17 | 'database.host', 'database.port', 'database.suffix', | 17 | 'database.host', 'database.port', 'database.suffix', |
18 | 'storage.certs', 'storage.uploads', 'storage.logs', | 18 | 'storage.certs', 'storage.uploads', 'storage.logs', |
19 | 'network.friends' ] | 19 | 'network.friends', 'electron.debug' ] |
20 | const miss = [] | 20 | const miss = [] |
21 | 21 | ||
22 | for (const key of required) { | 22 | for (const key of required) { |
diff --git a/server/lib/webtorrent.js b/server/lib/webtorrent.js index e2e2586f9..656f8c7a8 100644 --- a/server/lib/webtorrent.js +++ b/server/lib/webtorrent.js | |||
@@ -7,6 +7,7 @@ const spawn = require('electron-spawn') | |||
7 | 7 | ||
8 | const logger = require('../helpers/logger') | 8 | const logger = require('../helpers/logger') |
9 | 9 | ||
10 | const electron_debug = config.get('electron.debug') | ||
10 | let host = config.get('webserver.host') | 11 | let host = config.get('webserver.host') |
11 | let port = config.get('webserver.port') | 12 | let port = config.get('webserver.port') |
12 | let nodeKey = 'webtorrentnode' + port | 13 | let nodeKey = 'webtorrentnode' + port |
@@ -57,13 +58,16 @@ function create (options, callback) { | |||
57 | }) | 58 | }) |
58 | 59 | ||
59 | const webtorrent_process = spawn(pathUtils.join(__dirname, 'webtorrentProcess.js'), host, port, { detached: true }) | 60 | const webtorrent_process = spawn(pathUtils.join(__dirname, 'webtorrentProcess.js'), host, port, { detached: true }) |
60 | webtorrent_process.stderr.on('data', function (data) { | ||
61 | // logger.debug('Webtorrent process stderr: ', data.toString()) | ||
62 | }) | ||
63 | 61 | ||
64 | webtorrent_process.stdout.on('data', function (data) { | 62 | if (electron_debug === true) { |
65 | // logger.debug('Webtorrent process:', data.toString()) | 63 | webtorrent_process.stderr.on('data', function (data) { |
66 | }) | 64 | logger.debug('Webtorrent process stderr: ', data.toString()) |
65 | }) | ||
66 | |||
67 | webtorrent_process.stdout.on('data', function (data) { | ||
68 | logger.debug('Webtorrent process:', data.toString()) | ||
69 | }) | ||
70 | } | ||
67 | 71 | ||
68 | webtorrent.app = webtorrent_process | 72 | webtorrent.app = webtorrent_process |
69 | }) | 73 | }) |