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.
Перейти к файлу
Luke Crouch 7f3ce28cd7 disable dockerflow routes on heroku 2018-08-22 10:30:17 -05:00
controllers More Review Fixes 2018-08-21 18:38:06 -05:00
db tests for /user/verify controller 2018-08-19 09:18:59 -05:00
loadtests Update README for loadtesting greatness 2018-06-14 20:29:08 -07:00
public Review Fixes 2018-08-21 18:08:09 -05:00
routes refactor to dockerflow controller and test it 2018-08-20 13:05:08 -05:00
scripts use test-blurts db with fixture data for db tests 2018-08-08 15:43:47 -05:00
tests reconcile home logic for tests and site 2018-08-20 14:12:45 -05:00
views More Review Fixes 2018-08-21 18:38:06 -05:00
.dockerignore Removes version.json from the .dockerignore file. 2018-06-08 16:21:54 -04:00
.env-dist disable dockerflow routes on heroku 2018-08-22 10:30:17 -05:00
.eslintignore for #254: convert testing scripts to jest 2018-08-17 14:11:02 -05:00
.eslintrc.js move jest environment to base .eslintrc.js file 2018-08-17 14:33:39 -05:00
.gitignore for #254: convert testing scripts to jest 2018-08-17 14:11:02 -05:00
.htmllintrc Add attr-bans to .htmllintrc 2018-03-08 11:22:13 -06:00
.npmignore
.stylelintrc footer fixes 2018-06-10 14:16:42 -05:00
.travis.yml use test-blurts db with fixture data for db tests 2018-08-08 15:43:47 -05:00
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 update README with test instructions 2018-08-19 10:49:18 -05:00
app-constants.js disable dockerflow routes on heroku 2018-08-22 10:30:17 -05:00
circle.yml Copies version.json asset to CIRCLE_ARTIFACTS 2018-06-08 16:03:32 -04:00
email-utils.js for #251: specify SES config set for SMTP 2018-08-13 15:07:30 -05:00
hbs-helpers.js + lint 2018-08-07 15:06:15 -05:00
hibp.js restore hibp and ses configs 2018-08-20 14:12:16 -05:00
middleware.js asyncMiddleware to improve error-handling 2018-08-18 16:37:20 -05:00
package-lock.json Merge remote-tracking branch 'mozilla/new-visuals' 2018-08-20 14:02:51 -05:00
package.json asyncMiddleware to improve error-handling 2018-08-18 16:37:20 -05:00
server.js disable dockerflow routes on heroku 2018-08-22 10:30:17 -05:00
sha1-utils.js Fix a bunch of ESLint errors 2018-04-18 16:39:05 +02:00
tips.js Review Fixes 2018-08-21 18:08:09 -05: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

The full test suite can be run via npm test.

Individual tests

To run individual tests, use NODE_ENV=tests and jest:

NODE_ENV=tests jest --runInBand tests/home.test.js

To run tests with interactive debugger lines enabled:

NODE_ENV=tests node inspect --harmony ./node_modules/.bin/jest tests/home.test.js

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.