2013-11-16 03:12:50 +04:00
# Firefox Accounts Content Server
2013-07-31 03:08:38 +04:00
2013-11-15 01:11:21 +04:00
[![Build Status ](https://travis-ci.org/mozilla/fxa-content-server.png )](https://travis-ci.org/mozilla/fxa-content-server)
2013-08-29 04:18:09 +04:00
2013-11-16 03:12:50 +04:00
Static server that hosts Firefox Account sign up, sign in, email verification, etc. flows.
2013-07-31 18:23:08 +04:00
2013-09-14 02:13:59 +04:00
## Prerequisites
* node 0.10.x or higher
* npm
2013-12-16 17:52:49 +04:00
* Grunt (`npm install -g grunt-cli`)
2013-12-10 03:22:13 +04:00
* PhantomJS (`npm install -g phantomjs`)
* bower (`npm install -g bower`)
2013-09-17 03:52:10 +04:00
* libgmp
* On Linux: install libgmp and libgmp-dev packages
* On Mac OS X: brew install gmp
2013-12-10 03:22:13 +04:00
* [fxa-auth-server ](https://github.com/mozilla/fxa-auth-server ) running on 127.0.0.1:9000.
2013-09-14 02:13:59 +04:00
2013-08-31 01:45:46 +04:00
## Development Setup
```
npm install
npm start
```
## Testing
2013-09-17 21:57:03 +04:00
### Setup
There is quite a bit of setup to do before you can test this service, which is non-optimal, but for now:
2013-08-01 00:32:47 +04:00
2013-12-10 03:22:13 +04:00
* Set up saucelabs credentials (we have an opensource account: `SAUCE_USERNAME=intern-example-ci` `SAUCE_ACCESS_KEY=89ac3089-17b3-4e9b-aaf3-c475b27fa441` )
* PhantomJS: `phantomjs --webdriver=4444` (see [Prerequisites ](#prerequisites ))
* Run the Firefox Content Server locally: `npm start`
* Run an instance of the [fxa-auth-server ](https://github.com/mozilla/fxa-auth-server ) at 127.0.0.1:9000.
2013-07-31 18:23:08 +04:00
2013-12-10 03:22:13 +04:00
e.g. in shell form:
2013-07-31 18:23:08 +04:00
2013-12-10 03:22:13 +04:00
```
export SAUCE_USERNAME=intern-example-ci
export SAUCE_ACCESS_KEY=89ac3089-17b3-4e9b-aaf3-c475b27fa441
phantomjs --webdriver=4444 &
cd fxa-auth-server
npm start &
cd ../fxa-content-server
npm start &
```
2013-07-31 18:23:08 +04:00
2013-12-10 03:22:13 +04:00
### Running the tests
2013-07-31 18:23:08 +04:00
2013-12-10 03:22:13 +04:00
To run tests locally against phantomjs:
2013-07-31 18:23:08 +04:00
2013-12-10 03:22:13 +04:00
npm test
2013-08-01 21:07:41 +04:00
2013-12-10 03:22:13 +04:00
To run tests against saucelabs:
2013-09-05 03:54:25 +04:00
2013-12-10 03:22:13 +04:00
npm run-script test-remote
2013-09-17 21:57:03 +04:00
2013-12-18 17:07:42 +04:00
### Advanced local testing using headed browsers
It is possible to run the Selenium tests against local browsers like Firefox, Chrome, and Safari.
#### Prerequisites:
* Java JDK or JRE (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
* Selenium Server (http://docs.seleniumhq.org/download/)
#### Configuration:
* edit `tests/intern.js` to select the browsers to test under `environments` .
* comment out `phantom`
#### Running the tests
* Start the Selenium Server: `java -jar selenium-server-standalone-2.38.0.jar`
* Stop PhantomJS if it is running.
* from the `fxa-content-server` directory, type `npm test`
2013-09-17 22:09:49 +04:00
## Configuration
2013-09-05 03:54:25 +04:00
2013-11-19 07:15:42 +04:00
The default auth server is `http://api-accounts.dev.lcip.org` . To change this,
2013-12-10 21:10:46 +04:00
edit `server/config/*.json` on your deployed instance.
2013-09-05 03:54:25 +04:00
{
2013-11-19 07:15:42 +04:00
'fxaccount_url': 'http://your.auth.server.here.org'
2013-09-05 03:54:25 +04:00
}
2013-12-10 21:10:46 +04:00
## Grunt Commands
[Grunt ](http://gruntjs.com/ ) is used to run common tasks to build, test, and run local servers.
* `grunt jshint` - run JSHint on client side and testing JavaScript.
2014-02-06 22:57:19 +04:00
* `grunt build` - build production resources.
* `grunt clean` - remove any built production resources.
2013-12-10 21:10:46 +04:00
* `grunt test` - run local Intern tests.
* `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.
2014-01-15 19:28:42 +04:00
## Servers
* latest development - https://accounts-latest.dev.lcip.org/
* testing - https://accounts.dev.lcip.org/
* stage - https://accounts.stage.mozaws.net/
* production - https://accounts.firefox.com/
2013-12-10 21:10:46 +04:00
2013-12-10 03:22:13 +04:00
## License
MPL 2.0