Giter Club home page Giter Club logo

redis-auth-server's Introduction

redis-auth-server

This is a small server for use with Nginx's auth_request module.

It's meant for a quick and simple auto-auth - basically, the first login will create and save a user in redis. Subsequent logins will actually auth against the stored password hash.

It requires Nginx compiled with Lua support, such as found in OpenResty. It also requires the following lua modules:

  • luaposix
  • etlua
  • luafilesystem

install + use

Just git clone this repository somewhere.

From there, you can install the needed lua modules however you regularly do.

If you install them into a folder named lua_modules, then the script bin/redis-auth-server will use (and only use) modules found under that folder. For example, after cloning you could run:

luarocks install --tree lua_modules luaposix
luarocks install --tree lua_modules etlua
luarocks install --tree lua_modules luafilesystem

Make a copy of etc/config.lua.example to etc/config.lua and edit as-needed, then run bin/redis-auth-server.

By default, all temp files, compiled config files, etc are placed at $HOME/.redis-auth-server - this can be changed by setting the work_dir variable in etc/config.lua

To run as a service, there's an example systemd unit file at misc/redis-auth-server.service:

sudo cp misc/redis-auth-server.service /etc/systemd/system/redis-auth-server.service
# edit /etc/systemd/system/redis-auth-server.service as needed
sudo systemctl daemon-reload
sudo systemctl enable redis-auth-server.service
sudo systemctl start redis-auth-server.service

License

Released under an MIT-style license. See the file LICENSE for details.

The file resty/redis.lua also has an MIT-style license, see the file LICENSE-lua-resty-redis for details.

redis-auth-server's People

Contributors

jprjr avatar

Stargazers

Alex Chistyakov avatar

Watchers

 avatar

Forkers

bugz8unny69

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.