Skip to content

Commit

Permalink
simplified environment variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos committed Jun 19, 2015
1 parent 73e59fe commit d238b83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ Bellow is a full list of environment variables you can set to configure the beha
| `KAMU_HOST` | fully qualified hostname of your server. **must set to the appropriate value** |
| `KAMU_PORT` | host port. (default to: `8081`) |
| `KAMU_AGENT` | agent string to be sent when requesting external assets as the `via` request header. (default to: `kamu.asset.proxy-{#app-version}`) |
| `KAMU_LENGTH_LIMIT` | asset size limit in bytes. (defaults to: `5242880`) |
| `KAMU_MAX_REDIRECTS` | maximum number of redirects to follow for an external asset request. (default to: `4`) |
| `KAMU_SOCKET_TIMEOUT` | maximum waiting time for an external request in seconds. (default to: `10`) |
| `KAMU_LENGTH` | asset size limit in bytes. (defaults to: `5242880`) |
| `KAMU_REDIRECTS` | maximum number of redirects to follow for an external asset request. (default to: `4`) |
| `KAMU_TIMEOUT` | maximum waiting time for an external request in seconds. (default to: `10`) |
| `KAMU_KEEP_ALIVE` | flag defining if the connection should be kept open to be reused by multiple requests, or if they should be closed after every request. (defaults to: `false`) |
| `KAMU_TIMING_ALLOW_ORIGIN` | list of domains that are allowed to collect timings data, set to false to disable the feature - for more info [check here](). (default to: `false`) |
| `KAMU_TIMINGS` | list of domains that are allowed to collect timings data, set to false to disable the feature - for more info [check here](). (default to: `false`) |
| `KAMU_LOGGING` | set the logging permissions for the server. possible options are `debug`, `enabled` and `disabled`. (default to: `disabled`) |

Aside from the environment variables you can define, you can also limit the `content-type` of assets you want to allow, for that use the [mime-types.json](mime-types.json) file available.
Expand Down
8 changes: 4 additions & 4 deletions proxy/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ exports.proxyAgent = process.env.KAMU_AGENT || ( 'kamu.asset.proxy-' + meta


// maximum number of redirects to follow for a media asset request
exports.maxRedirects = process.env.KAMU_MAX_REDIRECTS || 4;
exports.maxRedirects = process.env.KAMU_REDIRECTS || 4;
// maximum waiting time for a media asset response (in seconds)
exports.socketTimeout = process.env.KAMU_SOCKET_TIMEOUT || 10;
exports.socketTimeout = process.env.KAMU_TIMEOUT || 10;
// true - will keep the connection open | false will close the connection for every request
exports.keepAlive = process.env.KAMU_KEEP_ALIVE || false;


// list of domains that are allowed to get timings requests - cross-domain timings
// set to false to block timings from all external domains
exports.timingOrigin = process.env.KAMU_TIMING_ALLOW_ORIGIN || false;
exports.timingOrigin = process.env.KAMU_TIMINGS || false;
// media asset length limit in bytes - defaults to 5Mb
exports.lengthLimit = parseInt( ( process.env.KAMU_LENGTH_LIMIT || 5242880 ), 10 );
exports.lengthLimit = parseInt( ( process.env.KAMU_LENGTH || 5242880 ), 10 );
// valid content types
exports.validTypes = require( path.resolve( __dirname, '../', 'mime-types.json' ) );

Expand Down

0 comments on commit d238b83

Please sign in to comment.