Skip to content

Instantly share code, notes, and snippets.

@R4wm
Last active December 29, 2017 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save R4wm/a0213024271f9979b8029ff5aedc3beb to your computer and use it in GitHub Desktop.
Save R4wm/a0213024271f9979b8029ff5aedc3beb to your computer and use it in GitHub Desktop.
cd ~/git
git clone https://github.com/bungle/lua-resty-nettle.git
git clone https://github.com/bungle/lua-resty-random
git clone https://github.com/r4wm/ectoken
cd ~/Downloads
wget https://openresty.org/download/openresty-1.11.2.5.tar.gz
wget https://www.openssl.org/source/openssl-1.0.2n.tar.gz
wget https://ftp.gnu.org/gnu/nettle/nettle-3.4.tar.gz
#make install openssl and nettle
#TODO post errors if not new opensll and nettle
cp ectoken/lua-ectoken/resty/ectoken.lua /usr/local/openresty/site/lualib/ectoken.lua
/etc/init.d/nginx stop
$START OPENRESTY
## NGINX TEST BLOCK ##
location /random {
access_by_lua '
local ectoken = require "ectoken"
local en = ectoken.encrypt("something", "something")
ngx.say(en)
local de = ectoken.decrypt("something", en)
ngx.say(de)
ngx.say("end lua-ectoken demo")
--end
';
include uwsgi_params;
uwsgi_pass unix:/tmp/cas_core.sock;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment