DEPRECATED - Migrated to https://github.com/mozilla/fxa
Перейти к файлу
Vijay Budhram 2e84e07e02 feat(email): Add flow events for email delivery notifications (#1626), r=@philbooth
Adds support for handling and processing `flowEvents` for email delivery.
2017-01-26 13:52:05 -05:00
bin feat(email): Add flow events for email delivery notifications (#1626), r=@philbooth 2017-01-26 13:52:05 -05:00
config feat(email): Add flow events for email delivery notifications (#1626), r=@philbooth 2017-01-26 13:52:05 -05:00
docs fix(docs): add unblock code API docs 2016-12-29 14:44:37 -05:00
grunttasks fix(deps): update dev deps and latest eslint 2016-09-14 00:51:51 -04:00
lib feat(email): Add flow events for email delivery notifications (#1626), r=@philbooth 2017-01-26 13:52:05 -05:00
scripts test(all): switch tap runner for mocha 2016-11-08 18:26:46 -08:00
test feat(email): Add flow events for email delivery notifications (#1626), r=@philbooth 2017-01-26 13:52:05 -05:00
.dockerignore feat(docker): Add Dockerfile for self-hosting 2016-01-26 09:34:45 +01:00
.env.dev feat(signin): Remove feature flag from sign-in confirmation. (#1530); r=vbudhram 2016-11-24 07:27:09 +11:00
.eslintrc test(lint): add lint for synchronous randomBytes usage 2016-10-27 13:42:26 -07:00
.gitignore feat(push): Add VAPID identification to push messages. (#1468); r=philbooth 2016-10-10 12:40:45 +11:00
.nsprc chore(nsp): remove exceptions (#1455) r=seanmonstar 2016-09-14 14:04:24 -04:00
.travis.yml chore(travis): remove the old tmp workaround 2016-11-22 10:07:38 -05:00
AUTHORS Add Rishi Baldawa to AUTHORS 2015-05-29 10:41:11 +10:00
CHANGELOG.md Release v1.78.0 2017-01-11 09:41:15 -05:00
CONTRIBUTING.md docs(contributing): Mention git commit guidelines 2016-01-21 12:24:41 +01:00
Gruntfile.js chore(build): Replacing JSHint with ESLint 2015-06-18 17:39:32 -07:00
LICENSE Add a proper copy of the MPL 2014-05-16 17:27:17 +12:00
README.md chore(deps): update to latest version of hapi (#1330) r=rfk,seanmonstar,vbudhram 2016-09-13 20:52:06 -04:00
Vagrantfile changed vagrant synced_folder to rsync 2014-03-11 13:53:44 -07:00
circle.yml feat(ci): add config for cross-repo testing 2017-01-26 17:42:53 +00:00
npm-shrinkwrap.json chore(mailer): update fxa-auth-mailer (and other shrinkwrap) (#1620) 2017-01-23 22:35:57 -05:00
package.json Release v1.78.0 2017-01-11 09:41:15 -05:00

README.md

Firefox Accounts Server

Build Status

This project implements the core server-side API for Firefox Accounts. It provides account, device and encryption-key management for the Mozilla Cloud Services ecosystem.

Overview

Detailed design document

Detailed API spec

Guidelines for Contributing

Prerequisites

  • node 4.5.0 or higher
  • npm
  • Grunt

Install

On some systems running the server as root will cause working directory permissions issues with node. It is recommended that you create a separate, standard user to ensure a clean and more secure installation.

Clone the git repository and install dependencies:

git clone git://github.com/mozilla/fxa-auth-server.git
cd fxa-auth-server
npm install

To start the server in dev memory store mode (ie. NODE_ENV=dev), run:

npm start

This runs a script scripts/start-local.sh as defined in package.json. This will start up 4 services, three of which listen on the following ports (by default):

  • bin/key_server.js on port 9000
  • test/mail_helper.js on port 9001
  • ./node_modules/fxa-customs-server/bin/customs_server.js on port 7000
  • bin/notifier.js (no port)

When you Ctrl-c your server, all 4 processes will be stopped.

To start the server in dev MySQL store mode (ie. NODE_ENV=dev), run:

npm run start-mysql

Testing

Run tests with:

npm test

To select a specific glob of tests to run:

npm test -- test/local/account_routes.js test/local/password_*
  • Note: stop the auth-server before running tests. Otherwise, they will fail with obscure errors.

Reference Client

https://github.com/mozilla/fxa-js-client

Dev Deployment

Refer to https://github.com/mozilla/fxa-dev.git.

Configuration

Configuration of this project is managed by convict, using the schema in config/index.js.

Default values from this schema can be overridden in two ways:

  1. By setting individual environment variables, as indicated by the env property for each item in the schema.

    For example:

    export CONTENT_SERVER_URL="http://your.content.server.org"
    
  2. By specifying the path to a conforming JSON file, or a comma-separated list of paths, using the CONFIG_FILES environment variable. Files specified in this way are loaded when the server starts. If the server fails to start, it usually indicates that one of these JSON files does not conform to the schema; check the error message for more information.

    For example:

    export CONFIG_FILES="~/fxa-content-server.json,~/fxa-db.json"
    

Troubleshooting

Firefox Accounts authorization is a complicated flow. You can get verbose logging by adjusting the log level in the config.json on your deployed instance. Add a stanza like:

"log": {
  "level": "trace"
}

Valid level values (from least to most verbose logging) include: "fatal", "error", "warn", "info", "trace", "debug".

Database integration

This server depends on a database server from the fxa-auth-db-mysql repo. When running the tests, it uses a memory-store that mocks behaviour of the production MySQL server.

License

MPL 2.0