diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2eb9cd3..2161a32 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,6 @@ yarn-release: tags: - docker script: - - docker run --rm -e GH_TOKEN="${GH_TOKEN}" -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make release_all" + - docker run --rm -e GH_TOKEN="${GH_TOKEN}" -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make release_all -e NODE_ENV=production" only: - master diff --git a/Makefile b/Makefile index 8458ba4..7d1f93d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ IPFS_VERSION := $(shell node -p "require('./package.json').ipfsVersion") IPFS_BINARY_NAME ?= go-ipfs_${IPFS_VERSION}_${TARGET}-amd64${BINARY_EXT} BINARY_URL ?= https://dist.ipfs.io/go-ipfs/${IPFS_VERSION}/${IPFS_BINARY_NAME} -NODE_ENV ?= production +NODE_ENV ?= development GH_TOKEN ?= ifeq ($(OS),Windows_NT) diff --git a/app/entry.js b/app/entry.js index db81d39..94bf8c3 100644 --- a/app/entry.js +++ b/app/entry.js @@ -1,4 +1,6 @@ const path = require('path') +require('./report.js') + // First parameter is the app folder (containing package.json) // Second parameter is the entry point of the app, i.e. app/index.js require('electron-compile').init(path.join(__dirname, '..'), path.join(__dirname, '/index')) diff --git a/app/index.js b/app/index.js index 2cae788..e179951 100644 --- a/app/index.js +++ b/app/index.js @@ -1,6 +1,7 @@ import { app, dialog, shell } from 'electron' import { autoUpdater } from 'electron-updater' import pjson from '../package.json' +import './report' import { startIPFSDaemon, diff --git a/app/report.js b/app/report.js new file mode 100644 index 0000000..e124e9d --- /dev/null +++ b/app/report.js @@ -0,0 +1,9 @@ +const pjson = require('../package.json') +const { init } = require('@sentry/electron') +const { env } = require('process') + +init({ + dsn: 'https://4b375cfe65e64f2aafbc2f701d1398d0@sentry.io/1189440', + release: `${pjson.version}/IPFS-${pjson.ipfsVersion}`, + environment: `${env.NODE_ENV}` +}) diff --git a/app/singleInstance.js b/app/singleInstance.js index 04c8b62..6185496 100644 --- a/app/singleInstance.js +++ b/app/singleInstance.js @@ -2,6 +2,7 @@ * Import/require this file to force the app to have one single instance */ +import './report' import { app } from 'electron' const shouldQuit = app.makeSingleInstance(() => {}) diff --git a/app/windows/Details/window.js b/app/windows/Details/window.js index 3fb264f..6491e4b 100644 --- a/app/windows/Details/window.js +++ b/app/windows/Details/window.js @@ -35,7 +35,10 @@ module.exports.create = function createDetailsWindow (app, hash) { fullscreenable: false, icon: path.join(__dirname, '../../../docs/logo.png'), - show: false + show: false, + webPreferences: { + preload: path.join(__dirname, '../../report.js') + } }) // Show menu only on StorageList diff --git a/app/windows/Import/window.js b/app/windows/Import/window.js index 1fee0d3..c8d2b70 100644 --- a/app/windows/Import/window.js +++ b/app/windows/Import/window.js @@ -37,7 +37,10 @@ module.exports.create = function createImportModal (app) { fullscreenable: false, icon: path.join(__dirname, '../../../docs/logo.png'), - show: false + show: false, + webPreferences: { + preload: path.join(__dirname, '../../report.js') + } }) // Show menu only on StorageList diff --git a/app/windows/Loading/window.js b/app/windows/Loading/window.js index 86b70a6..ae855cc 100644 --- a/app/windows/Loading/window.js +++ b/app/windows/Loading/window.js @@ -28,7 +28,10 @@ module.exports.create = function createResolveIPNSWindow (app) { fullscreenable: false, icon: path.join(__dirname, '../../../docs/logo.png'), - show: false + show: false, + webPreferences: { + preload: path.join(__dirname, '../../report.js') + } }) // Show menu only on StorageList diff --git a/app/windows/ResolveIPNS/window.js b/app/windows/ResolveIPNS/window.js index 91fbdb7..527d193 100644 --- a/app/windows/ResolveIPNS/window.js +++ b/app/windows/ResolveIPNS/window.js @@ -37,7 +37,10 @@ module.exports.create = function createResolveIPNSWindow (app) { fullscreenable: false, icon: path.join(__dirname, '../../../docs/logo.png'), - show: false + show: false, + webPreferences: { + preload: path.join(__dirname, '../../report.js') + } }) // Show menu only on StorageList diff --git a/app/windows/Settings/window.js b/app/windows/Settings/window.js index 2888160..b8d61ce 100644 --- a/app/windows/Settings/window.js +++ b/app/windows/Settings/window.js @@ -37,7 +37,10 @@ module.exports.create = function createSettingsModal (app) { fullscreenable: false, icon: path.join(__dirname, '../../../docs/logo.png'), - show: false + show: false, + webPreferences: { + preload: path.join(__dirname, '../../report.js') + } }) // Show menu only on StorageList diff --git a/app/windows/Storage/window.js b/app/windows/Storage/window.js index 1e7f4e1..e0b4bde 100644 --- a/app/windows/Storage/window.js +++ b/app/windows/Storage/window.js @@ -31,7 +31,10 @@ module.exports.create = function createStorageWindow (app) { fullscreenable: false, icon: path.join(__dirname, '../../../docs/logo.png'), - show: false + show: false, + webPreferences: { + preload: path.join(__dirname, '../../report.js') + } }) theWindow.once('ready-to-show', () => { diff --git a/package.json b/package.json index fc39be7..1fe874a 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "jest": "^22.4.2" }, "dependencies": { + "@sentry/electron": "^0.5.2", "app-root-dir": "^1.0.2", "byte-size": "^3.0.0", "classnames": "^2.2.5", diff --git a/yarn.lock b/yarn.lock index 042b2be..4d1dbb2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -124,6 +124,48 @@ vue-template-compiler "^2.0.0-alpha.8" vue-template-es2015-compiler "^1.4.2" +"@sentry/browser@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-0.5.2.tgz#a1355b30dc4bf13aa1bc8efad1dbe9698e4106a2" + dependencies: + "@sentry/core" "0.5.2" + "@sentry/shim" "0.5.2" + +"@sentry/core@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-0.5.2.tgz#017ac3b19b8842a4e413461f4b02ba6a645ed011" + dependencies: + "@sentry/shim" "0.5.2" + +"@sentry/electron@^0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@sentry/electron/-/electron-0.5.2.tgz#58a2be8b06ffcf3cf953bf825d82f981eb239b86" + dependencies: + "@sentry/browser" "0.5.2" + "@sentry/core" "0.5.2" + "@sentry/node" "0.5.2" + "@sentry/shim" "0.5.2" + "@sentry/utils" "0.5.2" + form-data "^2.3.2" + node-fetch "^2.1.1" + util.promisify "^1.0.0" + +"@sentry/node@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-0.5.2.tgz#8768b38211161eff6ec6bd0a9891aef34ce99312" + dependencies: + "@sentry/core" "0.5.2" + "@sentry/shim" "0.5.2" + raven "^2.5.0" + +"@sentry/shim@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@sentry/shim/-/shim-0.5.2.tgz#80fc5ba61be9ff3719a32d4ad9e03bab49a621f5" + +"@sentry/utils@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-0.5.2.tgz#6f838b9105f357c5aad87f9c286157cfd7b47885" + "@types/node@^7.0.12": version "7.0.59" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.59.tgz#fd7dceba9521c2d62c3e0eda8c5d704bf88b261d" @@ -1724,6 +1766,10 @@ chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" +charenc@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" + cheerio@^0.20.0: version "0.20.0" resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.20.0.tgz#5c710f2bab95653272842ba01c6ea61b3545ec35" @@ -1982,6 +2028,10 @@ convert-source-map@^1.2.0, convert-source-map@^1.4.0, convert-source-map@^1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" @@ -2040,6 +2090,10 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0: shebang-command "^1.2.0" which "^1.2.9" +crypt@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" + cryptiles@2.x.x: version "2.0.5" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" @@ -3232,20 +3286,20 @@ forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" -form-data@~2.1.1: - version "2.1.4" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" +form-data@^2.3.2, form-data@~2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" dependencies: asynckit "^0.4.0" - combined-stream "^1.0.5" + combined-stream "1.0.6" mime-types "^2.1.12" -form-data@~2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" +form-data@~2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" dependencies: asynckit "^0.4.0" - combined-stream "1.0.6" + combined-stream "^1.0.5" mime-types "^2.1.12" fragment-cache@^0.2.1: @@ -3914,7 +3968,7 @@ is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" -is-buffer@^1.1.5: +is-buffer@^1.1.5, is-buffer@~1.1.1: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -5011,6 +5065,14 @@ md5.js@^1.3.4: hash-base "^3.0.0" inherits "^2.0.1" +md5@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" + dependencies: + charenc "~0.0.1" + crypt "~0.0.1" + is-buffer "~1.1.1" + mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" @@ -5272,6 +5334,10 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" +node-fetch@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" + node-forge@^0.7.1: version "0.7.5" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.5.tgz#6c152c345ce11c52f465c2abd957e8639cd674df" @@ -6132,6 +6198,16 @@ randomatic@^1.1.3: is-number "^3.0.0" kind-of "^4.0.0" +raven@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/raven/-/raven-2.5.0.tgz#7a2b4ce8b9ff884448924ad19ca33b574bce59a2" + dependencies: + cookie "0.3.1" + md5 "^2.2.1" + stack-trace "0.0.10" + timed-out "4.0.1" + uuid "3.0.0" + rc@^1.0.1, rc@^1.1.2, rc@^1.1.6, rc@^1.1.7, rc@^1.2.1: version "1.2.6" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.6.tgz#eb18989c6d4f4f162c399f79ddd29f3835568092" @@ -6903,6 +6979,10 @@ stable@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.6.tgz#910f5d2aed7b520c6e777499c1f32e139fdecb10" +stack-trace@0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" + stack-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" @@ -7222,7 +7302,7 @@ through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -timed-out@^4.0.0: +timed-out@4.0.1, timed-out@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" @@ -7481,6 +7561,10 @@ util.promisify@^1.0.0: define-properties "^1.1.2" object.getownpropertydescriptors "^2.0.3" +uuid@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.0.tgz#6728fc0459c450d796a99c31837569bdf672d728" + uuid@^3.0.0, uuid@^3.1.0, uuid@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14"