This commit is contained in:
Ivaylo Novakov 2022-03-14 18:20:51 +01:00
parent a3a5d6fa88
commit a03b21107a
No known key found for this signature in database
GPG Key ID: 06B9354AB08BE9C6
1 changed files with 16 additions and 15 deletions

View File

@ -25,23 +25,24 @@ set $skynet_proof '';
set $limit_rate 0; set $limit_rate 0;
access_by_lua_block { access_by_lua_block {
-- if require("skynet.account").accounts_enabled() then local accounts = require("skynet.account")
-- -- check if portal is in authenticated only mode if accounts.accounts_enabled() then
-- if require("skynet.account").is_access_unauthorized() then -- check if portal is in authenticated only mode
-- return require("skynet.account").exit_access_unauthorized() if accounts.is_access_unauthorized() then
-- end return accounts.exit_access_unauthorized()
end
-- -- check if portal is in subscription only mode
-- if accounts.is_access_forbidden() then
-- return accounts.exit_access_forbidden()
-- end
-- --
-- -- check if portal is in subscription only mode -- -- get account limits of currently authenticated user
-- if require("skynet.account").is_access_forbidden() then -- local limits = accounts.get_account_limits()
-- return require("skynet.account").exit_access_forbidden()
-- end
-- --
-- -- get account limits of currently authenticated user -- -- apply download speed limit
-- local limits = require("skynet.account").get_account_limits() -- ngx.var.limit_rate = limits.download
-- end
-- -- apply download speed limit
-- ngx.var.limit_rate = limits.download
-- end
-- -- the block below only makes sense if we are using nginx cache -- -- the block below only makes sense if we are using nginx cache
-- if not ngx.var.skyd_disk_cache_enabled then -- if not ngx.var.skyd_disk_cache_enabled then
-- local httpc = require("resty.http").new() -- local httpc = require("resty.http").new()