Git Product home page Git Product logo

fxa-local-dev's Introduction

fxa-local-dev Build Status

An easy way to contribute to Firefox Accounts

Getting Started

  • 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 process 1.
  • ./pm2 stop 1 - stop process 1.
  • ./pm2 restart 1 - restart process 1.
  • More commands on the PM2 Readme.

Use npm run update to fetch the latest changes to servers


Firefox Custom Profile

Use npm start to start Firefox with local server configurations. Available options:

  • FXA_ENV=local or latest or stable (NOTE: local is default).
  • FIREFOX_BIN=/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin npm start

Functional Tests

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


Workflow

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.


Dependencies

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

Ubuntu:
sudo apt-get install build-essential git-core libgmp3-dev graphicsmagick redis-server python-virtualenv python-dev

Installing Node.js

OS X

Find the latest node-v0.10.x.pkg at nodejs.org/dist/ and install. Example node-v0.10.38.pkg

Ubuntu:
curl -sL https://deb.nodesource.com/setup_0.10 | sudo bash -
sudo apt-get install -y nodejs

Updating NPM

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]

Installing Java

OS X:

Download from java.com/en/download/

Ubuntu:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

fxa-local-dev's People

Contributors

jrgm avatar rfk avatar vladikoff avatar zaach avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.