From 30e8c886b93313ad0d205b0bed25682e98f8d2e0 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Thu, 3 Mar 2022 19:13:38 +0100 Subject: [PATCH] use constants in tier defaults --- docker/nginx/libs/skynet/account.lua | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/docker/nginx/libs/skynet/account.lua b/docker/nginx/libs/skynet/account.lua index 48490dc2..692d77d5 100644 --- a/docker/nginx/libs/skynet/account.lua +++ b/docker/nginx/libs/skynet/account.lua @@ -1,16 +1,30 @@ local _M = {} --- fallback - remember to keep those updated -local anon_limits = { ["tierID"] = 0, ["tierName"] = "anonymous", ["upload"] = 655360, ["download"] = 655360, ["maxUploadSize"] = 1073741824, ["registry"] = 250 } - --- no limits applied -local no_limits = { ["tierID"] = -1, ["tierName"] = "internal", ["upload"] = 0, ["download"] = 0, ["maxUploadSize"] = 0, ["registry"] = 0 } - -- constant tier ids local tier_id_internal = -1 local tier_id_anonymous = 0 local tier_id_free = 1 +-- fallback - remember to keep those updated +local anon_limits = { + ["tierID"] = tier_id_anonymous, + ["tierName"] = "anonymous", + ["upload"] = 655360, + ["download"] = 655360, + ["maxUploadSize"] = 1073741824, + ["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 function _M.exit_access_unauthorized(message) ngx.status = ngx.HTTP_UNAUTHORIZED