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.
Перейти к файлу
Abelardo Ayala Rodríguez 43c56ef08d Pontoon: Update Guarani (gn) localization of Firefox Monitor Website
Localization authors:
- Abelardo Ayala Rodríguez <abe_aya@hotmail.com>
2020-01-30 14:04:12 +00:00
.circleci remove linting from circle; handled by travis 2018-08-30 15:34:02 -05:00
__mocks__ fix #1064: mock sns-validator during tests 2019-07-11 10:26:46 -05:00
controllers Fix false negative breach report emails 2020-01-17 14:59:05 -06:00
db fix #1411: add breaches_resolved JSON to subscribers table 2019-12-02 16:13:44 -06:00
docs Update analytics.md 2019-11-19 14:59:46 -06:00
lib fix #1426: handle HTTPError during getProfileData 2020-01-06 14:08:21 -06:00
loadtests change loadtests to locust 2018-08-28 15:29:32 -05:00
locales Pontoon: Update Guarani (gn) localization of Firefox Monitor Website 2020-01-30 14:04:12 +00:00
public Update secondary password SVG 2020-01-17 13:29:29 -06:00
routes fix #1329: redirect user to FxA sign-in instead of error 2019-11-01 15:48:04 -05:00
scripts add START_PAGE feature to pre-fxa email script 2019-11-21 14:51:52 -06:00
template-helpers Merge pull request #1482 from mozilla/add-utms-to-recommendation-links 2020-01-23 11:19:37 -06:00
tests fix #1426: handle HTTPError during getProfileData 2020-01-06 14:08:21 -06:00
views Merge pull request #1482 from mozilla/add-utms-to-recommendation-links 2020-01-23 11:19:37 -06:00
.dockerignore Removes version.json from the .dockerignore file. 2018-06-08 16:21:54 -04:00
.env-dist fix 1135: default SENTRY_DSN to blank 2019-10-10 11:03:00 -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 #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 fix #24: add Travis and Coveralls 2018-02-09 07:37:47 -06:00
.stylelintrc Ignore "selector-type-no-unknown" rule. 2019-09-27 15:31:13 -05:00
.travis.yml Merge pull request #895 from pdehaan/issue-888 2019-05-10 20:55:43 -05:00
CODE_OF_CONDUCT.md Add Mozilla Code of Conduct file 2019-03-30 00:10:15 -07:00
Dockerfile npm update during docker build 2019-12-13 16:44:40 -06:00
LICENSE Add LICENSE file and update package.json license 2018-06-07 14:49:16 -07:00
README.md Update README to include information on creating a test database 2019-07-11 09:04:31 -05:00
app-constants.js change updatebreaches.js from Bearer to Basic auth 2019-04-24 22:08:18 -05:00
basket.js for #669: check db array and catch basket error 2019-01-02 11:16:21 -06:00
email-utils.js fix #1191: consolidate and clean up utm_* params 2019-11-22 14:37:04 -06:00
hibp.js fix #1453: stop adding PDL to Remote Settings 2020-01-23 10:52:50 -06:00
l10n.toml Update l10n linter to moz-l10n-lint 2019-05-09 15:20:06 -07:00
locale-utils.js add script to send email to pre-fxa subscribers 2019-10-31 12:42:39 -05:00
log.js for #55: MOZLOG_FMT for formatting 2018-09-21 13:41:29 -05:00
middleware.js fix #1426: handle HTTPError during getProfileData 2020-01-06 14:08:21 -06:00
package-lock.json Update onchange devDependency to fix CI 2020-01-11 15:22:38 -08:00
package.json Update onchange devDependency to fix CI 2020-01-11 15:22:38 -08:00
scan-results.js Remove old scan page. 2019-12-03 15:58:43 -06:00
server.js fix #1191: ping fxa on email visits 2019-11-21 21:16:17 -06: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
    

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
    createdb test-blurts # for tests
    
  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.