Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Firefox Accounts Content Server
branch: master
Failed to load latest commit information.
app fix(docs): Correct the documentation of the afterResetPasswordConfirm…
docs feat(oauth): Expose relier-specific encryption keys to OAuth WebChann…
grunttasks fix(l10n): join server templates so email strings are not overwritten
locale fix(l10n): join server templates so email strings are not overwritten
scripts Remove grunt-blanket-mocha
server Merge pull request #2159 from mozilla/issue-2158-blank-templates
tests feat(signup): suggest proper email spelling
.awsbox.json add static directory configuration param and fix awsbox config
.bowerrc Fixed gitignore. Added .bowerrc.
.editorconfig Generated basic Yeoman project.
.gitattributes Generated basic Yeoman project.
.gitignore Remove the CSS source maps, add *.map to the .gitignore.
.jscsrc style(app): Tweaking jscs rules to force a space after the function k…
.jshintrc chore(style): JSHint updates
.travis.yml chore(tests): update to selenium 2.45.0
AUTHORS fix(docs): update AUTHORS list
CHANGELOG.md Release v0.32.0
CONTRIBUTING.md fix(docs): add Bower usage to CONTRIBUTING
Dockerfile feat(docker): Dockerfile and README update for basic docker developme…
Gruntfile.js fix(logging): switch to mozlog
LICENSE Add MPL 2.0 license file.
README.md chore(tests): update to selenium 2.45.0
bower.json feat(signup): suggest proper email spelling
npm-shrinkwrap.json fix(logging): switch to mozlog
package.json Release v0.32.0

README.md

Firefox Accounts Content Server

Travis Tests: Build Status: Travis Coverage Status Functional Tests: Build Status: Functional Tests

Static server that hosts Firefox Account sign up, sign in, email verification, etc. flows.

Prerequisites

  • node 0.10.x
  • npm
  • Grunt (npm install -g grunt-cli)
  • libgmp
    • On Linux, Install libgmp and libgmp-dev packages: sudo apt-get install libgmp3-dev
    • On Mac OS X: brew install gmp
  • fxa-auth-server running on 127.0.0.1:9000.

Development Setup

cp server/config/local.json-dist server/config/local.json
npm install
npm start

It will listen on http://127.0.0.1:3030 by default.

Note: If you have issues with npm install please update to npm 2.0+ using npm install -g npm@2 (Issue #1594)

Docker Based Development

To run the content server via Docker, three steps are required:

$ docker build --rm -t mozilla/fxa_content_server .
$ docker run --rm -v $PWD:/opt/fxa mozilla/fxa_content_server npm install
$ docker run -it --rm -v $PWD:/opt/fxa --net=host mozilla/fxa_content_server

This method shares the codebase into the running container so that you can install npm and various modules required by package.json. It then runs FxA content server in a container, while allowing you to use your IDE of choice from your normal desktop environment to develop code.

Be sure to copy server/config/local.json-dist to server/config/local.json per usual before the final docker invocation to run the service.

Note to boot2docker users: you must edit your server/config/local.json to use the correct IP of your boot2docker VM. Check with the command: boot2docker ip

Then replace the public_url IP address in local.json that reads: "public_url": "http://127.0.0.1:3030" with the IP that you noted above. It should be something like 192.168.59.103.

To stop the container, first try CTRL+C. If that does not work, run docker ps |grep fxa_content_server to get the hexadecimal Container ID (the first column of output). Run docker stop nnnnnnnnnnnn where the nnnn part is the Container ID.

Testing

Prerequisites:

Setup

  • Run Selenium Server
  • Run the Firefox Content Server locally: npm start
  • Run an instance of the fxa-auth-server at 127.0.0.1:9000.

e.g. in shell form:

java -jar selenium-server-standalone-2.43.1.jar &
cd fxa-auth-server
npm start &
cd ../fxa-content-server
npm start &

To run tests locally with Selenium:

npm test

To change the default auth server edit server/config/*.json on your deployed instance.

{
  "fxaccount_url": "http://your.auth.server.here.org"
}

Note that testing with Selenium via Docker does not work at present, so all testing must be carried out via your normal operating system's npm & Java tooling.

Grunt Commands

Grunt is used to run common tasks to build, test, and run local servers.

TASK DESCRIPTION
grunt build build production resources. See task source for more documentation
grunt clean remove any built production resources.
grunt lint run JSHint, JSONLint, and JSCS (code style checker) on client side and testing JavaScript.
grunt server run a local server running on port 3030 with development resources.
grunt server:dist run a local server running on port 3030 with production resources. Production resources will be built as part of the task.
grunt test run local Intern tests.
grunt version stamp a new minor version. Updates the version number and creates a new CHANGELOG.md.
grunt version:patch stamp a new patch version. Updates the version number and creates a new CHANGELOG.md.

Servers

License

MPL 2.0

Something went wrong with that request. Please try again.