From 3062c65b4f5193ce282e4bcc1da47e6ca68a7b4b Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 10 Dec 2017 17:55:07 +0330 Subject: [PATCH] Document environment vatiables --- README.md | 20 ++++++++++++++++++++ config/custom-environment-variables.js | 12 ++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2e8980e..22d2b7e 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ High performance, secure and easy to use image proxy based on [Sharp](https://gi - Built-in secure cache with human readable entries and resistant against duplicates. - Remote agnostic cache and input adapters. - Smart and auto cache cleaning. +- Twelve factor friendly. ## API @@ -49,6 +50,25 @@ Operation | Arguments | Example | Description `max` | - | max | Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to the `width` and `height` specified. `min` | - | min | Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to the width and height specified. +## Config + +Config can be customized using `IPX_*` environment variables or `config/local.js` file. Here are defaults: + +```js + ipx: { + input: { + adapter: 'IPX_INPUT_ADAPTER', // Default: fs.js + dir: 'IPX_INPUT_DIR' // Default: storage + }, + cache: { + adapter: 'IPX_CACHE_ADAPTER', // Default: fs.js + dir: 'IPX_CACHE_DIR', // Default: cache + cleanCron: 'IPX_CACHE_CLEAN_CRON', // Default: 0 0 3 * * * (every night at 3:00 AM) + maxUnusedMinutes: 'IPX_CACHE_CLEAN_MINUTES' // Default: 24 * 60 (24 hours) + } + } +``` + ## License MIT - Pooya Parsa diff --git a/config/custom-environment-variables.js b/config/custom-environment-variables.js index 594ccb6..8c1c4d9 100644 --- a/config/custom-environment-variables.js +++ b/config/custom-environment-variables.js @@ -1,14 +1,14 @@ module.exports = { ipx: { input: { - adapter: 'IPX_INPUT_ADAPTER', - dir: 'IPX_INPUT_DIR' + adapter: 'IPX_INPUT_ADAPTER', // Default: fs.js + dir: 'IPX_INPUT_DIR' // Default: storage }, cache: { - adapter: 'IPX_CACHE_ADAPTER', - dir: 'IPX_CACHE_DIR', - cleanCron: 'IPX_CACHE_CLEAN_CRON', - maxUnusedMinutes: 'IPX_CACHE_CLEAN_MINUTES' + adapter: 'IPX_CACHE_ADAPTER', // Default: fs.js + dir: 'IPX_CACHE_DIR', // Default: cache + cleanCron: 'IPX_CACHE_CLEAN_CRON', // Default: 0 0 3 * * * (every night at 3:00 AM) + maxUnusedMinutes: 'IPX_CACHE_CLEAN_MINUTES' // Default: 24 * 60 (24 hours) } } } -- knotmirror 0.0.1