Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
require('electron-debug')({ enabled: true })
const {
default: installExtension,
REACT_DEVELOPER_TOOLS,
REDUX_DEVTOOLS
} = require('electron-devtools-installer')
installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS])
.then(extName => logger.debug(`Added Extension: ${extName}`))
.catch(err => logger.debug('An error occurred: ', err))
})
} else {
// Production
if (config.sentryDsn) {
Raven.config(config.sentryDsn, {
captureUnhandledRejections: true,
release: app.getVersion(),
tags: {
process: process.type,
electron: process.versions.electron,
chrome: process.versions.chrome,
platform: os.platform(),
platform_release: os.release()
}
}).install()
}
}
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') {
app.quit()
'use strict';
const pjson = require('../../package.json');
const configHelper = require('../config');
const {config} = configHelper;
global.exitOnUncaught = config.exitOnUncaught;
const Raven = require('raven');
const ravenConfig = require('../util/raven-config');
if (config.sentry && config.sentry.enabled) {
Raven.config(config.sentry.dsn, ravenConfig).install();
global.sentryEnabled = true;
process.on('unhandledRejection', (reason, p) => {
console.error('Unhandled Rejection at:', p, 'reason:', reason);
Raven.captureException(reason);
});
console.info('[nodecg] Sentry enabled.');
}
// Native
const {EventEmitter} = require('events');
const fs = require('fs');
const path = require('path');
// Packages
// Only `require()` the newrelic module if explicity enabled.
// If required, modules will be instrumented.
require('../lib/newrelic')();
var config = require('../config');
var dbServer = require('../db-server');
var error = dbServer.errors;
var logger = require('../lib/logging')('bin.server');
var DB = require('../lib/db/mysql')(logger, error);
var restify = require('restify');
// configure Sentry
var Raven = require('raven');
const sentryDsn = config.sentryDsn;
if (sentryDsn) {
Raven.config(sentryDsn, {});
logger.info('sentryEnabled');
} else {
logger.info('sentryDisabled');
}
function logCharsetInfo(db, poolName) {
// Record some information about mysql connection configuration and
// charset at startup.
db._showVariables(poolName)
.then(function(variables) {
logger.info(['variables', poolName].join('.'), variables);
})
.then(function() {
return db._connectionConfig(poolName);
})
.then(function(config) {
const Raven = require('raven')
const puppeteer = require('puppeteer')
const express = require('express')
const URL = require('url').URL
const app = express()
if (process.env.NODE_ENV === 'production' && process.env.RAVEN_ENDPOINT) {
Raven.config(process.env.RAVEN_ENDPOINT).install()
}
const TARGET_HOST = process.env.TARGET_HOST
const TIMEOUT = process.env.TIMEOUT || 5000
const PORT = process.env.PORT || 5000
const MAX_AGE = process.env.MAX_AGE || 600
if (!TARGET_HOST) {
console.error('💥 Missing target host name, exiting.')
process.exit(1)
}
app.get('/', (req, res) => {
res.send('GET /shoot?path=…&selector=… to take a screenshot')
})
const Eris = require('eris')
const cluster = require('cluster')
const raven = require('raven')
const Raven = require('raven')
const indexCommands = require('../miscellaneous/commandIndexer')
const listenerIndexer = require('../miscellaneous/listenerIndexer')
const cacheGuildInfo = require('./utils/cacheGuildSettings')
const deleteMessagesOlderThanDays = require('./modules/oldmessageremover').removeMessagesOlderThanDays
require('dotenv').config()
Raven.config(process.env.RAVEN_URI).install()
if (process.env.SENTRY_URI) {
raven.config(process.env.SENTRY_URI).install()
} else {
global.logger.warn('No Sentry URI provided. Error logging will be restricted to messages only.')
}
async function init () {
global.logger.info('Shard booting')
global.redis = require('../db/clients/redis')
global.bot = new Eris(process.env.BOT_TOKEN, {
firstShardID: cluster.worker.shardStart,
lastShardID: cluster.worker.shardEnd,
maxShards: cluster.worker.totalShards,
disableEvents: { TYPING_START: true },
restMode: true,
messageLimit: 0,
autoreconnect: true,
getAllUsers: true
function initSentry() {
raven.config(process.env.SENTRY_DSN).install()
return raven.requestHandler()
}
const { ravenToken } = require('./data');
const Raven = require('raven');
const { extendAll } = require('./extensions/Extension');
const Client = require('./structures/Client');
const Logger = require('./structures/Logger');
const Database = require('./structures/PostgreSQL');
const Redis = require('./structures/Redis');
process.on('unhandledRejection', Logger.instance.error.bind(Logger.instance, '[REJECTION]:'));
Raven.config(ravenToken).install();
extendAll();
Database.instance.start();
Redis.instance.start();
const client = new Client({ disableEveryone: true });
client.login();
exports.register = (server, options, next) => {
Raven.config(options.dsn, options.client).install();
server.expose('client', Raven);
server.on('request-error', (request, err) => {
const baseUrl = request.info.uri ||
request.info.host && `${server.info.protocol}://${request.info.host}` ||
server.info.uri
Raven.captureException(err, {
request: {
method: request.method,
query_string: request.query,
headers: request.headers,
cookies: request.state,
url: baseUrl + request.path,
},
extra: {
timestamp: request.info.received,
function controllerFactory (handler) {
return (req, res) => {
handler(req.body.md, req.body.opts, (err, result) => {
if (err) {
Raven.captureException(err, {req, result})
res.status(500).json(result)
return
}
res.json(result)
})
}
}
const Raven = require('raven')
Raven.config(process.env.SENTRY_DSN, {
release: process.env.SENTRY_RELEASE || zmdVersion,
environment: process.env.SENTRY_ENVIRONMENT || process.env.ZDS_ENVIRONMENT,
}).install()
const {
toEPUB,
toHTML,
toLatex,
toLatexDocument,
} = require('./handlers')(Raven)
const app = express()
app.use(cors())
app.use(Raven.requestHandler())
constructor(module, clientOptions = defaultOptions) {
super(clientOptions);
//The Module Name
this.module = module;
//Sentry Error Tracking
Sentry.config(this.config.auth.SENTRY).install();
this.sentry = Sentry;
//In memory storage
/** @deprecated */
this.active = {
channel: {},
guild: {},
user: {}
};
//In memory storage
this.SimpleStorage = {
guild: {},
channel: {},
user: {}
};