Giter Club home page Giter Club logo

Comments (11)

LaurenceJJones avatar LaurenceJJones commented on July 3, 2024

Hey it is not directly the bouncer, some reason the dependency lua_cjson is failing to compile cause it cant find the file

Could you run sudo find / -name "lua.h"

from cs-nginx-bouncer.

houdini69 avatar houdini69 commented on July 3, 2024

sudo find / -name "lua.h"
/usr/include/lua5.2/lua.h

So install script is looking for lua.h in /usr/include/lua5.1!

from cs-nginx-bouncer.

houdini69 avatar houdini69 commented on July 3, 2024

sudo apt install lua5.2 seems to solve this issue. However sudo nginx -t gives
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [error] init_by_lua error: /usr/lib/crowdsec/lua/plugins/crowdsec/iputils.lua:22: module 'ffi' not found:
no field package.preload['ffi']
no file '/usr/lib/crowdsec/lua/ffi.lua'
no file './ffi.lua'
no file '/usr/local/share/lua/5.1/ffi.lua'
no file '/usr/local/share/lua/5.1/ffi/init.lua'
no file '/usr/local/lib/lua/5.1/ffi.lua'
no file '/usr/local/lib/lua/5.1/ffi/init.lua'
no file '/usr/share/lua/5.1/ffi.lua'
no file '/usr/share/lua/5.1/ffi/init.lua'
no file './ffi.lua'
no file './ffi.so'
no file '/usr/local/lib/lua/5.1/ffi.so'
no file '/usr/lib/aarch64-linux-gnu/lua/5.1/ffi.so'
no file '/usr/lib/lua/5.1/ffi.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
/usr/lib/crowdsec/lua/plugins/crowdsec/iputils.lua:22: in main chunk
[C]: in function 'require'
/usr/lib/crowdsec/lua/crowdsec.lua:4: in main chunk
[C]: in function 'require'
init_by_lua:2: in main chunk
nginx: configuration file /etc/nginx/nginx.conf test failed

from cs-nginx-bouncer.

SirJohn2024 avatar SirJohn2024 commented on July 3, 2024

Starting from here: https://stackoverflow.com/questions/74914141/cannot-install-ffi-library-for-lua-luajit
I bypass the problen this way:

git clone https://github.com/facebookarchive/luaffifb
cd luaffifb
luarocks make
chmod '0755' '/usr/local/lib/lua/5.1/ffi.so'

after that nginx stop complaining...
Hope this helps...

from cs-nginx-bouncer.

houdini69 avatar houdini69 commented on July 3, 2024

sudo luarocks make
gcc -O2 -fPIC -I/usr/include/lua5.1 -c call.c -o call.o -Idynasm
In file included from call.c:9:
ffi.h:30:11: fatal error: lua.h: Aucun fichier ou dossier de ce type
30 | # include <lua.h>
| ^~~~~~~
compilation terminated.

Error: Build error: Failed compiling object call.o

from cs-nginx-bouncer.

SirJohn2024 avatar SirJohn2024 commented on July 3, 2024

Have you tried sudo apt install libffi-dev?

Maybe you're missing /usr/include/lua5.x/lua.h...

from cs-nginx-bouncer.

SirJohn2024 avatar SirJohn2024 commented on July 3, 2024

Sorry, the correct package is liblua5.x-dev not libffi-dev.. My bad...😏

from cs-nginx-bouncer.

houdini69 avatar houdini69 commented on July 3, 2024

Thanks for you help!
I have to install first liblua5.1-0.dev and then install luaffifb as suggested

But nginx -t throws

nginx: [error] [lua] crowdsec.lua:46: init(): error loading recaptcha plugin: no recaptcha site key provided, can't use recaptcha

from cs-nginx-bouncer.

houdini69 avatar houdini69 commented on July 3, 2024

Ok. I can disable recaptcha temporaly and look at its configuration...

from cs-nginx-bouncer.

SirJohn2024 avatar SirJohn2024 commented on July 3, 2024

Check this https://github.com/crowdsecurity/lua-cs-bouncer

git clone https://github.com/crowdsecurity/lua-cs-bouncer.git
Read the README.md, I had to install manually, but seems to do the trick...

from cs-nginx-bouncer.

houdini69 avatar houdini69 commented on July 3, 2024

Check this https://github.com/crowdsecurity/lua-cs-bouncer

git clone https://github.com/crowdsecurity/lua-cs-bouncer.git Read the README.md, I had to install manually, but seems to do the trick...

You mean installing lua-cs-bouncer will fix nginx error? I can't disable recapcha plugin.

from cs-nginx-bouncer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.