fxa/README.md

66 строки
3.2 KiB
Markdown
Исходник Обычный вид История

2014-12-30 08:58:48 +03:00
## fxa-local-dev [![Build Status](https://travis-ci.org/vladikoff/fxa-local-dev.svg?branch=master)](https://travis-ci.org/vladikoff/fxa-local-dev)
2014-11-05 04:38:23 +03:00
> An easy way to contribute to Firefox Accounts
### Getting Started
2014-11-05 04:41:57 +03:00
- Install required system [dependencies](#dependencies)
2014-11-13 00:29:40 +03:00
- Clone this repository and run `npm install`. Here is the full command:
2014-11-05 04:38:23 +03:00
```
2014-11-05 04:41:57 +03:00
git clone https://github.com/vladikoff/fxa-local-dev.git && cd fxa-local-dev && npm i
```
2014-11-13 00:29:40 +03:00
After installation completes you can visit [127.0.0.1:3030](http://127.0.0.1:3030/) and use the [PM2 tool](https://github.com/Unitech/PM2#main-features) to start, stop and read server logs. Most common commands are as follows:
2014-11-05 04:41:57 +03:00
2014-12-30 08:58:48 +03:00
- `./pm2 start servers.json` **- start all servers.**
- ^ (WARNING: running the above command multiple times will spawn more of the same servers).
2014-12-12 02:34:57 +03:00
- `./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`.
2014-11-13 00:29:40 +03:00
- More commands on the [PM2 Readme](https://github.com/Unitech/PM2#main-features).
2014-11-05 04:38:23 +03:00
2014-12-30 09:02:54 +03:00
**Use `npm run update` to fetch the latest changes on the `master` branch.**
2014-12-17 06:25:58 +03:00
2015-02-10 06:00:24 +03:00
**Use `npm start` to start Firefox with local sync configurations.**
2014-12-30 08:57:38 +03:00
Available options:
2014-12-30 09:03:15 +03:00
* `FXA_ENV=local` or `latest` or `stable` (NOTE: `local` is default).
2014-12-30 08:57:38 +03:00
* `FIREFOX_BIN=/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin npm start`
2015-03-16 18:37:33 +03:00
### Workflow
2015-04-20 22:09:40 +03:00
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:
2015-03-16 18:37:33 +03:00
![](http://i.imgur.com/eqL8FiZ.png)
To avoid wasting computer resources while not working on FxA make sure to stop the servers using `./pm2 kill`.
2015-03-16 18:38:39 +03:00
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.
2015-03-16 18:37:33 +03:00
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:
![](http://i.imgur.com/oGYXSPl.png)
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.
2014-12-30 08:57:38 +03:00
2014-11-05 04:38:23 +03:00
### Dependencies
2014-12-30 08:58:48 +03:00
[Git](http://git-scm.com/book/en/v2/Getting-Started-Installing-Git),
[node.js](http://nodejs.org/),
2015-04-07 23:01:30 +03:00
[Python 2.6+](https://www.python.org/),
2014-12-30 08:58:48 +03:00
[Redis](http://redis.io/),
[libgmp](https://gmplib.org/),
[graphicsmagick](http://www.graphicsmagick.org/).
2014-11-05 04:38:23 +03:00
2015-04-07 23:05:11 +03:00
#### OSX (with [Brew](http://brew.sh/)):
##### `brew install gmp redis graphicsmagick`
##### `sudo easy_install pip && sudo pip install virtualenv`
2014-11-05 04:38:23 +03:00
(You might also need to run `xcode-select --install` to get OS X Command Line Tools)
2015-04-07 23:05:11 +03:00
#### Ubuntu:
2015-04-22 16:54:12 +03:00
```
sudo apt-get install libgmp3-dev graphicsmagick redis-server python-virtualenv python-dev
```
2015-02-10 06:00:24 +03:00
#### FreeBSD:
Use [bigint fix](https://github.com/substack/node-bigint/pull/29): `"bigint": "git://github.com/frasertweedale/node-bigint.git#fix/freebsd-build"`