Don't regenerate srvkey at reloading

This commit is contained in:
kload 2013-10-30 16:29:19 +00:00
parent 1788a72e88
commit 89be69b1e6
2 changed files with 3 additions and 2 deletions

View file

@ -2,6 +2,7 @@
-- Load configuration -- Load configuration
-- --
cache = ngx.shared.cache cache = ngx.shared.cache
srvkey = cache:get("srvkey")
oneweek = 60 * 60 * 24 * 7 oneweek = 60 * 60 * 24 * 7
cookies = {} cookies = {}
local conf_file = assert(io.open(conf_path, "r"), "Configuration file is missing") local conf_file = assert(io.open(conf_path, "r"), "Configuration file is missing")

View file

@ -12,7 +12,7 @@ hige = require "hige"
-- Set random key -- Set random key
math.randomseed(os.time()) math.randomseed(os.time())
srvkey = math.random(1111111, 9999999) ngx.shared.cache:add("srvkey", math.random(1111111, 9999999))
-- Shared table -- Shared table
flashs = {} flashs = {}
@ -20,6 +20,6 @@ login = {}
logout = {} logout = {}
-- Path of the configuration -- Path of the configuration
conf_path = '/etc/ssowat/conf.json' conf_path = "/etc/ssowat/conf.json"
ngx.log(ngx.INFO, "SSOwat ready") ngx.log(ngx.INFO, "SSOwat ready")