Merge pull request #295 from mozilla/envvar

renamed environment variables to remove P2P_ prefix
This commit is contained in:
Danny Coates 2017-07-24 14:30:09 -07:00 committed by GitHub
commit 5db8a20b9d
3 changed files with 19 additions and 9 deletions

View File

@ -7,6 +7,6 @@ services:
ports:
- "1443:1443"
environment:
- P2P_REDIS_HOST=redis
- REDIS_HOST=redis
redis:
image: redis:alpine

View File

@ -3,12 +3,22 @@
| Name | Description
|------------------|-------------|
| `PORT` | Port the server will listen on (defaults to 1443).
| `P2P_S3_BUCKET` | The S3 bucket name.
| `P2P_REDIS_HOST` | Host name of the Redis server.
| `S3_BUCKET` | The S3 bucket name.
| `REDIS_HOST` | Host name of the Redis server.
| `GOOGLE_ANALYTICS_ID` | Google Analytics ID
| `SENTRY_CLIENT` | Sentry Client ID
| `SENTRY_DSN` | Sentry DSN
| `MAX_FILE_SIZE` | in bytes (defaults to 2147483648)
| `NODE_ENV` | "production"
## Example:
```sh
$ docker run --net=host -e 'NODE_ENV=production' -e 'P2P_S3_BUCKET=testpilot-p2p-dev' -e 'P2P_REDIS_HOST=dyf9s2r4vo3.bolxr4.0001.usw2.cache.amazonaws.com' mozilla/send:latest
$ docker run --net=host -e 'NODE_ENV=production' \
-e 'S3_BUCKET=testpilot-p2p-dev' \
-e 'REDIS_HOST=dyf9s2r4vo3.bolxr4.0001.usw2.cache.amazonaws.com' \
-e 'GOOGLE_ANALYTICS_ID=UA-35433268-78' \
-e 'SENTRY_CLIENT=https://51e23d7263e348a7a3b90a5357c61cb2@sentry.prod.mozaws.net/168' \
-e 'SENTRY_DSN=https://51e23d7263e348a7a3b90a5357c61cb2:65e23d7263e348a7a3b90a5357c61c44@sentry.prod.mozaws.net/168' \
mozilla/send:latest
```

View File

@ -4,12 +4,12 @@ const conf = convict({
s3_bucket: {
format: String,
default: '',
env: 'P2P_S3_BUCKET'
env: 'S3_BUCKET'
},
redis_host: {
format: String,
default: 'localhost',
env: 'P2P_REDIS_HOST'
env: 'REDIS_HOST'
},
listen_port: {
format: 'port',
@ -25,12 +25,12 @@ const conf = convict({
sentry_id: {
format: String,
default: '',
env: 'P2P_SENTRY_CLIENT'
env: 'SENTRY_CLIENT'
},
sentry_dsn: {
format: String,
default: '',
env: 'P2P_SENTRY_DSN'
env: 'SENTRY_DSN'
},
env: {
format: ['production', 'development', 'test'],
@ -40,7 +40,7 @@ const conf = convict({
max_file_size: {
format: Number,
default: 1024 * 1024 * 1024 * 2,
env: 'P2P_MAX_FILE_SIZE'
env: 'MAX_FILE_SIZE'
},
expire_seconds: {
format: Number,