24
1
Fork 0

filter the hash from error reports

This commit is contained in:
Danny Coates 2017-08-02 14:13:53 -07:00
parent d208a82089
commit 5944b85e67
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
5 changed files with 28 additions and 10 deletions

View File

@ -31,6 +31,7 @@ deployment:
test:
override:
- npm run build:version
- npm run lint
- npm test
- nsp check

View File

@ -1,13 +1,14 @@
window.Raven = require('raven-js');
window.Raven.config(window.dsn).install();
window.dsn = undefined;
if (navigator.doNotTrack !== '1' && window.RAVEN_CONFIG) {
window.Raven.config(window.SENTRY_ID, window.RAVEN_CONFIG).install();
}
const testPilotGA = require('testpilot-ga');
const { gcmCompliant, sendEvent } = require('./utils');
window.analytics = new testPilotGA({
an: 'Firefox Send',
ds: 'web',
tid: window.trackerId
tid: window.GOOGLE_ANALYTICS_ID
});
const isSender = !location.pathname.includes('/download');

View File

@ -92,6 +92,6 @@
"test": "npm-run-all test:*",
"test:unit": "mocha test/unit",
"test:server": "mocha test/server",
"test:browser": "browserify test/frontend/frontend.bundle.js -o test/frontend/bundle.js -d && node test/frontend/driver.js"
"test--browser": "browserify test/frontend/frontend.bundle.js -o test/frontend/bundle.js -d && node test/frontend/driver.js"
}
}

View File

@ -10,6 +10,7 @@ const storage = require('./storage.js');
const Raven = require('raven');
const crypto = require('crypto');
const fs = require('fs');
const version = require('../public/version.json');
if (conf.sentry_dsn) {
Raven.config(conf.sentry_dsn).install();
@ -106,8 +107,10 @@ app.get('/legal', (req, res) => {
app.get('/jsconfig.js', (req, res) => {
res.set('Content-Type', 'application/javascript');
res.render('jsconfig', {
trackerId: conf.analytics_id,
dsn: conf.sentry_id,
googleAnalyticsId: conf.analytics_id,
sentryId: conf.sentry_id,
version: version.version,
commit: version.commit,
maxFileSize: conf.max_file_size,
expireSeconds: conf.expire_seconds,
layout: false

View File

@ -5,11 +5,24 @@ if (isIE && !isUnsupportedPage) {
window.location.replace('/unsupported/ie');
}
{{#if dsn}}
window.dsn = '{{{dsn}}}';
{{#if sentryId}}
var RAVEN_CONFIG = {
release: '{{{version}}}',
tags: {
commit: '{{{commit}}}'
},
dataCallback: function (data) {
var hash = window.location.hash;
if (hash) {
return JSON.parse(JSON.stringify(data).replace(new RegExp(hash.slice(1), 'g'), ''));
}
return data;
}
}
var SENTRY_ID = '{{{sentryId}}}';
{{/if}}
{{#if trackerId}}
window.trackerId = '{{{trackerId}}}';
{{#if googleAnalyticsId}}
var GOOGLE_ANALYTICS_ID = '{{{googleAnalyticsId}}}';
{{/if}}
var MAXFILESIZE = {{{maxFileSize}}};
var EXPIRE_SECONDS = {{{expireSeconds}}};