From f331a38596e2957a6b60b49c5f4f4a053f874e1b Mon Sep 17 00:00:00 2001 From: Zhihao Date: Sat, 13 Jun 2015 17:52:32 +0800 Subject: [PATCH] rename to errorbucket --- README.md | 116 ++++++++++++---------------- client/app.js | 2 +- client/component-login.jsx | 2 +- client/component-nav.jsx | 4 +- config/config.sample.json | 2 +- package.json | 11 ++- server/auth/setup-authentication.js | 6 +- server/template-index.ejs | 2 +- server/template-login.ejs | 2 +- 9 files changed, 64 insertions(+), 83 deletions(-) diff --git a/README.md b/README.md index a3aaedb..affbacc 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,74 @@ -## ErrorBoard +

ErrorBucket

+
+

+ +

+One bucket to rule all JavaScript errors fired by your visitor's browsers +

+

+Based on Lapple's +ErrorBoard +

+

-Track and fix JavaScript errors fired by your visitor's browsers. +
-### Screenshots +---------- -![Messages view](http://i.imgur.com/Db3kudo.png) +
-![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": "", + "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": "", - "methods": { - "google-oauth2": { - "enabled": true, - "clientID": "", - "clientSecret": "" - } + "google": { + "enabled": false, + "emailpattern": "@example\\.(com|net)", + "clientID": "", + "clientSecret": "" + }, + "github": { + "enabled": true, + "organizationMembership": ["example"], + "clientID": "", + "clientSecret": "" + }, + "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 @@ -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) diff --git a/client/app.js b/client/app.js index 0d4a667..3dd454e 100644 --- a/client/app.js +++ b/client/app.js @@ -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, diff --git a/client/component-login.jsx b/client/component-login.jsx index 8f775ba..721e804 100644 --- a/client/component-login.jsx +++ b/client/component-login.jsx @@ -7,7 +7,7 @@ module.exports = React.createClass({ return
-

Error Board

+

ErrorBucket

{ this.renderError() }
diff --git a/client/component-nav.jsx b/client/component-nav.jsx index 6ee34e0..a15e95c 100644 --- a/client/component-nav.jsx +++ b/client/component-nav.jsx @@ -37,13 +37,13 @@ module.exports = React.createClass({ }, logo: function() { return
- + - ErrorBoard + ErrorBucket
; } }); diff --git a/config/config.sample.json b/config/config.sample.json index 0de9f49..8f74ca7 100644 --- a/config/config.sample.json +++ b/config/config.sample.json @@ -1,5 +1,5 @@ { - "db": "mongodb://localhost:27017/ErrorTracker", + "db": "mongodb://localhost:27017/ErrorBucket", "baseurl": "http://localhost:3000", "port": 3000 } diff --git a/package.json b/package.json index 6f2fade..2b6ecb1 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/server/auth/setup-authentication.js b/server/auth/setup-authentication.js index 85484ea..be34ace 100644 --- a/server/auth/setup-authentication.js +++ b/server/auth/setup-authentication.js @@ -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 diff --git a/server/template-index.ejs b/server/template-index.ejs index 59796bb..af0ed1f 100644 --- a/server/template-index.ejs +++ b/server/template-index.ejs @@ -3,7 +3,7 @@ - ErrorBoard + ErrorBucket diff --git a/server/template-login.ejs b/server/template-login.ejs index ad23b82..0beb2a8 100644 --- a/server/template-login.ejs +++ b/server/template-login.ejs @@ -3,7 +3,7 @@ - ErrorBoard + ErrorBucket