Giter Club home page Giter Club logo

redis-clinterwebz's Introduction

redis-clinterwebz: a redis-cli in your browser

screenshot

This project is a browser-based redis-cli-like interface. It is mainly intended to serve as the interactive backbone for the https://redis.io website. The project boasts:

  • An arcane out-of-the-box TTY experience
  • Multiple named Redis databases (e.g. latest, unstable...)
  • Key namespacing per DB
  • Opt-in per page context (allowing it to be used in the same website across multiple pages)
  • Embeddable JavaScript code
  • ... and much more!

Getting started

You can use docker-compose:

  1. Clone this repository
  2. Change directory to the repository
  3. Do docker-compose up to spin up the app, a webserver and an unstable Redis

The app should be accessible in your browser at http://localhost

Running the application for development

  1. Clone this repository
  2. Change directory to the repository
  3. (Recommended) Use virtualenv: virtualenv -p 3.9 venv; source venv/bin/activate
  4. Install the app: pip install -e .
  5. Copy-paste this to your terminal:
    export FLASK_APP=interwebz
    export FLASK_ENV=development
    export INTERWEBZ_JSON_SETTINGS=`pwd`/sample_settings.json
  6. To run: flask run

The app should be accessible in your browser at http://localhost:5000

Redis Server

To function correctly, the application requires one or more Redis servers.

The minimal Redis version required is 7.0.0 (until it is released, please install directly from the source at the unstable branch of the Redis repository).

An example for a hardend ACL profile is included in the redis directory. To use it:

cd redis
redis-server redis.conf

Deploying on k8s

WIP

# kubectl port-forward --namespace=ingress-nginx service/ingress-nginx-controller 8080:80
# https://kubernetes.github.io/ingress-nginx/deploy/#quick-start
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/deploy/static/provider/cloud/deploy.yaml
make up

Configuration

To override the defaults (see default_settings.py), you can provide your own settings file via the INTERWEBZ_SETTINGS environment variable, like so:

EXPORT INTERWEBS_SETTINGS=/path/to/your/settings.py
flask run

Alternatively, you can also use a JSON file for the same purpose (see sample_settings.json) via the INTERWEBZ_JSON_SETTINGS environment variable.

HTML redis-cli element

To embed in an HTML page:

  1. Import the cli.js script.
  2. Add a form element(s) with the redis-cli class.

Attributes

The redis-cli element supports these attributes:

  • dbid: the database ID to use, defaults to the first defined database.
  • asciiart: controls ASCII art display

TODO

  • Embedded comments inline :)
  • Testing
  • Deployment
  • Request/IP throttling
  • ...

redis-clinterwebz's People

Contributors

itamarhaber avatar slorello89 avatar leibale avatar meirshpilraien avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.