Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ luac.out
*.x86_64
*.hex

# Backup files
*.bak

tags
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@ services:
build:
dockerfile: Dockerfile
context: .
target: build
container_name: resty
ports:
- "8080:80"
- "443:443"
volumes:
- "./src/conf/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf"
- "./src/lua_resty_netacea.lua:/usr/local/openresty/site/lualib/lua_resty_netacea.lua"
- "./src/lua_resty_netacea_cookies_v3.lua:/usr/local/openresty/site/lualib/lua_resty_netacea_cookies_v3.lua"
- "./src/kinesis_resty.lua:/usr/local/openresty/site/lualib/kinesis_resty.lua"
- "./src/lua_resty_netacea_ingest.lua:/usr/local/openresty/site/lualib/lua_resty_netacea_ingest.lua"
- "./src/netacea_utils.lua:/usr/local/openresty/site/lualib/netacea_utils.lua"
- "./src/lua_resty_netacea_constants.lua:/usr/local/openresty/site/lualib/lua_resty_netacea_constants.lua"
- "./src/lua_resty_netacea_protector_client.lua:/usr/local/openresty/site/lualib/lua_resty_netacea_protector_client.lua"


test:
build:
Expand Down
3 changes: 2 additions & 1 deletion lua_resty_netacea-0.2-2.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ dependencies = {
"luaossl",
"lua-resty-http",
"lbase64",
"lua-cjson"
"lua-cjson",
"lua-resty-jwt"
}
external_dependencies = {}
build = {
Expand Down
17 changes: 14 additions & 3 deletions src/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,37 @@ http {
lua_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt;
init_worker_by_lua_block {
netacea = (require 'lua_resty_netacea'):new({
ingestEndpoint = '',
mitigationEndpoint = '',
apiKey = '',
secretKey = '',
realIpHeader = '',
ingestEnabled = false,
mitigationEnabled = false,
mitigationType = ''
mitigationType = '',
cookieName = '',
kinesisProperties = {
region = '',
stream_name = '',
aws_access_key = '',
aws_secret_key = '',
}
})
}
log_by_lua_block {
netacea:ingest()
}
access_by_lua_block {
netacea:mitigate()
if ngx.var.uri == "/AtaVerifyCaptcha" then
netacea:handleCaptcha()
else
netacea:mitigate()
end
}

server {
listen 80;
server_name localhost;
server_tokens off;
location / {
default_type text/html;
content_by_lua 'ngx.say("<p>hello, world</p>")';
Expand Down
Loading