DEPRECATED - Migrated to https://github.com/mozilla/fxa
Перейти к файлу
Danny Coates e480f4885a deprecate smtp.verificationUrl and passwordResetUrl in favor of contentServer.url 2014-04-23 16:42:42 -07:00
bin broke out customs server into a seperate process/repo 2014-04-18 19:05:47 -07:00
bounces it's complainedRecipients (even though complaintRecipients does seem more natural) 2014-04-15 19:53:57 -07:00
client implemented /account/status fixes #656 2014-03-30 12:24:05 -07:00
config deprecate smtp.verificationUrl and passwordResetUrl in favor of contentServer.url 2014-04-23 16:42:42 -07:00
crypto
db Comment out reverse patches, just in case 2014-03-27 15:47:28 +13:00
docs remove incorrect 400/102s from api.md error docs 2014-04-07 14:26:16 -07:00
loadtest Add a call to /session/status in the loadtest 2014-03-25 16:01:01 +11:00
resources/i18n
routes broke out customs server into a seperate process/repo 2014-04-18 19:05:47 -07:00
scripts broke out customs server into a seperate process/repo 2014-04-18 19:05:47 -07:00
server broke out customs server into a seperate process/repo 2014-04-18 19:05:47 -07:00
templates
test fixed email complaint tests 2014-04-16 10:37:06 -07:00
tokens SERENITY NOW. reformat bundle.js 2014-03-13 13:35:44 -07:00
.awsbox.json
.gitignore
.jshintrc
.travis.yml debugging travis 2014-04-21 12:40:59 -07:00
CHANGELOG train-11 2014-04-21 15:05:08 -07:00
Gruntfile.js
LICENSE
README.md chore(build): Use the new Travis CI badge 2014-03-21 16:10:46 -07:00
Vagrantfile changed vagrant synced_folder to rsync 2014-03-11 13:53:44 -07:00
customs.js added 1 second request timeout to customs server 2014-04-21 11:34:11 -07:00
error.js Make sure bin/key_server.js checks what the db patch level is 2014-03-19 17:14:15 +13:00
i18n.js step 1 in fixing i18n 2014-03-09 17:33:52 -07:00
log.js Exit key_server when stdout is piped and the other process exits 2014-03-23 19:01:50 -07:00
mailer.js step 1 in fixing i18n 2014-03-09 17:33:52 -07:00
memory_monitor.js
npm-shrinkwrap.json updated customs server 2014-04-21 11:13:03 -07:00
package.json train-11.1 ... already 2014-04-21 17:22:51 -07:00
promise.js
requestp.js train-11.1 ... already 2014-04-21 17:22:51 -07: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

Prerequisites

  • node 0.10.x or higher
  • npm
  • pgrep
    • Usually available by default on Mac OS X 10.8+ and Linux.
    • On older versions of Mac OS X, get it via: brew install proctools.
  • libgmp
    • On Linux: install libgmp and libgmp-dev packages
    • On Mac OS X: brew install gmp

Install

You'll need node 0.10.x or higher and npm to run the server.

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, run:

npm start

It will listen on http://localhost:9000 by default.

Testing

Run tests with:

npm test

Reference Client

A node library that implements the client side of the protocol and an example script is located in the /client directory.

Dev Deployment

There is a development server running the moz-svc-dev AWS environment, at the following address:

https://api-accounts.dev.lcip.org/

It is managed using awsbox. You can force-push a particular version of the code by doing:

$> git remote add api-dev-lcip-org app@api-accounts.dev.lcip.org:git
$> git push api-dev-lcip-org HEAD:master

The dev deployment is configured to send emails via Amazon SES. If you need to re-create, or want to stand up a similar server, you will need to:

  1. Obtain the SES SMTP credentials; ping @rfk or @zaach for details.
  2. Deploy the new machine using awsbox.
  3. Configure postfix to use the SES credentials:
    1. Edit /etc/postfix/sasl_passwd to insert the SES credentials.
    2. Run /usr/sbin/postmap /etc/postfix/sasl_passwd to compile them.
    3. Edit /etc/postfix/main.cf to change 'relayhost' to the SES SMTP host (typically "email-smtp.us-east-1.amazonaws.com:587").
    4. Run service postfix restart to restart postfix.

There is also a "bleeding edge" development server that is configured to auto-update itself from the latest github master. It may be useful for testing out new protocol changes, but should be considered unstable for general development use:

https://api-accounts-latest.dev.lcip.org/

Configuration

To set the url of the content server, edit config.json on your deployed instance and add:

"contentServer": {
  "url": "http://your.content.server.org"
}

MySQL setup

Install MySQL

Mac

Installation is easy with homebrew. I use mariadb which is a fork of mysql but either should work.

brew install mariadb

Follow the homebrew instructions for starting the server. I usually just do

mysql.server start

Linux

Install MySQL and start it.

Execution

Our test suite assumes mysql uses it's default configuration. See config/config.js for the override ENV variables if you have different root user password or other user. Now you should be able to run the test suite from the project root directory.

DB_BACKEND=mysql npm test

Or run the local server

DB_BACKEND=mysql npm start

Cleanup

You may want to clear the data from the database periodically. I just drop the database:

mysql -uroot -e"DROP DATABASE fxa"

The server will automatically re-create it on next use.

License

MPL 2.0