Git Product home page Git Product logo

Comments (6)

nicolasff avatar nicolasff commented on July 28, 2024

Hi Olivier,

I think this is a great idea. I'd like to keep the spirit of Webdis by not loading a file from disk though, so it will probably have to go through Redis. What do you think of this, in the config file?

"default_root": "/GET/index.html"

That gives you control over the key and the file type. If you want your root to be an XML file or a text file, that's up to you.
I can add this in a few hours if you don't have any more comments.

from webdis.

ogoudron avatar ogoudron commented on July 28, 2024

This solution is ok for me only if i can force this key to be readonly for security reason.
My first idea was to include the file in the config file and to read the content of this file only at startup.

from webdis.

nicolasff avatar nicolasff commented on July 28, 2024

Webdis doesn't have any concept of keys, any sequence of commands is sent as-is to Redis. You'll have to disable the SET command, and probably some others in order to have a safe service.
You're probably better off disabling all the commands for everyone and enabling only the ones you need. I'll add a second, “read-only” config file to the repository to show you how to do it.

from webdis.

ogoudron avatar ogoudron commented on July 28, 2024

I need to let the SET command enabled. Finaly, i do not need that the key to be readonly because i can use an unguessable key.
For example :
"default_root": "/GET/rilfdjfsdufffyfijiifrfefef.html"
I will disable some command like KEYS for example.
So your solution is OK for me if you do not respond to the "/" URL by a rediction to "/GET/rilfdjfsdufffyfijiifrfefef.html".

from webdis.

nicolasff avatar nicolasff commented on July 28, 2024

I've just pushed some code to support this feature; it doesn't redirect the client but does a transparent substitution instead.

from webdis.

ogoudron avatar ogoudron commented on July 28, 2024

Tested and it works like a charm.
Many many thanks for having added this.

from webdis.

Related Issues (20)

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.