Add environment variable support for cache engine (Redis)#2
Merged
Conversation
Extends config.loader.js to apply IFRAMELY_* env vars as a final override layer on top of file-based config, enabling container deployments to configure the cache engine and Redis connection without mounting a config.local.js file. Supported variables: IFRAMELY_CACHE_ENGINE redis | node-cache | memcached | no-cache IFRAMELY_CACHE_TTL cache TTL in seconds IFRAMELY_REDIS_HOST Redis hostname or IP IFRAMELY_REDIS_PORT Redis port IFRAMELY_REDIS_PASSWORD Redis auth password IFRAMELY_REDIS_TLS true to enable TLS socket IFRAMELY_REDIS_MODE standard | cluster Redis connection options are only applied when the effective cache engine resolves to redis (from env var or file config), preventing accidental REDIS_OPTIONS injection when a different engine is in use. Also updates docker-compose.yml with a Redis service for local testing, with a healthcheck and depends_on so iframely only starts once Redis is ready. Co-authored-by: Plane AI <noreply@plane.so>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
config.loader.jsto applyIFRAMELY_*env vars as a final override layer on top of file-based configredis— no accidental injection when usingnode-cacheor other enginesdocker-compose.ymlwith a bundled Redis service for local testing, with healthcheck anddepends_onorderingEnvironment variables
IFRAMELY_CACHE_ENGINEredis|node-cache|memcached|no-cacheIFRAMELY_CACHE_TTLIFRAMELY_REDIS_HOSTIFRAMELY_REDIS_PORTIFRAMELY_REDIS_PASSWORDIFRAMELY_REDIS_TLStrue|falseIFRAMELY_REDIS_MODEstandard|clusterTest plan
docker compose buildsucceededdocker compose up -d— iframely + Redis both healthyUsing cache engine: redisand local whitelist loaded (1886 domains, no external calls)GET /iframely?url=https://github.com— valid response returnedredis-cli keys "*"showsmeta:https://github.comcached in Redis after first requestCo-authored-by: Plane AI noreply@plane.so