Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 3 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ do
--DATA_PATH=*)
DATA_PATH="${1#*=}"
;;
--SSL_CERTS_PATH=*)
SSL_CERTS_PATH="${1#*=}"
;;
-y|--yes)
SILENT="true"
;;
Expand Down Expand Up @@ -149,7 +152,6 @@ check_lua_dependency() {

install() {
mkdir -p "${DATA_PATH}/templates/"

cp -r lua/lib/* "${LIB_PATH}/"
cp templates/* "${DATA_PATH}/templates/"
#Patch the nginx config file
Expand Down
8 changes: 7 additions & 1 deletion openresty/crowdsec_openresty.conf
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
lua_package_path '$prefix/../lualib/plugins/crowdsec/?.lua;;';
lua_shared_dict crowdsec_cache 50m;
resolver local=on ipv6=off;
lua_ssl_trusted_certificate ${SSL_CERTS_PATH};

init_by_lua_block {
cs = require "crowdsec"
local ok, err = cs.init("/etc/crowdsec/bouncers/crowdsec-openresty-bouncer.conf", "crowdsec-openresty-bouncer/v0.1.10")
if ok == nil then
ngx.log(ngx.ERR, "[Crowdsec] " .. err)
error()
end
ngx.log(ngx.ALERT, "[Crowdsec] Initialisation done")
if ok == "Disabled" then
ngx.log(ngx.ALERT, "[Crowdsec] Bouncer Disabled")
else
ngx.log(ngx.ALERT, "[Crowdsec] Initialisation done")
end
}

access_by_lua_block {
Expand Down