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 01206b68d4 bug #1490830: add sentry and capture errors 2018-10-31 11:08:32 -05:00
.circleci remove linting from circle; handled by travis 2018-08-30 15:34:02 -05:00
controllers fix unsubscribe link in breach alert email 2018-10-22 16:23:29 -05:00
db for #486: use fluent-langneg 2018-10-11 15:16:38 -05:00
loadtests change loadtests to locust 2018-08-28 15:29:32 -05:00
locales Pontoon: Update Urdu (ur) localization of Firefox Monitor Website 2018-10-30 20:32:25 +00:00
public Update breach images 2018-10-30 15:16:01 -05:00
routes fix #444: check bearer token on /hibp/notify 2018-09-25 20:23:18 -05:00
scripts update breach-stats script 2018-10-10 13:34:41 -05:00
tests fix #547: fix locale args to hbs helpers 2018-10-22 15:39:18 -05:00
views Merge pull request #560 from mozilla/enter-email-modal 2018-10-26 15:20:07 -05:00
.dockerignore Removes version.json from the .dockerignore file. 2018-06-08 16:21:54 -04:00
.env-dist bug #1490830: add sentry and capture errors 2018-10-31 11:08:32 -05:00
.eslintignore Credit sources and eslintignore polyfills 2018-09-24 22:12:42 -05:00
.eslintrc.js for #55: review fixes 2018-09-21 14:32:22 -05:00
.gitignore for #172: make npm and Docker use minifcation 2018-09-21 10:02:51 -05: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 also compare-locales everything in locales/ 2018-10-23 15:31:42 -05:00
CODEOWNERS Add CODEOWNERS and l10n.toml 2018-10-18 17:29:02 +02:00
CONTRIBUTING.md for #299 also add CONTRIBUTING.md 2018-10-17 15:20:40 -05:00
Dockerfile fix #547: fix locale args to hbs helpers 2018-10-22 15:39:18 -05:00
LICENSE Add LICENSE file and update package.json license 2018-06-07 14:49:16 -07:00
README.md for #172: make npm and Docker use minifcation 2018-09-21 10:02:51 -05:00
app-constants.js bug #1490830: add sentry and capture errors 2018-10-31 11:08:32 -05:00
basket.js last day fix of basket API call 2018-09-24 19:06:21 -05:00
email-utils.js send supportedLocals to email templates 2018-10-20 16:54:14 -05:00
hbs-helpers.js fix #547: fix locale args to hbs helpers 2018-10-22 15:39:18 -05:00
hibp.js Review Updates 2018-10-21 15:52:59 -05:00
l10n.toml Add CODEOWNERS and l10n.toml 2018-10-18 17:29:02 +02:00
locale-utils.js fix #562: use SUPPORTED_LOCALES to config locales 2018-10-29 16:28:19 -05:00
log.js for #55: MOZLOG_FMT for formatting 2018-09-21 13:41:29 -05:00
middleware.js bug #1490830: add sentry and capture errors 2018-10-31 11:08:32 -05:00
package-lock.json bug #1490830: add sentry and capture errors 2018-10-31 11:08:32 -05:00
package.json bug #1490830: add sentry and capture errors 2018-10-31 11:08:32 -05:00
server.js bug #1490830: add sentry and capture errors 2018-10-31 11:08:32 -05:00
sha1-utils.js Fix a bunch of ESLint errors 2018-04-18 16:39:05 +02:00
tips.js More i20n work 2018-10-14 14:30:11 -05:00
unsubscribe_reasons.js Initial i18n work 2018-10-11 16:21:26 -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
    

Note: npm start uses onchange and nodemon to automatically detect file changes, re-compile static assets, and restart the express process. If you want more control, see the scripts section of package.json for more commands.

  1. 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

Subscribe with a Firefox Account is controlled via the FXA_ENABLED environment variable. (See .env-dist)

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.