mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
close #2
This commit is contained in:
@ -23,6 +23,7 @@ services:
|
|||||||
- CAPTCHA_COOKIE_SECRET=
|
- CAPTCHA_COOKIE_SECRET=
|
||||||
- POW_COOKIE_SECRET=
|
- POW_COOKIE_SECRET=
|
||||||
- RAY_ID=
|
- RAY_ID=
|
||||||
|
- BUCKET_DURATION=43200
|
||||||
nginx:
|
nginx:
|
||||||
image: "nginx:latest"
|
image: "nginx:latest"
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
local _M = {}
|
local _M = {}
|
||||||
|
|
||||||
local sha = require("sha")
|
local sha = require("sha")
|
||||||
local secret_bucket_duration = 43200 -- 60 * 60 * 12 -- 12 hours
|
local secret_bucket_duration = tonumber(os.getenv("BUCKET_DURATION"))
|
||||||
require("print_r")
|
|
||||||
function _M.generate_secret(context, salt, is_applet, iterations)
|
function _M.generate_secret(context, salt, is_applet, iterations)
|
||||||
local start_sec = core.now()['sec']
|
local start_sec = core.now()['sec']
|
||||||
local bucket = start_sec - (start_sec % secret_bucket_duration)
|
local bucket = start_sec - (start_sec % secret_bucket_duration)
|
||||||
|
Reference in New Issue
Block a user