remove internal tier
This commit is contained in:
parent
e656bd78a3
commit
4dff19c6c7
|
@ -13,6 +13,3 @@ set $skylink "";
|
||||||
|
|
||||||
# cached account limits (json string) - applies only if accounts are enabled
|
# cached account limits (json string) - applies only if accounts are enabled
|
||||||
set $account_limits "";
|
set $account_limits "";
|
||||||
|
|
||||||
# set this internal flag to true if current request should not be limited in any way
|
|
||||||
set $internal_no_limits "false";
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
local _M = {}
|
local _M = {}
|
||||||
|
|
||||||
-- constant tier ids
|
-- constant tier ids
|
||||||
local tier_id_internal = -1
|
|
||||||
local tier_id_anonymous = 0
|
local tier_id_anonymous = 0
|
||||||
local tier_id_free = 1
|
local tier_id_free = 1
|
||||||
|
|
||||||
|
@ -15,16 +14,6 @@ local anon_limits = {
|
||||||
["registry"] = 250
|
["registry"] = 250
|
||||||
}
|
}
|
||||||
|
|
||||||
-- no limits applied
|
|
||||||
local no_limits = {
|
|
||||||
["tierID"] = tier_id_internal,
|
|
||||||
["tierName"] = "internal",
|
|
||||||
["upload"] = 0,
|
|
||||||
["download"] = 0,
|
|
||||||
["maxUploadSize"] = 0,
|
|
||||||
["registry"] = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
-- handle request exit when access to portal should be restricted to authenticated users only
|
-- handle request exit when access to portal should be restricted to authenticated users only
|
||||||
function _M.exit_access_unauthorized(message)
|
function _M.exit_access_unauthorized(message)
|
||||||
ngx.status = ngx.HTTP_UNAUTHORIZED
|
ngx.status = ngx.HTTP_UNAUTHORIZED
|
||||||
|
@ -48,10 +37,6 @@ end
|
||||||
function _M.get_account_limits()
|
function _M.get_account_limits()
|
||||||
local cjson = require('cjson')
|
local cjson = require('cjson')
|
||||||
|
|
||||||
if ngx.var.internal_no_limits == "true" then
|
|
||||||
return no_limits
|
|
||||||
end
|
|
||||||
|
|
||||||
if ngx.var.skynet_jwt == "" then
|
if ngx.var.skynet_jwt == "" then
|
||||||
return anon_limits
|
return anon_limits
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue