### Client Authentication with Different Certificates for Redis and Sentinel Source: https://github.com/joeferner/redis-commander/blob/master/docs/connections.md Configure distinct client certificates and keys for Redis server and Sentinel connections. This example demonstrates the command-line setup. ```shell # local start of application from command line $ redis-commander --redis-tls --redis-tls-cert-file=clientCert.pem --redis-tls-key-file=clientKey.pem --sentinel-tls --sentinel-tls-cert-file=sentinelCert.pem --sentinel-tls-key-file=sentinelKey.pem ... ``` -------------------------------- ### Install and Run Redis Commander Source: https://github.com/joeferner/redis-commander/blob/master/README.md Install Redis Commander globally using npm and run it from the command line. Yarn installation is not supported. ```bash npm install -g redis-commander redis-commander ``` -------------------------------- ### Redis COMMANDS Output Example Source: https://github.com/joeferner/redis-commander/blob/master/docs/configuration.md This example shows a shortened output from the Redis 'COMMANDS' command, illustrating how commands like 'dbsize' are flagged as readonly while 'select' is not. ```text 61) 1) "select" 2) (integer) 2 3) 1) loading 2) fast 4) (integer) 0 5) (integer) 0 6) (integer) 0 ... 86) 1) "dbsize" 2) (integer) 1 3) 1) readonly 2) fast 4) (integer) 0 5) (integer) 0 6) (integer) 0 ... ``` -------------------------------- ### Install Redis Commander Helm Chart Source: https://github.com/joeferner/redis-commander/blob/master/k8s/helm-chart/redis-commander/README.md Install the redis-commander Helm chart by navigating to the chart directory and using the `helm install` command. Ensure to set the `redis.host` value to your Redis server's address. ```sh cd helm -n myspace install redis-web-ui ./k8s/helm-chart/redis-commander --set redis.host=redis ``` -------------------------------- ### List Keys by Prefix Source: https://context7.com/joeferner/redis-commander/llms.txt Lists all keys in a connection that start with a given prefix. The prefix is appended to the URL. ```bash curl http://localhost:8081/api/v2/keys/conn-0/user: ``` -------------------------------- ### Helm Chart Installation and Upgrade Source: https://context7.com/joeferner/redis-commander/llms.txt Commands for installing and upgrading a Redis Commander Helm chart in a Kubernetes cluster. Demonstrates setting custom values and image tags. ```bash # Install into namespace 'monitoring' with custom values helm -n monitoring install redis-web-ui ./k8s/helm-chart/redis-commander \ --set env.REDIS_HOSTS="prod:redis.default.svc.cluster.local:6379" # Upgrade with new image tag helm -n monitoring upgrade redis-web-ui ./k8s/helm-chart/redis-commander \ --set image.tag=0.9.1 ``` -------------------------------- ### Install and Run Redis Commander via npm Source: https://context7.com/joeferner/redis-commander/llms.txt Install Redis Commander globally using npm and run it with various connection and configuration options. Supports connecting to specific hosts with passwords, read-only mode, and HTTP authentication. ```bash npm install -g redis-commander ``` ```bash redis-commander ``` ```bash redis-commander --redis-host 10.10.20.30 --redis-port 6379 --redis-password secret ``` ```bash redis-commander \ --read-only \ --http-auth-username admin \ --http-auth-password mypassword \ --port 9000 ``` ```bash redis-commander --test ``` -------------------------------- ### Helm Chart Installation Command Source: https://github.com/joeferner/redis-commander/blob/master/README.md Command to install the Redis Commander Helm chart locally. Requires a local checkout of the Helm chart sources. ```bash helm -n myspace install redis-web-ui ./k8s/helm-chart/redis-commander ``` -------------------------------- ### Start Redis Commander Service Source: https://github.com/joeferner/redis-commander/blob/master/dist/systemd/readme.md Command to start the Redis Commander service after it has been registered with SystemD. ```bash systemctl start redis-commander ``` -------------------------------- ### Install Redis Commander Helm Chart with Custom Values Source: https://github.com/joeferner/redis-commander/blob/master/k8s/helm-chart/redis-commander/README.md Install the Redis Commander Helm chart using a custom values file. This allows for specific configurations such as setting the Redis host, enabling ingress, and defining ingress hosts. ```sh # custom values cat > myvalues.yaml <", "dbIndex": 0 } ] } ``` -------------------------------- ### Get Key Value via REST API v2 Source: https://context7.com/joeferner/redis-commander/llms.txt Retrieve the value of a Redis key. Supports different key types like string, list (paginated), hash, and sorted set (paginated). ```bash # String key curl http://localhost:8081/api/v2/key/conn-0/mykey # List key (paginated with ?index=0) curl "http://localhost:8081/api/v2/key/conn-0/mylist?index=0" # Hash key curl http://localhost:8081/api/v2/key/conn-0/myhash # Sorted set (ZSet) key, paginated curl "http://localhost:8081/api/v2/key/conn-0/myzset?index=0" ``` -------------------------------- ### Configure HTTP Basic Authentication for Redis Commander Source: https://github.com/joeferner/redis-commander/blob/master/docs/security_checks.md Protect the web interface using HTTP Basic Authentication. Configure username and password via command line, environment variables, or a config file. Passwords can also be read from files using specific environment variables. ```bash --http-user --http-pass ``` ```bash HTTP_USER HTTP_PASSWORD HTTP_PASSWORD_HASH ``` ```bash server.httpAuth.username server.httpAuth.password server.httpAuth.passwordHash ``` ```bash HTTP_PASSWORD_FILE HTTP_PASSWORD_HASH_FILE ``` -------------------------------- ### Create or Update a String Key Source: https://context7.com/joeferner/redis-commander/llms.txt Use this endpoint to create or update a string key. Ensure the key type is specified as 'string'. ```bash curl -X POST http://localhost:8081/api/v2/key/conn-0/mykey \ -d "stringValue=hello+world" \ -d "keyType=string" ``` -------------------------------- ### Configure UI Folding Character Globally and Per Connection Source: https://github.com/joeferner/redis-commander/blob/master/docs/configuration.md Demonstrates how to set the UI folding character globally and override it for specific connections. This affects how keys are displayed hierarchically in the UI. ```json { "ui": { "foldingChar": ":" }, "connections": [{ "host": "10.2.3.4" }, { "host": "10.9.8.7", "foldingChar": "/" } ] } ``` -------------------------------- ### Enable SSO Login via JWT for Redis Commander Source: https://github.com/joeferner/redis-commander/blob/master/docs/security_checks.md Integrate with external web applications for authentication using JSON Web Tokens (JWT). The JWT is passed as an 'access_token' parameter via GET or POST requests to the '/sso' endpoint. Configure JWT validation parameters in the config file or via environment variables. ```http GET https://:/sso?access_token=dfgfdg.token... ``` ```bash SSO_ENABLED SSO_JWT_SECRET SSO_ISSUER SSO_AUDIENCE SSO_SUBJECT ``` -------------------------------- ### Configure Sentinel TLS with Client Certificate and Key Source: https://github.com/joeferner/redis-commander/blob/master/README.md Use client certificates and keys for TLS connections to Sentinel. This provides mutual authentication between the client and the Sentinel. ```bash redis-commander --sentinel-host 127.0.0.1 --sentinel-port 26379 --sentinel-name mymaster --sentinel-tls --redis-tls-cert "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----" --redis-tls-key "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----" ``` -------------------------------- ### Access Redis Commander via Ingress Source: https://github.com/joeferner/redis-commander/blob/master/k8s/helm-chart/redis-commander/templates/NOTES.txt If Ingress is enabled, this snippet shows how to construct the application URL using the configured hosts and paths. ```go-template {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} {{- range .paths }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} {{- end }} {{- end }} {{- end }} ``` -------------------------------- ### Basic TLS Configuration for Redis and Sentinel Source: https://context7.com/joeferner/redis-commander/llms.txt Enable TLS for Redis and Sentinel connections using command-line flags. No custom certificate validation is performed by default. ```bash # Basic TLS (no certificate validation customization) redis-commander --redis-tls --sentinel-tls \ --redis-host secure-redis.example.com --redis-port 6380 # TLS with custom CA certificate file redis-commander --redis-tls \ --redis-tls-ca-cert-file=/etc/ssl/certs/redis-ca.pem \ --sentinel-tls # TLS with mutual (client) certificate authentication redis-commander --redis-tls \ --redis-tls-cert-file=client.pem \ --redis-tls-key-file=client.key \ --sentinel-tls \ --sentinel-tls-cert-file=sentinel-client.pem \ --sentinel-tls-key-file=sentinel-client.key # TLS with SNI redis-commander --redis-tls \ --redis-tls-server-name=redis.example.org \ --sentinel-tls \ --sentinel-tls-server-name=sentinel.example.org ``` -------------------------------- ### List keys by prefix Source: https://context7.com/joeferner/redis-commander/llms.txt Retrieves a list of keys from Redis that match a given prefix. ```APIDOC ### GET /api/v2/keys/:connectionId/:keyPrefix — List keys by prefix ### Description Retrieves a list of keys from Redis that match a given prefix. ### Method GET ### Endpoint /api/v2/keys/:connectionId/:keyPrefix ### Response #### Success Response (200) - **data** (array) - An array of strings, where each string is a key matching the prefix. ### Response Example ```json { "data": ["user:1", "user:2", "user:100"] } ``` ### Request Example ```bash curl http://localhost:8081/api/v2/keys/conn-0/user: ``` ``` -------------------------------- ### Connect to Redis Cluster with multiple members Source: https://github.com/joeferner/redis-commander/blob/master/docs/connections.md Connect to a Redis cluster by providing a comma-separated list of cluster members. The `--is-cluster` flag is not required. ```shell $ redis-commander --clusters 192.0.2.2:6379:6379,192.0.2.3:6379 --tls ``` ```json { "connections": [ { "label": "cluster-1", "clusters": "192.0.2.2:6379,192.0.2.3:6379", "password": "", "dbIndex": 0 }, { "label": "cluster-2", "clusters": "[192.0.2.2:6379, 192.0.2.3:6379]", "password": "", "dbIndex": 0 }, { "label": "cluster-3", "sentinels": [ "192.0.2.2:6379", "192.0.2.3:6379" ], "password": "", "dbIndex": 0 }, { "label": "cluster-4", "sentinels": [ { "host": "192.0.2.2", "port": 6379 }, { "host": "192.0.2.3", "port": 6379 }, { "host": "fd00:2::3", "port": 6379 } ], "password": "", "dbIndex": 0 } ``` -------------------------------- ### List Available Redis Commands Source: https://context7.com/joeferner/redis-commander/llms.txt Fetch a list of all available Redis commands supported by the API. In read-only mode, only read commands are returned. ```bash curl http://localhost:8081/api/v2/redisCommands # { "data": ["GET", "SET", "HGET", "HSET", "LPUSH", "RPUSH", ...] } ``` -------------------------------- ### Standalone Redis Connection Configuration Source: https://context7.com/joeferner/redis-commander/llms.txt Configure a basic standalone Redis connection with host, port, username, password, and database index. ```json { "connections": [ { "label": "my-redis", "host": "192.0.2.1", "port": 6379, "username": "appuser", "password": "secret", "dbIndex": 0 } ] } ``` -------------------------------- ### Connect to a Specific Redis Database Source: https://github.com/joeferner/redis-commander/blob/master/README.md Select a specific Redis database by its index. Defaults to database 0 if not specified. ```bash redis-commander --redis-host 127.0.0.1 --redis-port 6379 --redis-db 5 ``` -------------------------------- ### List Keys as Tree Structure Source: https://context7.com/joeferner/redis-commander/llms.txt Retrieve keys organized in a tree structure for a given connection. This is useful for navigating large key spaces. ```bash curl http://localhost:8081/api/v2/keystree/conn-0 # { # "data": [ # { "id": "conn-0:user:", "text": "user:* (3)", "children": true, "count": 3 }, # { "id": "conn-0:config", "text": "config", "rel": "string", "count": 0 }, # { "id": "conn-0:sessions:", "text": "sessions:* (12)", "children": true, "count": 12 } # ] # } ``` ```bash # Drill into a subtree curl http://localhost:8081/api/v2/keystree/conn-0/user: # { "data": [ # { "id": "conn-0:user:1", "text": "1", "rel": "hash", "count": 0 }, # { "id": "conn-0:user:2", "text": "2", "rel": "hash", "count": 0 } # ] # } ``` -------------------------------- ### Connect to Redis Cluster with `--is-cluster` flag Source: https://github.com/joeferner/redis-commander/blob/master/docs/connections.md Use this method to connect to a Redis cluster by specifying one cluster member and the `--is-cluster` flag. Fallback to other members occurs after initial connection. ```shell $ redis-commander --host localhost --port 6579 --tls --is-cluster ``` ```json { "connections": [ { "label": "simple-redis-cluster", "host": "localhost", "port": 6379, "password": "", "dbIndex": 0, "isCluster": true }, ``` -------------------------------- ### Build Production Docker Image for Redis Commander Source: https://github.com/joeferner/redis-commander/blob/master/docs/security_checks.md For production, build your own Docker image and remove package managers to reduce image size and attack surface. Set the 'REMOVE_APK=1' build argument during the Docker build process. ```docker REMOVE_APK=1 ``` -------------------------------- ### Deploy Redis Commander with PM2 Source: https://github.com/joeferner/redis-commander/blob/master/dist/pm2/readme.md Use this command to register and deploy your Redis Commander application with PM2 using a custom configuration file. ```bash pm2 deploy /path/to/custom/pm2-config.json ``` -------------------------------- ### TLS with CA Certificate from Environment Variable Source: https://github.com/joeferner/redis-commander/blob/master/docs/connections.md Use an environment variable to provide the CA certificate content for TLS connections. This avoids storing the certificate in a file. ```shell # local start of application from command line $ redis-commander --redis-tls --redis-tls-ca-cert="${CA_CERT}" --sentinel-tls ... ``` -------------------------------- ### List available commands (v2 only) Source: https://context7.com/joeferner/redis-commander/llms.txt Retrieves a list of available Redis commands supported by the API. In read-only mode, only read commands are returned. ```APIDOC ## GET /api/v2/redisCommands — List available commands (v2 only) ### Description Lists all available Redis commands that can be executed via the API. If the instance is in read-only mode, only read commands will be returned. ### Method GET ### Endpoint `/api/v2/redisCommands` ### Response #### Success Response (200) - **data** (array) - An array of strings, where each string is a Redis command (e.g., "GET", "SET"). ### Request Example ```bash curl http://localhost:8081/api/v2/redisCommands ``` ### Response Example ```json { "data": ["GET", "SET", "HGET", "HSET", "LPUSH", "RPUSH", ...] } ``` ``` -------------------------------- ### Connect via Unix-Socket Source: https://github.com/joeferner/redis-commander/blob/master/docs/connections.md Use this configuration when connecting to a Redis server via a Unix socket. Only the 'path' parameter is required; 'host', 'port', and 'sentinel*' parameters should not be set. ```json { "connections": [ { "label": "redis-unix-socket", "path": "/var/run/redis.socket", "password": "", "dbIndex": 0 } ] } ``` -------------------------------- ### Docker Run Command with Single Host Source: https://github.com/joeferner/redis-commander/blob/master/README.md Run Redis Commander, specifying a single Redis host using the REDIS_HOSTS environment variable. ```bash docker run --rm --name redis-commander -d -p 8081:8081 \ --env REDIS_HOSTS=10.10.20.30 \ ghcr.io/joeferner/redis-commander:latest ``` -------------------------------- ### Connect using Unix Socket Source: https://github.com/joeferner/redis-commander/blob/master/README.md Utilize a Unix domain socket for connecting to Redis, typically used when Redis is running on the same machine. ```bash redis-commander --redis-socket /var/run/redis/redis-server.sock ``` -------------------------------- ### Run Redis Commander as a Docker Container Source: https://context7.com/joeferner/redis-commander/llms.txt Deploy Redis Commander using a Docker image. Configure connections via the `REDIS_HOSTS` environment variable, which accepts a comma-separated list of `label:host:port:dbIndex:password` entries. Supports HTTP authentication with bcrypt hashes. ```bash docker run --rm -d --name redis-commander \ -p 8081:8081 \ ghcr.io/joeferner/redis-commander:latest ``` ```bash docker run --rm -d --name redis-commander \ -p 8081:8081 \ --env REDIS_HOSTS=prod:10.10.20.30:6379 \ ghcr.io/joeferner/redis-commander:latest ``` ```bash docker run --rm -d --name redis-commander \ -p 8081:8081 \ --env REDIS_HOSTS=local:localhost:6379,staging:10.10.20.30:6379:0:stagingpass \ ghcr.io/joeferner/redis-commander:latest ``` ```bash docker run --rm -d --name redis-commander \ -p 8081:8081 \ --env HTTP_USER=admin \ --env HTTP_PASSWORD_HASH='$2b$10$...' \ --env REDIS_HOSTS=local:redis:6379 \ ghcr.io/joeferner/redis-commander:latest ``` -------------------------------- ### Configure Redis Sentinel Connection Source: https://github.com/joeferner/redis-commander/blob/master/README.md Connect to Redis through Sentinel for high availability. Specify Sentinel host, port, and the master group name. ```bash redis-commander --sentinel-host 127.0.0.1 --sentinel-port 26379 --sentinel-name mymaster ``` -------------------------------- ### TLS Configuration via Docker Environment Variables Source: https://context7.com/joeferner/redis-commander/llms.txt Configure TLS for Redis Commander when running in Docker using environment variables. Mounts a CA certificate file for validation. ```bash docker run -d -p 8081:8081 \ -v "./ca.pem:/tmp/ca.pem" \ -e REDIS_TLS=1 \ -e REDIS_TLS_CA_CERT_FILE=/tmp/ca.pem \ -e REDIS_HOST=secure-redis.example.com \ -e REDIS_PORT=6380 \ ghcr.io/joeferner/redis-commander:latest ``` -------------------------------- ### Redis Sentinel Connection Configuration Source: https://context7.com/joeferner/redis-commander/llms.txt Configure a Redis connection using Sentinel for high availability, including sentinel hosts, sentinel name, and Redis credentials. ```json { "connections": [ { "label": "sentinel-ha", "sentinels": [ { "host": "192.0.2.2", "port": 26379 }, { "host": "192.0.2.3", "port": 26379 } ], "sentinelName": "mymaster", "sentinelPassword": "sentinel-pass", "password": "redis-pass", "dbIndex": 0 } ] } ``` -------------------------------- ### Configure TLS with CA Certificate File Source: https://github.com/joeferner/redis-commander/blob/master/README.md Specify the file path to a PEM-style CA certificate for TLS connection validation. This overrides the inline certificate option. ```bash redis-commander --redis-host 127.0.0.1 --redis-port 6379 --redis-tls --redis-tls-ca-cert-file /path/to/ca.crt ``` -------------------------------- ### TLS Certificate Based Client Authentication Source: https://github.com/joeferner/redis-commander/blob/master/docs/connections.md Enable client authentication using certificates for both Redis server and Sentinel. Requires separate files for the public certificate and private key. ```shell # local start of application from command line $ redis-commander --redis-tls --redis-tls-cert-file=clientCert.pem --redis-tls-key-file=clientKey.pem --sentinel-tls ... ``` -------------------------------- ### Generate BCrypt Password Hash Source: https://context7.com/joeferner/redis-commander/llms.txt Generate a BCrypt hashed password for use in configuration files or CLI arguments. Requires cloning the repository and running a Node.js script. ```bash # Clone repo and generate a bcrypt hash for a plain-text password git clone https://github.com/joeferner/redis-commander.git cd redis-commander node bin/bcrypt-password.js -p myplainpassword # Output: $2b$10$BQPbC8dlxeEqB/nXOkyjr.tlafGZ28J3ug8sWIMRoeq5LSVOXpl3W # Use the hash in config/local.json # "server": { "httpAuth": { "username": "admin", "passwordHash": "$2b$10$ിയി..." } } # Or as CLI argument redis-commander --http-auth-username admin \ --http-auth-password-hash '$2b$10$BQPbC8dlxeEqB/nXOkyjr.tlafGZ28J3ug8sWIMRoeq5LSVOXpl3W' # Or as Docker environment variable docker run -e HTTP_USER=admin \ -e HTTP_PASSWORD_HASH='$2b$10$BQPbC8dlxeEqB/nXOkyjr.tlafGZ28J3ug8sWIMRoeq5LSVOXpl3W' \ -p 8081:8081 ghcr.io/joeferner/redis-commander:latest ``` -------------------------------- ### Enable TLS for Redis Connection Source: https://github.com/joeferner/redis-commander/blob/master/README.md Use TLS/SSL to secure the connection to your Redis server. Ensure your Redis server is configured for TLS. ```bash redis-commander --redis-host 127.0.0.1 --redis-port 6379 --redis-tls ``` -------------------------------- ### Docker Compose for Redis Commander with Custom Config Source: https://github.com/joeferner/redis-commander/blob/master/docs/connections.md Set up a Docker Compose file to run Redis Commander, mounting a custom JSON configuration file for connections. This allows for flexible connection management, including TLS-enabled Redis instances. ```yaml version: "3" services: redis-commander: container_name: redis-commander hostname: redis-commander image: ghcr.io/joeferner/redis-commander:latest restart: always volumes: - ./myconnections.json:/redis-commander/config/local-production.json ports: - "8081:8081" ``` -------------------------------- ### Simplest Docker Run Command Source: https://github.com/joeferner/redis-commander/blob/master/README.md Basic command to run Redis Commander as a detached container. Assumes Redis is running on localhost:6379. ```bash docker run --rm --name redis-commander -d -p 8081:8081 \ ghcr.io/joeferner/redis-commander:latest ``` -------------------------------- ### Unix Socket Connection Configuration Source: https://context7.com/joeferner/redis-commander/llms.txt Configure a Redis connection using a Unix socket, specifying the path, optional password, and database index. ```json { "connections": [ { "label": "redis-socket", "path": "/var/run/redis/redis.sock", "password": "optional", "dbIndex": 0 } ] } ``` -------------------------------- ### Enable ioredis Debugging for Cluster Errors Source: https://github.com/joeferner/redis-commander/blob/master/docs/connections.md To diagnose generic `ClusterAllFailedError` issues, enable NodeJS debug logging for ioredis. This provides more detailed output from the ioredis library. ```shell $ export NODE_DEBUG="ioredis:" $ redis-commander --redis-host redis --redis-port 6379 --redis-tls ``` -------------------------------- ### Keys as tree Source: https://context7.com/joeferner/redis-commander/llms.txt Retrieves keys from a Redis connection, organized in a tree-like structure. This endpoint can be used to explore keyspaces and drill down into specific branches. ```APIDOC ## GET /api/v2/keystree/:connectionId/:keyPrefix — Keys as tree ### Description Retrieves keys from a Redis connection, organized in a tree structure. This is useful for browsing keyspaces. ### Method GET ### Endpoint `/api/v2/keystree/:connectionId/:keyPrefix` ### Parameters #### Path Parameters - **connectionId** (string) - Required - The ID of the connection. - **keyPrefix** (string) - Optional - The prefix to filter keys. If omitted, all top-level keys are returned. ### Response #### Success Response (200) - **data** (array) - An array of key objects, each potentially containing `id`, `text`, `children` (boolean), `count` (number), and `rel` (string). ### Request Example ```bash curl http://localhost:8081/api/v2/keystree/conn-0 ``` ### Response Example ```json { "data": [ { "id": "conn-0:user:", "text": "user:* (3)", "children": true, "count": 3 }, { "id": "conn-0:config", "text": "config", "rel": "string", "count": 0 }, { "id": "conn-0:sessions:", "text": "sessions:* (12)", "children": true, "count": 12 } ] } ``` ``` -------------------------------- ### Configure Redis Cluster Connection Source: https://github.com/joeferner/redis-commander/blob/master/README.md Connect to a Redis Cluster by providing a comma-separated list of cluster members. The `--is-cluster` flag indicates that the provided hosts/ports are part of a cluster. ```bash redis-commander --redis-host 127.0.0.1 --redis-port 7000 --clusters 127.0.0.1:7000,127.0.0.1:7001 --is-cluster ``` -------------------------------- ### TLS with Custom CA Server Certificates Source: https://github.com/joeferner/redis-commander/blob/master/docs/connections.md Configure TLS connections using a custom CA certificate file for the Redis server and Sentinel. The certificate is stored in 'cacert.pem'. For Docker, the certificate is mounted to '/tmp/cacert.pem'. ```shell # local start of application from command line $ redis-commander --redis-tls --redis-tls-ca-cert-file=cacert.pem --sentinel-tls ... ``` ```shell # running inside docker container $ docker run -v "./cacert.pem:/tmp/cacert.pem" -e REDIS_TLS=1 -e REDIS_TLS_CA_CERT_FILE=/tmp/cacert.pem -e SENTINEL_TLS=1 ... ghcr.io/joeferner/redis-commander ``` -------------------------------- ### Create or update a key Source: https://context7.com/joeferner/redis-commander/llms.txt Allows for the creation or update of various Redis key types, including strings and lists. It also supports deleting and renaming keys. ```APIDOC ## POST /api/v2/key/:connectionId/:key — Create or update a key ### Description Allows for the creation or update of various Redis key types, including strings and lists. It also supports deleting and renaming keys. ### Method POST, PATCH ### Endpoint /api/v2/key/:connectionId/:key ### Parameters #### Query Parameters - **action** (string) - Optional - Specifies an action to perform, e.g., 'delete'. #### Request Body - **stringValue** (string) - Required for creating/updating string or list keys. - **keyType** (string) - Required for creating new keys, specifies the type (e.g., 'string', 'list'). - **key** (string) - Required for renaming operations. - **force** (boolean) - Optional for renaming, overwrites the target key if true. ### Request Example ```bash # Create/update a string key curl -X POST http://localhost:8081/api/v2/key/conn-0/mykey \ -d "stringValue=hello+world" \ -d "keyType=string" # Create a new list key (lpush) curl -X POST http://localhost:8081/api/v2/key/conn-0/newlist \ -d "stringValue=firstitem" \ -d "keyType=list" # Delete a key curl -X POST "http://localhost:8081/api/v2/key/conn-0/mykey?action=delete" # Rename a key (force overwrite if target exists) curl -X PATCH http://localhost:8081/api/v2/key/conn-0/oldname \ -H "Content-Type: application/json" \ -d '{"key": "newname", "force": true}' ``` ``` -------------------------------- ### Redis Cluster Connection Configuration Source: https://context7.com/joeferner/redis-commander/llms.txt Configure a Redis cluster connection by providing a comma-separated list of cluster node addresses, along with credentials. ```json { "connections": [ { "label": "my-cluster", "clusters": "192.0.2.2:6379,192.0.2.3:6379,192.0.2.4:6379", "password": "cluster-pass", "dbIndex": 0 } ] } ``` -------------------------------- ### Retrieve Server Info via REST API v2 Source: https://context7.com/joeferner/redis-commander/llms.txt Fetch information about all connected Redis servers or a specific connection using the `/api/v2/server/info` endpoint. Requires authentication for some endpoints. ```bash # All connected servers curl http://admin:password@localhost:8081/api/v2/server/info # Specific connection curl http://admin:password@localhost:8081/api/v2/server/conn-0/info ``` -------------------------------- ### Generate BCrypted password hash Source: https://github.com/joeferner/redis-commander/blob/master/README.md This script generates a bcrypt password hash for HTTP authentication. Provide the plain text password using the -p flag. The generated hash can be used in configuration files, environment variables, or command-line arguments. ```shell $ git clone https://github.com/joeferner/redis-commander.git $ cd redis-commander/bin $ node bcrypt-password.js -p myplainpass $2b$10BQPbC8dlxeEqB/nXOkyjr.tlafGZ28J3ug8sWIMRoeq5LSVOXpl3W ```