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!
You can use docker-compose
:
- Clone this repository
- Change directory to the repository
- 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
- Clone this repository
- Change directory to the repository
- (Recommended) Use virtualenv:
virtualenv -p 3.9 venv; source venv/bin/activate
- Install the app:
pip install -e .
- Copy-paste this to your terminal:
export FLASK_APP=interwebz export FLASK_ENV=development export INTERWEBZ_JSON_SETTINGS=`pwd`/sample_settings.json
- To run:
flask run
The app should be accessible in your browser at http://localhost:5000
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
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
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.
To embed in an HTML page:
- Import the cli.js script.
- Add a
form
element(s) with theredis-cli
class.
The redis-cli element supports these attributes:
- dbid: the database ID to use, defaults to the first defined database.
- asciiart: controls ASCII art display
- Embedded comments inline :)
- Testing
- Deployment
- Request/IP throttling
- ...