A Tool for Creating REST-like API for Your Redis DB Without Writing Any Code

95 views
Skip to first unread message

Deng Xiaodong

unread,
Oct 24, 2019, 1:30:31 PM10/24/19
to Redis DB
Hi folks,

Recently I started working on a side project, aiming for helping create REST-like API for Redis databases without writing any code. For example, you have logical DB 0 and keys key:* inside, then you may expect to have an API service to which people can submit HTTP calls like "http://localhost/0/key:1" then get the value.

Finally I have done a working tool, Rediseen (https://github.com/XD-DENG/rediseen) for this aim.

# Install using Homebrew
brew install XD-DENG/rediseen/rediseen

# Configuration
export REDISEEN_REDIS_URI="redis://:@localhost:6379"
export REDISEEN_DB_EXPOSED=0
export REDISEEN_KEY_PATTERN_EXPOSED="^key:([0-9a-z]+)"

# Start the service
rediseen start

Now you are good to go to try something like "http://localhost:8000/0/key:1".

It supports specifying what logical DB to expose, as well as what keys to expose, so you have control on what people can see from your Redis DB.

Please have a try and share your feedbacks. Thanks in advance!


XD


Itamar Haber

unread,
Oct 24, 2019, 4:24:46 PM10/24/19
to redi...@googlegroups.com
Hello XD,

Looks very nice and appears to be similar to webdis (https://webd.is) in terms of basic functionality. You should consider adding it to the page at https://redis.io/clients by making a PR to the tools.json file in the redis-doc repository.

Cheers,

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redis-db/33c7ef4b-1368-47d8-9410-9ada372c92f1%40googlegroups.com.


--

Itamar Haber
Technicalist Evangely

Phone: +972.54.567.9692

Redis Labs

Deng Xiaodong

unread,
Oct 25, 2019, 10:29:20 AM10/25/19
to Redis DB
Thank you, Itamar, for your inputs.

I have raised a PR in redis-doc to add Rediseen into the tool.json. Kindly have a check.

I have also had a look at Webdis. It is a nice tool. However I think Rediseen is designed in a quite different way from Webdis. Webdis is more like an interface allowing the Redis DB Admin to do all operations they can do with redis-cli. On the other hand, Rediseen is designed to help the owner of Redis DB expose specific information inside Redis to public.

Thanks again, Itamar! And look forward to more suggestions from you and folks here.

XD

在 2019年10月25日星期五 UTC+8上午4:24:46,Itamar Haber写道:
Hello XD,

Looks very nice and appears to be similar to webdis (https://webd.is) in terms of basic functionality. You should consider adding it to the page at https://redis.io/clients by making a PR to the tools.json file in the redis-doc repository.

Cheers,

On Thu, Oct 24, 2019 at 8:30 PM Deng Xiaodong <xd....@gmail.com> wrote:
Hi folks,

Recently I started working on a side project, aiming for helping create REST-like API for Redis databases without writing any code. For example, you have logical DB 0 and keys key:* inside, then you may expect to have an API service to which people can submit HTTP calls like "http://localhost/0/key:1" then get the value.

Finally I have done a working tool, Rediseen (https://github.com/XD-DENG/rediseen) for this aim.

# Install using Homebrew
brew install XD-DENG/rediseen/rediseen

# Configuration
export REDISEEN_REDIS_URI="redis://:@localhost:6379"
export REDISEEN_DB_EXPOSED=0
export REDISEEN_KEY_PATTERN_EXPOSED="^key:([0-9a-z]+)"

# Start the service
rediseen start

Now you are good to go to try something like "http://localhost:8000/0/key:1".

It supports specifying what logical DB to expose, as well as what keys to expose, so you have control on what people can see from your Redis DB.

Please have a try and share your feedbacks. Thanks in advance!


XD


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redi...@googlegroups.com.

quietranger

unread,
Feb 6, 2020, 5:02:53 PM2/6/20
to Redis DB
Hi Deng,

Any idea why I would get the following when starting up rediseen:

[ERROR] Initial talking to Redis failed. Please check the URI provided. Details: dial tcp: lookup :192.168.1.107:6379: no such host

I have used the following to start the service:

docker run \
   
-e REDISEEN_REDIS_URI="redis://:@192.168.1.107:6379" \
   
-e REDISEEN_DB_EXPOSED=0 \
   
-e REDISEEN_KEY_PATTERN_EXPOSED="^key:([0-9a-z]+)" \
   
-p 8000:8000 \
    xddeng
/rediseen:latest

Deng Xiaodong

unread,
Feb 6, 2020, 5:17:19 PM2/6/20
to redi...@googlegroups.com
Hi,

Thanks for the feedback!

To my understanding this is a Docker network issue, given you are trying to access your local network from the container in which you run Rediseen. This is a general Docker question, and not necessarily relates to Rediseen.

A similar issue and related solution were reported here, https://forums.docker.com/t/ping-local-network-from-container/38994

Have a check and let me know if it fixed? Would be happy to provide more advice!

Thanks again!


XD

--
You received this message because you are subscribed to a topic in the Google Groups "Redis DB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/redis-db/9D6v7XBxC5k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to redis-db+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redis-db/d1f57fed-3122-4916-943a-80cfbb82b97a%40googlegroups.com.

quietranger

unread,
Feb 7, 2020, 2:41:09 AM2/7/20
to Redis DB
The problem below was caused because I did not have Redis running.  Bearing in mind that some people, like me, come without even knowing exactly how Redis works, it might be a good idea to include in the documentation that one must have it installed and running before trying to install Rediseen.  I wrongly assumed that the Docker image for Rediseen included everything needed in one package.
Reply all
Reply to author
Forward
0 new messages