Red Interface
Red is a user interface to make working with Redis faster, more understandable, and simple.
Console
The console resides at the bottom of the view and exposes how Red is communicating with the backend. There is an input field below the console that accepts redis commands. If Red detects that the command modifies the currently selected key, the key will be reloaded to reflect the change. The console can be cleared by clicking the trash can in the bottom right corner.
TLS/SSL Certificates
Red supports connecting to redis instances using SSL/TLS certificates using password-protected .p12
certificates. (Many .p12 generators/readers have issues distinguishing blank passwords from empty strings - so we require passwords to avoid this confusion.)
Converting .crt/.key files to .p12
If you have .crt
and .key
files to connect to redis, they can easily be converted to .p12
using openssl
In terminal
determine if you have openssl by typing:
openssl help
If you get Command not found
, install Homebrew if needed (https://brew.sh), and then type:
brew install openssl
If openssl is installed, use the following to generate a .p12
certificate, replacing redis.crt
, ca.crt
, and redis.key
with the appropriate files. Be sure to set a password - empty passwords will not work in Red.
openssl pkcs12 -export -in redis.crt -certfile ca.crt -inkey redis.key -out certificate_for_red.p12
Note: The certificate and password are stored in the application preferences, so you can delete the original .p12
file after saving the connection.
Lua Scripts
Lua Scripts can be organized and run from the Scripts menu. The Lua script files are stored at ~/Library/Application Support/Red/Scripts
which can be quickly loaded by selecting "Show in Finder" from the Scripts menu. Within this directory, the scripts can be sorted into subdirectories. When a script is added or removed from this directory, select Scripts: Reload Scripts
so to refresh the scrips menu. Scripts are loaded from the filesystem on each run, so one can modify a script and then test it immediately in Red
.
Sample scripts are included in a directory called "Starter Kit" to help understand how to develop scripts.
```lua hl_lines="5 6 7 8 9 11"
-- Description: Greet the person with the selected key, and optional values
-- KEYS[1]: Key to fetch :
-- ARGV[1]: Name
local name=redis.call("get", KEYS[1])
local greet=ARGV[1]
local result="Hello, " .. greet.."! The selected key has value: "..name
return result
```
Comment Metadata
Description: {description_text}
.notification(self, title, subtitle="", informative_text="", callback=None)
Text to describe the functionality to the user. This will be displayed in the form dialog.
KEYS[{n}] : {label}: {default}
Example: KEYS[1]: The key to fetch : <selection>
Key should be listed in numerical order (filling in {n}
with the next sequential integer). Label text and an optional default follows. Set {default} to the text <selection>
to use the selected key in the sidebar.
ARGS[{n}] : {label} : {default}
Example: ARGS[1]: How many items to move : 5
Additional arguments should be listed in numerical order (filling in {n}
with the next sequential integer). Label text and an optional default follows. Set {default} to the text <selection>
to use the selected key in the sidebar.