An easy way to contribute to Firefox Accounts. If you have issues please ask in
#fxaon Mozilla IRC.
⚠️NOTE: Do not use this project in production, this is only for local development.
Manually install the system dependencies for OS X or Ubuntu.
Clone this repository.
git clone https://github.com/mozilla/fxa-local-dev.git
cd fxa-local-dev npm install
Use the PM2 tool to stop and start the servers, and read server logs.
To start all servers with mysql database
./pm2 start mysql_servers.json
To start all servers with memory
./pm2 start servers.json
The most common commands are:
./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 process
./pm2 stop 1- stop process
./pm2 restart 1- restart process
More commands in the PM2 Readme.
When you want to fetch the latest changes to all servers:
npm run update
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
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.
Verifying email and viewing logs
./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 using the form on
127.0.0.1:3030/signup the (mailer) logs will print out the verification link that you need to copy paste into your browser to verify your account locally:
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.
Brew):OS X (with
Xcode and OS X Command Line Tools are required, install it and verify that command line tools installed:
sudo easy_install pip && sudo pip install virtualenv
sudo apt-get install build-essential git-core libgmp3-dev graphicsmagick python-virtualenv python-dev docker-ce
Docker commands require sudo, to avoid it, follow steps below:
- Add the docker group if it doesn't already exist
sudo groupadd docker
- Add the connected user $USER to the docker group
sudo gpasswd -a $USER docker
- Restart the docker daemon
sudo service docker restart
NOTE: If you are experienced with Node.js: Use nvm to force node 8 just for
nvm use 8. (Install it first with
nvm install 8)
Ubuntu / Debian:
# Using Ubuntu curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs # Using Debian, as root curl -sL https://deb.nodesource.com/setup_8.x | bash - apt-get install -y nodejs
NOTE: Node 8 and greater require C++11, that does not come by default on Ubuntu 12.
Java is used to run Selenium functional tests
Download from java.com/en/download/
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer
Firefox Custom Profile
npm start to start Firefox with local server configurations.
FXA_E10S=true- add this flag to turn on E10S. (NOTE:
FIREFOX_BIN=/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin npm start
FIREFOX_DEBUGGER=true- open Browser Toolbox on start (NOTE:
falseby default for speed).
The following requires the JDK and tests the local servers only.
npm test - all functional tests
npm run test-oauth - only OAuth functional tests
Firefox for Android
Skip this if you are not working on Firefox for Android and FxA.
You can test sync locally in Firefox for Android using an emulator or a device on the same network. These docs were tested with the Genymotion simulator.
- Install Firefox on the device or emulator.
npm run start-androidthis will: stop all local FxA servers, create a local PM2 configuration and rerun the servers.
The script will tell you which IP to use to work with FxA.
Follow the instructions of the script to update values in
Firefox for iOS
Skip this if you are not working on Firefox for iOS and FxA.
You can test sync locally in Firefox iOS using the XCode simulator. Follow the steps at github.com/mozilla/firefox-ios and setup firefox-ios build locally. Currently there is no way to dynamically switch servers in Firefox for iOS, to use local servers you need to run the script below:
FIREFOX_IOS_HOME=<path_to_firefox_ios_project> npm run config-fxios
After the script you need to rebuild firefox-ios.
OAuth Console Developer Accounts
Skip this if you are not working on managing OAuth clients or working on the OAuth console.
To use the fxa-oauth-console to manage OAuth clients you need to run the fxa-oauth-server in MySQL mode
./pm2 start mysql_servers.json
Running with MailDev
If you want to inspect emails, you can run fxa-local-dev with MailDev.
npm install maildev -g
./pm2 start servers.json ./pm2 stop 0
Once services have started, you can start MailDev on port 9999. You might have to start MailDev with sudo permissions.
sudo maildev -s 9999
All emails sent can be viewed from