Firefox Monitor arms you with tools to keep your personal information safe. Find out what hackers already know about you and learn how to stay a step ahead of them.
Перейти к файлу
Lesley Norton 4162f2ad5c + lint
...
2018-08-15 14:33:08 -05:00
db for #247: rename "db" to "DB" 2018-08-03 11:01:40 -05:00
loadtests Update README for loadtesting greatness 2018-06-14 20:29:08 -07:00
public + lint 2018-08-15 14:33:08 -05:00
routes review fixes 2018-08-14 17:55:25 -05:00
scripts for #247: rename "db" to "DB" 2018-08-03 11:01:40 -05:00
tests Update test-user.js 2018-06-07 10:12:41 -07:00
views highlighted text fix 2018-08-15 13:47:44 -05:00
.dockerignore Removes version.json from the .dockerignore file. 2018-06-08 16:21:54 -04:00
.env-dist fix #249: update README to match smaller DB 2018-08-06 11:20:41 -05:00
.eslintignore Add DNT vendor script from npm 2018-06-14 10:07:51 -07:00
.eslintrc.js Remove vendor/js code and jQuery from ESLint config and tweak ESLint config 2018-06-08 12:53:01 -07:00
.gitignore Add back public/js/vendor folder 2018-06-19 16:11:55 -07:00
.htmllintrc Add attr-bans to .htmllintrc 2018-03-08 11:22:13 -06:00
.npmignore fix #24: add Travis and Coveralls 2018-02-09 07:37:47 -06:00
.stylelintrc footer fixes 2018-06-10 14:16:42 -05:00
.travis.yml Start database interface (#48) 2018-03-05 19:23:53 +05:30
Dockerfile for #55: add Dockerfile for dockerflow 2018-05-31 09:55:32 -05:00
LICENSE Add LICENSE file and update package.json license 2018-06-07 14:49:16 -07:00
README.md fix #249: update README to match smaller DB 2018-08-06 11:20:41 -05:00
api.md Add basic info to api.md 2018-02-01 06:56:04 +05:30
app-constants.js remove false door; restore sign up 2018-07-18 16:03:43 -05:00
circle.yml Copies version.json asset to CIRCLE_ARTIFACTS 2018-06-08 16:03:32 -04:00
email-utils.js Resolve some ESLint console warnings 2018-05-17 11:04:52 -05:00
hbs-helpers.js + lint 2018-08-07 15:06:15 -05:00
hibp.js for #242: break the for loop when the match is found 2018-08-01 16:30:13 -05:00
package-lock.json fix #247: refactor db/utils to db/db and just knex 2018-08-02 14:25:02 -05:00
package.json Merge pull request #250 from mozilla/update-README-249 2018-08-06 13:50:30 -05:00
server.js for #242: load breaches from HIBP into app.locals 2018-08-01 13:48:50 -05:00
sha1-utils.js Fix a bunch of ESLint errors 2018-04-18 16:39:05 +02:00

README.md

Firefox Monitor Server

Summary

Firefox Monitor notifies users when their credentials have been compromised in a data breach.

This code is for the monitor.firefox.com service & website.

Breach data is powered by haveibeenpwned.com.

See the Have I Been Pwned about page for the "what" and "why" of data breach alerts.

Development

Requirements

Install

  1. Clone and change to the directory:

    git clone https://github.com/mozilla/blurts-server.git
    cd blurts-server
    
  2. Install dependencies:

    npm install
    
  3. Copy the .env-dist file to .env:

    cp .env-dist .env
    

Run

  1. Run the server:

    npm start
    
  2. Navigate to localhost:6060/

Database

To create the database tables ...

  1. Create the blurts database:

    createdb blurts
    
  2. Update the DATABASE_URL value in your .env file with your local db credentials:

    DATABASE_URL="postgres://<username>@localhost:<port>/blurts"
    
  3. Run the migrations:

    npm run db:migrate
    

Emails

The included .env-dist sets DEBUG_DUMMY_SMTP=1 which disables emails.

To send emails, you'll need to unset DEBUG_DUMMY_SMTP and supply real SMTP config values for sending email.

You can set and source these via the .env file, or set them directly:

export DEBUG_DUMMY_SMTP=
export SMTP_HOST=<your-smtp-host>
export SMTP_PORT=<your-smtp-port>
export SMTP_USERNAME=<your-username>
export SMTP_PASSWORD=<your-password>

Firefox Accounts

The repo comes with a development FxA oauth app pre-configured in .env, which should work fine running the app on http://localhost:6060

To use a different Firefox Accounts oauth relying party, you'll need to create an FxA Oauth Client and then set some OAUTH config values.

You can set and source these via the .env file:

OAUTH_CLIENT_ID=<your-fxa-oauth-client-id>
OAUTH_CLIENT_SECRET=<your-fxa-oauth-client-secret>
OAUTH_AUTHORIZATION_URI="https://oauth-stable.dev.lcip.org/v1/authorization"
OAUTH_PROFILE_URI="https://stable.dev.lcip.org/profile/v1/profile"
OAUTH_TOKEN_URI="https://oauth-stable.dev.lcip.org/v1/token"

Testing

Lint

After installing the dependencies, you can lint the code by calling:

npm run lint

Deployment

Firefox Monitor Breach Alerts is designed with 12-factor methodology.

Deploy on Heroku

You will need to set some required environment variables on Heroku.

heroku config:set COOKIE_SECRET=unsafe-cookie-secret-for-heroku
heroku config:set DEBUG_DUMMY_SMTP=1

And any others, depending on the features you're running on Heroku - e.g., Email or Firefox Accounts.