An easy way to contribute to Firefox Accounts
- Install required system dependencies
- Clone this repository and run
npm install
. Here is the full command:
git clone https://github.com/mozilla/fxa-local-dev.git && cd fxa-local-dev && npm i
After installation completes visit 127.0.0.1:3030. Use the PM2 tool to start, stop and read server logs. Most common commands are as follows:
./pm2 start servers.json
- start all servers.- ^ (WARNING: running the above command multiple times will spawn more of the same servers).
./pm2 kill
- stop all servers../pm2 status
- display running servers../pm2 logs
- logs for all servers (note: this must be used to verify accounts)../pm2 logs 1
- display logs for process1
../pm2 stop 1
- stop process1
../pm2 restart 1
- restart process1
.- More commands on the PM2 Readme.
Use npm run update
to fetch the latest changes to servers
Use npm start
to start Firefox with local server configurations.
Available options:
FXA_ENV=local
orlatest
orstable
(NOTE:local
is default).FIREFOX_BIN=/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin npm start
The following requires Java and tests the local servers only.
Use npm test
- all functional tests
Use npm run test-oauth
- only OAuth functional tests
This is an example workflow for fxa-local-dev.
After installing fxa-local-dev the servers should automatically start up. Use ./pm2 status
command to check the status of the servers:
To avoid wasting computer resources while not working on FxA make sure to stop the servers using ./pm2 kill
.
Once you are back working on FxA just use the ./pm2 start servers.json
command to bring the servers back up. Keep in mind that the memory store will restart and all your database data will be brand new.
Use the ./pm2 logs
command to get the logs of all servers. You may also use ./pm2 logs [id]
to just see the logs for that particular server. When you signup for an account via localhost:3030/signup
the auth-server
logs will print out the verification link that you need to copy paste into your browser to verify your account:
If you get an error
status for any of the servers please verify that you installed all required dependencies. Otherwise file an issue on this repository.
Required dependencies: Git, node.js 0.10 with npm 2.4+, Python 2.6+, Redis, libgmp, graphicsmagick.
OS X (with Brew):
brew install gmp redis graphicsmagick
sudo easy_install pip && sudo pip install virtualenv
You might also need to run
xcode-select --install
to get OS X Command Line Tools
sudo apt-get install build-essential git-core libgmp3-dev graphicsmagick redis-server python-virtualenv python-dev
Find the latest node-v0.10.x.pkg
at nodejs.org/dist/ and install. Example node-v0.10.38.pkg
curl -sL https://deb.nodesource.com/setup_0.10 | sudo bash -
sudo apt-get install -y nodejs
Check your npm version using
npm --version
. If it is lower than 2.4 then please upgrade.
All OS:
sudo npm install -g [email protected]
Download from java.com/en/download/
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer