Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 49 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,74 @@
## ErrorBoard
<h1 align="center">ErrorBucket</h1>
<br/>
<p align="center">
<img src="https://avatars3.githubusercontent.com/u/12426710?v=3&s=300" style="margin:0 auto;"/>
<p align="center">
One bucket to rule all JavaScript errors fired by your visitor's browsers
</p>
<p align="center">
Based on Lapple's
<a href="https://github.com/Lapple/ErrorBoard">ErrorBoard</a>
</p>
</p>

Track and fix JavaScript errors fired by your visitor's browsers.
<br/>

### Screenshots
----------

![Messages view](http://i.imgur.com/Db3kudo.png)
<br/>

![Details view](http://i.imgur.com/I4h33hr.png)

![Browsers view](http://i.imgur.com/99OEaGy.png)
### Configuration file

### Prerequisites
#### Basic

* Node.js and NPM
* A free port

### Installation

$ git clone git://github.com/Lapple/ErrorBoard.git
$ cd ErrorBoard
$ npm install

### Configuration

Edit the `config.json` under `config` directory:
The following codes are in `config.sample.json`, shipped with the project. If no `config.json` found in root directory, `config.sample.json` will be used to generate a default `config.json`.

```js
{
"dbfile": "db", // path to database file
"port": 3000 // web application port
"db":"mongodb://localhost:27017/ErrorBucket", // MongoDB Connection String
"port": 3000, // Listening Port
"baseurl": "http://localhost:3000" // Base URL
}
```

If you do not have a `config.json` under `config` directory, `config.sample.json` will be used to generate a new `config.json` for you. This way, you can get a quick start to explore this project.

### Access Control

By default, this project can be viewed by anyone who knows the URL. If you want to add access control, you can configure it in `config.json` as well:
#### Advanced

```js
{
"dbfile": "data/db",
"db":"mongodb://localhost:27017/ErrorBucket?maxPoolSize=10",
"port": 3000,
"baseurl": "<Root Path of the Project>",
"baseurl": "http://localhost:3000",
"logttl": 345600, // Time to Live for Each Error Log
"errorAlert": {
"interval": 600, // The Unit Time
"threshold": 600, // Threshold
"recipient": ["user@example.com", "name@example.com"]
},
"auth": {
"emailpattern": "<Your Email Pattern>",
"methods": {
"google-oauth2": {
"enabled": true,
"clientID": "<Your Client ID>",
"clientSecret": "<Your Secret>"
}
"google": {
"enabled": false,
"emailpattern": "@example\\.(com|net)",
"clientID": "<Your Client ID>",
"clientSecret": "<Your Client Secret>"
},
"github": {
"enabled": true,
"organizationMembership": ["example"],
"clientID": "<Your Client ID>",
"clientSecret": "<Your Client Secret>"
},
"local": {
"enabled": false,
"users": [
{"username": "user", "password": "__pass__"},
{"username": "name", "password": "__word__"}
]
}
}
}
```

This project makes use of [Passport.js](http://passportjs.org/), which supports more than 140 authentication strategies including your favorite social authentications like Facebook, Twitter and Google. It's worthwhile to take a minute to learn how to use this middleware.

If `auth` field is not set in `config.json` or the `enabled` field of all the methods are set to `false`, then no authentication will be enforced. Everyone can view the content of this project. Otherwise, the methods that have `enabled` field set to `true` will be used to authenticate users.

`emailpattern` under `auth` is optional. If it is not set, everyone who passes the authentication API can log into the project. Otherwise, the users' email addresses will be validated after authentication API has returned.

`emailpattern` can be either regexp or array. For example:

```json
"auth": {
"emailpattern": "@baixing\\.(com|net)$",
}

vs.

"auth": {
"emailpattern": ["@baixing\\.com", "@baixing\\.net"],
}
```

Both ways are supported.

Fields under `methods` should match the name of the corresponding adapter. For example, `google-oauth2` in the example above matches the name of `authentication-google-oauth2.js`.

### Running

After you have everything installed and configured, run:

npm start

Once the app has started successfully, navigate to `localhost` at specified port (*e.g.* http://127.0.0.1:3000/) to get the error data. Similar error messages are not grouped, however the one can navigate to *Scripts* tab to get the idea which file:line pairs produce most errors.

### Browser snippet

Expand All @@ -106,7 +88,7 @@ window.onerror = function( message, url, line, column, error ) {

Replace `127.0.0.1:3000` with the address and the port number your ErrorBoard is running.

### License
### Original License

(The MIT License)

Expand Down
2 changes: 1 addition & 1 deletion client/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var updateApp = function(ctx) {
_context = ctx;
}

var loggedin = cookie.load('error_board_logged_in');
var loggedin = cookie.load('error_bucket_logged_in');

var props = {
state: _context.state,
Expand Down
2 changes: 1 addition & 1 deletion client/component-login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = React.createClass({
return <div className="container">
<div className="content">
<div className="login-box">
<h1>Error Board</h1>
<h1>ErrorBucket</h1>
<div className="login-message">
{ this.renderError() }
</div>
Expand Down
4 changes: 2 additions & 2 deletions client/component-nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ module.exports = React.createClass({
},
logo: function() {
return <div className='logo nav__logo'>
<a className='logo__info tooltip__parent' href='https://github.com/Lapple/ErrorBoard'>
<a className='logo__info tooltip__parent' href='https://github.com/errorbucket/error-bucket'>
<svg version='1.2' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'>
<path d='M13.839 17.525c-.006.002-.559.186-1.039.186-.265 0-.372-.055-.406-.079-.168-.117-.48-.336.054-1.4l1-1.994c.593-1.184.681-2.329.245-3.225-.356-.733-1.039-1.236-1.92-1.416-.317-.065-.639-.097-.958-.097-1.849 0-3.094 1.08-3.146 1.126-.179.158-.221.42-.102.626.12.206.367.3.595.222.005-.002.559-.187 1.039-.187.263 0 .369.055.402.078.169.118.482.34-.051 1.402l-1 1.995c-.594 1.185-.681 2.33-.245 3.225.356.733 1.038 1.236 1.921 1.416.314.063.636.097.954.097 1.85 0 3.096-1.08 3.148-1.126.179-.157.221-.42.102-.626-.12-.205-.369-.297-.593-.223z'/>
<circle cx='13' cy='6.001' r='2.5'/>
</svg>
</a>
ErrorBoard
ErrorBucket
</div>;
}
});
2 changes: 1 addition & 1 deletion config/config.sample.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"db": "mongodb://localhost:27017/ErrorTracker",
"db": "mongodb://localhost:27017/ErrorBucket",
"baseurl": "http://localhost:3000",
"port": 3000
}
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"name": "ErrorBoard",
"name": "ErrorBucket",
"version": "2.0.0",
"description": "Track and fix JavaScript errors fired by your visitor's browsers",
"description": "One Bucket to rule them all",
"main": "eb.js",
"author": {
"name": "Aziz Yuldoshev",
"email": "yuldoshev.aziz@gmail.com",
"url": "http://lapple.me"
"name": "Error Bucket",
"url": "https://github.com/errorbucket"
},
"repository": {
"type": "git",
"url": "git://github.com/Lapple/ErrorBoard.git"
"url": "git://github.com/errorbucket/error-bucket.git"
},
"scripts": {
"start": "npm run build && node eb.js",
Expand Down
6 changes: 3 additions & 3 deletions server/auth/setup-authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ var config = require('../config');
// cookie key used to indicate logged in status
// set the key in config.json.
// NOTE: this key MUST match the key used in client/app.js
var kLoggedIn = 'error_board_logged_in';
var kLoggedIn = 'error_bucket_logged_in';

module.exports = function (app) {
if (!config.useAuth) return false;

app.use(cookieParser());
app.use(session({
secret: 'error_board',
secret: 'error_bucket',
resave: false,
saveUninitialized: false,
name: 'error_board.sid'
name: 'error_bucket.sid'
}));
app.use(bodyParser.urlencoded({
extended: true
Expand Down
2 changes: 1 addition & 1 deletion server/template-index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ErrorBoard</title>
<title>ErrorBucket</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//fonts.googleapis.com/css?family=Raleway:300|Source+Sans+Pro:400,700" rel="stylesheet" type="text/css">
<link href="/static/eb.css" rel="stylesheet" type="text/css">
Expand Down
2 changes: 1 addition & 1 deletion server/template-login.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ErrorBoard</title>
<title>ErrorBucket</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//fonts.googleapis.com/css?family=Raleway:300|Source+Sans+Pro:400,700" rel="stylesheet" type="text/css">
<link href="/static/eb.css" rel="stylesheet" type="text/css">
Expand Down