DEPRECATED - Migrated to https://github.com/mozilla/fxa
Перейти к файлу
Shane Tomlinson de8e355de0 chore(bulk-mailer): Stop all processing on error.
bulk-mailer will exit with a non-0 status code if there is an error.
The bash scripts check exit codes and abort on non-0
2016-04-12 00:52:22 -04:00
bin refactor(bounces): Make bounce-handling code testable, add some tests. 2016-02-12 07:42:38 +11:00
config log failed uids in must-reset.js, other nits 2016-04-12 00:51:50 -04:00
docs feat(reset): Ability to put a users account in a "must reset" state, per dannycoates (PATCH) 2016-04-12 00:11:31 -04:00
grunttasks chore(tasks): add markdown changelog 2016-01-04 10:28:30 -05:00
lib feat(reset): Ability to put a users account in a "must reset" state, per dannycoates (PATCH) 2016-04-12 00:11:31 -04:00
scripts chore(bulk-mailer): Stop all processing on error. 2016-04-12 00:52:22 -04:00
test fix(tests): Build and test fixes for latest fxa-auth-mailer update. 2016-04-12 00:17:18 -04:00
.dockerignore feat(docker): Add Dockerfile for self-hosting 2016-01-26 09:34:45 +01:00
.env.dev fix(log): add mozlog fmt properly 2015-12-29 19:37:51 -05:00
.eslintrc
.gitignore
.travis.yml chore(test): no need to test with node v0.12 2016-02-23 10:36:00 -08:00
AUTHORS
CHANGELOG.md Release v1.59.0 2016-03-27 19:09:42 -07:00
CONTRIBUTING.md docs(contributing): Mention git commit guidelines 2016-01-21 12:24:41 +01:00
Gruntfile.js
LICENSE
README.md chore(docs): remove misleading references to awsbox 2015-12-21 17:50:44 -08:00
Vagrantfile
npm-shrinkwrap.json fix(email): Point to latest auth-mailer 2016-04-11 23:58:28 -04:00
package.json feat(scripts): Add a bulk mailer 2016-04-12 00:45:13 -04: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 0.10.x or higher
  • npm

Install

You'll need node 0.10.x or higher and npm to run the server. On some systems running the server as root will cause working directory permissions issues with node. It is recommended that you create a seperate, 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
  • 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.

Using with FxOS

By default, FxOS uses the production Firefox Accounts server (api.accounts.firefox.com/v1). If you want to use a different account server on a device, you need to update a preference value identity.fxaccounts.auth.uri.

user_pref("identity.fxaccounts.auth.uri", "https://api-accounts.stage.mozaws.net/v1");
  • ./modPref.sh push prefs.js

License

MPL 2.0