Merge pull request #30 from crowdsecurity/update_readme

update README
This commit is contained in:
he2ss 2022-03-08 16:25:59 +01:00 committed by GitHub
commit e7aae5afa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,58 +2,10 @@
> Lua module to allow ip (or not) from CrowdSec API.
# Install & Config
:warning: This library will only work with [lua-nginx-module](https://github.com/openresty/lua-nginx-module)
`git clone https://github.com/crowdsecurity/lua-cs-bouncer.git`
This library is used by different bouncers :
## Install script
```
sudo ./install.sh
```
:warning: the installation script works only on Debian/Ubuntu
## From source
### Requirements
```
apt-get install lua5.3
apt-get install lua-sec
```
### With make
```
sudo make install
```
### Manually
- Create folder `/usr/local/lua/crowdsec/`:
```
mkdir -p /usr/local/lua/crowdsec/
```
- Copy the `lua-cs-bouncer/lib/*.lua` into `/usr/local/lua/crowdsec/`:
```
cp ./lua-cs-bouncer/lib/*.lua /usr/local/lua/crowdsec
```
- Copy the `lua-cs-bouncer/template.conf` into `/usr/local/lua/crowdsec/crowdsec.conf`:
```
cp ./lua-cs-bouncer/template.conf /usr/local/lua/crowdsec/crowdsec.conf
```
## Configuration
The configuration is located by default in `/usr/local/lua/crowdsec/crowdsec.conf`:
```
API_URL=http://localhost:8080 <-- the API url
API_KEY= <-- the API Key generated with `cscli bouncers add -n <bouncer_name>`
LOG_FILE=/var/log/crowdsec_lua_bouncer.log <-- path to log file
LOG_LEVEL=INFO <-- log level (INFO, WARN, DEBUG, ERROR, FATAL)
CACHE_EXPIRATION=1 <-- in seconds
CACHE_SIZE=1000 <-- cache size
REQUEST_TIMEOUT=0.2 <-- Maximum duration in seconds for a request to LAPI
```
* [Nginx Bouncer](https://docs.crowdsec.net/docs/next/bouncers/nginx)
* [OpenResty Bouncer](https://docs.crowdsec.net/docs/next/bouncers/openresty)
* [Ingress Nginx Bouncer](https://docs.crowdsec.net/docs/next/bouncers/ingress-nginx)