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
960b29e6db
commit
48b76d1395
2 changed files with 11 additions and 3 deletions
|
@ -2,7 +2,6 @@
|
||||||
-- 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")
|
||||||
|
|
13
init.lua
13
init.lua
|
@ -11,8 +11,17 @@ math = require "math"
|
||||||
hige = require "hige"
|
hige = require "hige"
|
||||||
|
|
||||||
-- Set random key
|
-- Set random key
|
||||||
math.randomseed(os.time())
|
local file = io.open("/tmp/ngx_srvkey","r")
|
||||||
ngx.shared.cache:add("srvkey", math.random(1111111, 9999999))
|
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
|
-- Shared table
|
||||||
flashs = {}
|
flashs = {}
|
||||||
|
|
Loading…
Reference in a new issue