mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
ARM cache bugfix
This commit is contained in:
parent
48b76d1395
commit
efbba747a1
2 changed files with 6 additions and 13 deletions
|
@ -2,6 +2,12 @@
|
|||
-- Load configuration
|
||||
--
|
||||
cache = ngx.shared.cache
|
||||
srvkey = cache:get("srvkey")
|
||||
if not srvkey then
|
||||
math.randomseed(os.time())
|
||||
srvkey = tostring(math.random(1111111, 9999999))
|
||||
cache:add("srvkey", srvkey)
|
||||
end
|
||||
oneweek = 60 * 60 * 24 * 7
|
||||
cookies = {}
|
||||
local conf_file = assert(io.open(conf_path, "r"), "Configuration file is missing")
|
||||
|
|
13
init.lua
13
init.lua
|
@ -10,19 +10,6 @@ lualdap = require "lualdap"
|
|||
math = require "math"
|
||||
hige = require "hige"
|
||||
|
||||
-- Set random key
|
||||
local file = io.open("/tmp/ngx_srvkey","r")
|
||||
if file ~= nil then
|
||||
srvkey = file:read("*all")
|
||||
file:close()
|
||||
else
|
||||
local file = io.open("/tmp/ngx_srvkey","w")
|
||||
math.randomseed(os.time())
|
||||
srvkey = tostring(math.random(1111111, 9999999))
|
||||
file:write(srvkey)
|
||||
file:close()
|
||||
end
|
||||
|
||||
-- Shared table
|
||||
flashs = {}
|
||||
login = {}
|
||||
|
|
Loading…
Reference in a new issue