project Websites / videos.bentasker.co.uk avatar

Websites / videos.bentasker.co.uk: 0f9a779b




VID-11 Switch to using {{ngx}} vars ready for a test deployment

VID-11 Switch to using {{ngx}} vars ready for a test deployment

Will commit any bugfixes that result after

Commit 0f9a779b.

Authored 2019-04-16T18:05:00.000+01:00 by B Tasker in project Websites / videos.bentasker.co.uk

+12 lines -12 lines

Changes

diff --git a/resources/tokenisation/minter/token_gen.lua b/resources/tokenisation/minter/token_gen.lua
--- a/resources/tokenisation/minter/token_gen.lua
+++ b/resources/tokenisation/minter/token_gen.lua
# @@ -88,12 +88,12 @@ end
# local function sendFailed(reason)
# local r = {status = false, token = 'failed', exp = '-1', msg = reason}
#
# - -- ngx.status = 403
# - -- ngx.say(json.encode(r))
# - -- ngx.exit(403)
# + ngx.status = 403
# + ngx.say(json.encode(r))
# + ngx.exit(403)
#
# -- Offline only
# - print(json.encode(r))
# + -- print(json.encode(r))
#
# end
#
# @@ -151,15 +151,15 @@ end
# -- Function main
#
# -- get some details from the request
# --- local referer = ngx.var.arg_ref
# -local referer = 'https://snippets.bentasker.co.uk/foobar' -- for offline testing only
# +local referer = ngx.var.arg_ref
# +-- local referer = 'https://snippets.bentasker.co.uk/foobar' -- for offline testing only
#
# --- local vidpath = ngx.var.arg_vidpath
# -local vidpath = '2019/08/16.m3u8' -- for offline testing only
# +local vidpath = ngx.var.arg_vidpath
# +-- local vidpath = '2019/08/16.m3u8' -- for offline testing only
#
# -- Get the user's IP
# --- local ip = ngx.var.remote_addr
# -local ip = '127.0.1.1' -- for offline testing only
# +local ip = ngx.var.remote_addr
# +-- local ip = '127.0.1.1' -- for offline testing only
#
#
# -- Grab the HTTP referrer header if present
# @@ -192,5 +192,5 @@ local tok = mint_token(vidpath,expires,ip,secret)
# -- print(tok)
#
#
# --- ngx.print(sendSuccessful(tok,expires,{vidpath,ip,expires}))
# -print(sendSuccessful(tok,expires,{vidpath,ip,expires})) -- offline testing only
# +ngx.print(sendSuccessful(tok,expires,{vidpath,ip,expires}))
# +-- print(sendSuccessful(tok,expires,{vidpath,ip,expires})) -- offline testing only
#