diff --git a/README.md b/README.md index f9d254c4..b3a82404 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Options: --redis-password The redis password. [string] --redis-db The redis database. [number] --redis-optional Set to true if no permanent auto-reconnect shall be done if server is down. [boolean] [default: false] + --redis-family Version of IP stack. 0, 4, or 6. Defaults to 0 to support both ipv4 and ipv6. [number] --sentinel-port The port to find sentinel on. [number] --sentinel-host The host to find sentinel on. [string] --sentinels Comma separated list of sentinels with host:port. [string] @@ -203,6 +204,7 @@ REDIS_TLS_SERVER_NAME REDIS_DB REDIS_HOSTS REDIS_OPTIONAL +REDIS_FAMILY SENTINEL_PORT SENTINEL_HOST SENTINEL_NAME diff --git a/bin/redis-commander.js b/bin/redis-commander.js index 291afea9..134415ff 100755 --- a/bin/redis-commander.js +++ b/bin/redis-commander.js @@ -50,6 +50,11 @@ const args = yargs describe: 'Set to true if no permanent auto-reconnect shall be done if server is down.', default: false }) + .options('redis-family', { + type: 'number', + describe: 'Version of IP stack. Defaults to 0 to support both.', + default: 0 + }) .options('sentinel-port', { type: 'number', describe: 'The port to find sentinel on.' @@ -461,7 +466,7 @@ function createConnectionObjectFromArgs(argList) { // now create connection object if enough params are set let connObj = null; if (argList['clusters'] || argList['sentinel-host'] || argList['sentinels'] || argList['redis-host'] || argList['redis-port'] || argList['redis-socket'] - || argList['redis-username'] || argList['redis-password'] || argList['redis-db']) { + || argList['redis-username'] || argList['redis-password'] || argList['redis-db'] || argList['redis-family']) { let db = parseInt(argList['redis-db']); connObj = { @@ -471,6 +476,7 @@ function createConnectionObjectFromArgs(argList) { password: argList['redis-password'] || '', connectionName: config.get('redis.connectionName'), optional: argList['redis-optional'], + family: argList['redis-family'] || 0, clusterNoTlsValidation: argList['clusterNoTlsValidation'] }; diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index e13ec60a..1350650d 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -270,6 +270,10 @@ if [ -n "$REDIS_OPTIONAL" ] && parse_boolean "$REDIS_OPTIONAL"; then set -- "$@" "--redis-optional" fi +if [ -n "$REDIS_FAMILY" ]; then + set -- "$@" "--redis-family" "$REDIS_FAMILY" +fi + if [ -n "$SENTINEL_PORT" ]; then set -- "$@" "--sentinel-port" "$SENTINEL_PORT" fi