SSOwat/init.lua
2013-10-30 16:29:19 +00:00

25 lines
574 B
Lua

-- Remove prepending '@' & trailing 'init.lua'
script_path = string.sub(debug.getinfo(1).source, 2, -9)
-- Include local libs in package.path
package.path = package.path .. ";"..script_path.."?.lua"
-- Load libraries
json = require "json"
lualdap = require "lualdap"
math = require "math"
hige = require "hige"
-- Set random key
math.randomseed(os.time())
ngx.shared.cache:add("srvkey", math.random(1111111, 9999999))
-- Shared table
flashs = {}
login = {}
logout = {}
-- Path of the configuration
conf_path = "/etc/ssowat/conf.json"
ngx.log(ngx.INFO, "SSOwat ready")