updated readme. made redis optional in dev

This commit is contained in:
Danny Coates 2017-08-25 13:58:51 -07:00
parent 663023a204
commit 131a8b5564
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
4 changed files with 29 additions and 5 deletions

View File

@ -16,17 +16,23 @@ A file sharing experiment which allows you to send encrypted files to other user
## Requirements
- [Node.js 8.2+](https://nodejs.org/)
- [Redis server](https://redis.io/)
- [Redis server](https://redis.io/) (optional for development)
- [AWS S3](https://aws.amazon.com/s3/) or compatible service. (optional)
**NOTE:** To run the project, make sure you have a Redis server running locally:
---
## Development
To start an ephemeral development server run:
```sh
$ redis-server /usr/local/etc/redis.conf
npm install
npm start
```
---
## How to use it
## Commands
| Command | Description |
|------------------|-------------|
@ -39,6 +45,12 @@ $ redis-server /usr/local/etc/redis.conf
---
## Configuration
The server is configured with environment variables. See [server/config.js] for all options and [docs/docker.md](doc/docker.md) for examples.
---
## Localization
Firefox Send localization is managed via [Pontoon](https://pontoon.mozilla.org/projects/test-pilot-firefox-send/), not direct pull requests to the repository. If you want to fix a typo, add a new language, or simply know more about localization, please get in touch with the [existing localization team](https://pontoon.mozilla.org/teams/) for your language, or Mozillas [l10n-drivers](https://wiki.mozilla.org/L10n:Mozilla_Team#Mozilla_Corporation) for guidance.

6
package-lock.json generated
View File

@ -9423,6 +9423,12 @@
"resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.3.1.tgz",
"integrity": "sha1-gdgm9F+pyLIBH0zXoP5ZfSQdRCs="
},
"redis-mock": {
"version": "0.20.0",
"resolved": "https://registry.npmjs.org/redis-mock/-/redis-mock-0.20.0.tgz",
"integrity": "sha1-lKOVhlurvOv1OLa1mUFyPkgHMBA=",
"dev": true
},
"redis-parser": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-2.6.0.tgz",

View File

@ -76,6 +76,7 @@
"prettier": "^1.5.3",
"proxyquire": "^1.8.0",
"raven-js": "^3.17.0",
"redis-mock": "^0.20.0",
"require-from-string": "^1.2.1",
"rimraf": "^2.6.1",
"selenium-webdriver": "^3.5.0",

View File

@ -10,7 +10,12 @@ const mozlog = require('./log');
const log = mozlog('send.storage');
const redis = require('redis');
const redis_lib =
config.env === 'development' && config.redis_host === 'localhost'
? 'redis-mock'
: 'redis';
const redis = require(redis_lib);
const redis_client = redis.createClient({
host: config.redis_host,
connect_timeout: 10000