DEPRECATED - Migrated to https://github.com/mozilla/fxa
Перейти к файлу
Danny Coates 0412d23f32 default mysql connection limits to 10 2014-02-23 18:35:35 -08:00
bin first steps in lastAuthAt 2014-02-11 10:53:40 -08:00
client first steps in lastAuthAt 2014-02-11 10:53:40 -08:00
config default mysql connection limits to 10 2014-02-23 18:35:35 -08:00
crypto change pbkdf2.derive len parameter to use byte length instead of bit length to be consistent with other functions 2014-02-19 16:28:37 -08:00
db update verifierVersion on account reset and password change 2014-02-19 18:19:39 -08:00
docs updated authAt description 2014-02-12 17:47:11 -08:00
loadtest Merge pull request #572 from mozilla/rfk/loadtest-destroy-ops 2014-02-18 11:10:53 -08:00
resources/i18n First, rough attempt at internationalization of emails. 2013-12-09 12:53:24 +11:00
routes update verifierVersion on account reset and password change 2014-02-19 18:19:39 -08:00
scripts fixes #544 2014-02-06 17:32:34 -08:00
server removed assertLogs 2014-02-14 12:10:39 -08:00
templates/email Fixes #527 : Remove 'Report It' link 2014-02-04 10:31:43 +13:00
test update verifierVersion on account reset and password change 2014-02-19 18:19:39 -08:00
tokens first steps in lastAuthAt 2014-02-11 10:53:40 -08:00
.awsbox.json Simplify and cleanup heka+awsbox setup. 2013-09-23 11:52:48 +10:00
.gitignore use ass for code coverage - issue #94 2013-12-18 09:03:17 +02:00
.jshintrc fixed jshint complaints 2013-11-01 14:29:39 -07:00
.travis.yml fixes #544 2014-02-06 17:32:34 -08:00
CHANGELOG added CHANGELOG 2014-02-18 11:34:12 -08:00
Gruntfile.js Merge pull request #473 from pdehaan/grunt-refac 2014-01-08 12:41:21 -08:00
LICENSE Skeleton Hapi app 2013-05-13 17:00:22 -07:00
README.md fixes #544 2014-02-06 17:32:34 -08:00
Vagrantfile added vmware fusion to vagrantfile 2014-01-02 10:42:27 -08:00
error.js Implement log summary line 2014-02-13 22:21:26 -08:00
i18n.js add content-langauge header to sent emails 2014-02-10 14:14:50 -08:00
log.js Implement log summary line 2014-02-13 22:21:26 -08:00
mailer.js add content-langauge header to sent emails 2014-02-10 14:14:50 -08:00
memory_monitor.js Add missing copyright headers 2013-07-25 18:49:45 -07:00
noncedb.js updated then-redis for promise compatibility 2014-01-21 14:29:04 -08:00
package.json updated mysql module 2014-02-23 18:34:22 -08:00
promise.js created promise.js for easy lib switching. 2014-01-09 00:01:04 -08: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