Redis Commander

repository·master·Indexed 26 days ago

https://github.com/joeferner/redis-commander

A web-based management tool for Redis written in Node.js. It allows users to visually explore and manage data across standalone Redis servers, Sentinel-based setups, and Redis Clusters. Supports data types including Strings, Lists, Sets, Sorted Sets, Streams, and ReJSON documents. Available for installation via npm, Docker, or Helm charts for Kubernetes.

Tokens
18.4K
Snippets
21
Records
87
Agent score
87%

What's inside redis-commander

  1. Supported Redis data types

    master

    Redis Commander provides a Web-UI to view, add, update, and delete the following data types:

    • Strings
    • Lists
    • Sets
    • Sorted Set
    • Streams (Basic support: view, add, and delete only)
    • ReJSON documents (Basic support: viewing values of ReJSON type keys only)
  2. Configure Read-Only Mode and Allowed Commands

    master

    When redis.readOnly is set to true, only non-modifying commands are permitted. Redis Commander attempts to determine these by querying the server's COMMANDS output.

    If specific commands are not flagged as readonly by your server but you want them restricted, or if you need to allow specific commands while in read-only mode, use redis.extraAllowedReadOnlyCommands.

    Note: If you define extraAllowedReadOnlyCommands in a local config file (like local.json), it overwrites the defaults in default.json rather than appending to them. You must provide the full list of allowed commands.

  3. Configure TLS client certificate authentication

    master

    When both the Redis server and Sentinel require client certificate authentication, provide the public certificate and the private key in separate files using the following parameters:

    • --redis-tls-cert-file / --redis-tls-key-file
    • --sentinel-tls-cert-file / --sentinel-tls-key-file
  4. Configure Redis Commander using node-config

    master
    Redis Commander uses the node-config module for its configuration. You can set parameters by placing configuration files inside the config folder. The specific file formats, naming conventions, and evaluation order are determined by the node-config library standards.
  5. Configure basic TLS support

    master

    To enable TLS for Redis server and Sentinel connections, you must enable them independently.

    Local CLI: Use --redis-tls and --sentinel-tls flags. Docker: Use environment variables REDIS_TLS=1 and SENTINEL_TLS=1.

    # local start of application from command line
    $ redis-commander --redis-tls --sentinel-tls ...
    
    # running inside docker container
    $ docker run -e REDIS_TLS=1 -e SENTINEL_TLS=1 ... ghcr.io/joeferner/redis-commander
  6. Set SNI name for TLS secured connections

    master

    To use a specific fully qualified domain name for Server Name Indication (SNI) to ensure correct server certificate validation, use the following flags:

    • --redis-tls-server-name
    • --sentinel-tls-server-name
    # local start of application from command line
    $ redis-commander --redis-tls --redis-tls-server-name=redis.example.org --sentinel-tls --sentinel-tls-server-name=sentinel.example.org ...
  7. Configure Redis Commander precedence

    master

    Redis Commander supports configuration via files, environment variables, and command line parameters. The order of precedence (from least to most important) is:

    1. Configuration files: Uses node-config.
      • default.json: Default values (do not change).
      • local.json: Local overrides and connection lists.
      • local-<NODE_ENV>.json: Used for connections parsed from REDIS_HOSTS env var. This overwrites local.json.
    2. Environment variables: Overwrites configuration files.
    3. Command line parameters: Overwrites everything.

    To validate your final configuration and see all active keys (including invalid ones), start the application with the --test flag.

  8. Install redis-commander via Helm repository

    master

    You can install the chart using the hosted Helm repository. This involves adding the repository to your Helm client, creating a myvalues.yaml file for your custom configuration, and then running the helm install command referencing the repository.

    # add repo
    helm repo add redis-commander https://joeferner.github.io/redis-commander/
    
    # custom values
    cat > myvalues.yaml <<EOF
    redis.host: redis-master
    # env:
    # - name: FOLDING_CHAR
    #   value: "/"
    ingress:
      enabled: true
      annotations:
        kubernetes.io/ingress.class: nginx
      hosts:
        - host: redis-ui.example.com
          paths: ["/"]
    EOF
    
    # install helm chart with the custom values
    helm install \
      redis-web-ui \
      redis-commander/redis-commander \
      -f myvalues.yaml
  9. Extend environment variables for custom configuration

    master
    Redis Commander allows mapping environment variables to configuration data. The default mappings are defined in custom-environment-variables.json. If you need to define additional environment variables for custom configuration data, such as specific connection configurations, you can extend this file.
  10. Install redis-commander via Helm from local git repository

    master

    To install the Helm chart from a local git checkout, navigate to the repository root and run the helm install command. You must specify the Redis server host value using the --set flag. In this example, the host is set to redis and the release is named redis-web-ui in the myspace namespace.

    cd <git-repo>
    helm -n myspace install redis-web-ui ./k8s/helm-chart/redis-commander --set redis.host=redis