Closed masikrus closed 11 months ago
Could you provide the output of your configuration With api key removed
Here an example configuration
https://github.com/crowdsecurity/lua-cs-bouncer/blob/eb5de9c364fd4990147d1b0962d6b90e393bdcff/config_example.conf
i have not standard port of crowdsec 8089 and i have CentOS 8
cat /etc/crowdsec/bouncers/crowdsec-nginx-bouncer.conf | grep -v API_KEY
ENABLED=true
API_URL=http://127.0.0.1:8089
CACHE_EXPIRATION=1
# bounce for all type of remediation that the bouncer can receive from the local API
BOUNCING_ON_TYPE=all
FALLBACK_REMEDIATION=ban
REQUEST_TIMEOUT=3000
UPDATE_FREQUENCY=10
# live or stream
MODE=live
# exclude the bouncing on those location
EXCLUDE_LOCATION=
#those apply for "ban" action
# /!\ REDIRECT_LOCATION and RET_CODE can't be used together. REDIRECT_LOCATION take priority over RET_CODE
BAN_TEMPLATE_PATH=/var/lib/crowdsec/lua/templates/ban.html
REDIRECT_LOCATION=
RET_CODE=
#those apply for "captcha" action
# ReCaptcha Secret Key
SECRET_KEY=123123
# Recaptcha Site key
SITE_KEY=123123
CAPTCHA_TEMPLATE_PATH=/var/lib/crowdsec/lua/templates/captcha.html
CAPTCHA_EXPIRATION=3600
Have you made sure all dependencies are installed?
System modules:
"libnginx-mod-http-lua"
"luarocks"
"lua5.1"
"gettext-base"
luarocks:
lua-resty-http
lua-cjson
edit I presumed your using nginx
Yap, all of dependencies installed and i use nginx 1.22 with mod lua
i fix that error. in Centos default pkg use https://github.com/liseen/lua-resty-http but you code use https://github.com/ledgetech/lua-resty-http...
BUT! Now i have new error with cjson...
2022/11/01 13:00:42 [error] 2441476#2441476: *1 lua entry thread aborted: runtime error: /usr/local/lua/crowdsec/crowdsec.lua:284: attempt to call field 'decode' (a nil value)
and that i fixed in file /usr/local/lua/crowdsec/crowdsec.lua need add cpath
package.cpath = package.cpath .. ";/usr/share/lua/5.1/?.so"
with you module cjson.so path
help...