lua-resty-hmac icon indicating copy to clipboard operation
lua-resty-hmac copied to clipboard

how to install?

Open psvz opened this issue 3 years ago • 4 comments

You say "It is recommended to use the latest ngx_openresty bundle directly" Well, I do have the bundle installed, and yet I am getting:

2022/10/26 11:12:54 [error] 3649#3649: *33 lua entry thread aborted: runtime error: content_by_lua(nginx.conf:97):4: module 'resty.hmac' not found:
        no field package.preload['resty.hmac']
        no file '/usr/local/openresty/site/lualib/resty/hmac.ljbc'
        no file '/usr/local/openresty/site/lualib/resty/hmac/init.ljbc'
        no file '/usr/local/openresty/lualib/resty/hmac.ljbc'
        no file '/usr/local/openresty/lualib/resty/hmac/init.ljbc'
        no file '/usr/local/openresty/site/lualib/resty/hmac.lua'
        no file '/usr/local/openresty/site/lualib/resty/hmac/init.lua'
        no file '/usr/local/openresty/lualib/resty/hmac.lua'
        no file '/usr/local/openresty/lualib/resty/hmac/init.lua'
        no file './resty/hmac.lua'
        no file '/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/resty/hmac.lua'
        no file '/usr/local/share/lua/5.1/resty/hmac.lua'
        no file '/usr/local/share/lua/5.1/resty/hmac/init.lua'
        no file '/usr/local/openresty/luajit/share/lua/5.1/resty/hmac.lua'
        no file '/usr/local/openresty/luajit/share/lua/5.1/resty/hmac/init.lua'
        no file '/usr/local/openresty/site/lualib/resty/hmac.so'
        no file '/usr/local/openresty/lualib/resty/hmac.so'
        no file './resty/hmac.so'
        no file '/usr/local/lib/lua/5.1/resty/hmac.so'
        no file '/usr/local/openresty/luajit/lib/lua/5.1/resty/hmac.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file '/usr/local/openresty/site/lualib/resty.so'
        no file '/usr/local/openresty/lualib/resty.so'
        no file './resty.so'
        no file '/usr/local/lib/lua/5.1/resty.so'
        no file '/usr/local/openresty/luajit/lib/lua/5.1/resty.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'

So is there any installation procedure?

psvz avatar Oct 26 '22 13:10 psvz

https://github.com/jkeys089/lua-resty-hmac#installation

Many openresty folks also use opm

jkeys089 avatar Oct 26 '22 14:10 jkeys089

sorry I'm new to lua and opm. I studied the link you provided meticulously before I raised the issue. I couldn't find in that section how to install with opm. I am happy to install your model with opm - what package name I should use?

On a side note, set_hmac_sha256 is a function available in nginx_misc_set module. Is there a possibility to re-use that function as opposed to installing new module? Thanks for your prompt response!

psvz avatar Oct 26 '22 16:10 psvz

https://opm.openresty.org/search?q=hmac

jkeys089 avatar Oct 26 '22 16:10 jkeys089

That was easy! Thanks! might be worthy adding it to your installation section for a next newbie :-)

psvz avatar Oct 26 '22 17:10 psvz