diff --git a/README.md b/README.md index 062df59..6663d95 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

- + diff --git a/compile.sh b/compile.sh index 1560ab6..9a50d34 100644 --- a/compile.sh +++ b/compile.sh @@ -130,10 +130,6 @@ git_secure_clone https://github.com/crowdsecurity/lua-cs-bouncer.git 3c235c813fc cd lua-cs-bouncer mkdir /usr/local/lib/lua/crowdsec cp lib/*.lua /usr/local/lib/lua/crowdsec -mkdir /opt/crowdsec -cp template.conf /opt/crowdsec/crowdsec.conf -sed -i 's/^API_URL=.*/API_URL=%CROWDSEC_HOST%/' /opt/crowdsec/crowdsec.conf -sed -i 's/^API_KEY=.*/API_KEY=%CROWDSEC_KEY%/' /opt/crowdsec/crowdsec.conf sed -i 's/require "lrucache"/require "resty.lrucache"/' /usr/local/lib/lua/crowdsec/CrowdSec.lua sed -i 's/require "config"/require "crowdsec.config"/' /usr/local/lib/lua/crowdsec/CrowdSec.lua cd /tmp diff --git a/confs/global/crowdsec.conf b/confs/global/crowdsec.conf new file mode 100644 index 0000000..6497057 --- /dev/null +++ b/confs/global/crowdsec.conf @@ -0,0 +1,5 @@ +API_URL={{ CROWDSEC_HOST }} +API_KEY={{ CROWDSEC_KEY }} +LOG_FILE=/tmp/lua_mod.log +CACHE_EXPIRATION=1 +CACHE_SIZE=1000 \ No newline at end of file diff --git a/gen/Templator.py b/gen/Templator.py index 82f6712..9f87394 100644 --- a/gen/Templator.py +++ b/gen/Templator.py @@ -34,6 +34,10 @@ class Templator : if type == "site" and self.__config_global["MULTISITE"] == "yes" : site_config = copy.deepcopy(self.__config_sites[first_server]) real_config.update(site_config) + elif type == "global" and self.__config_global["MULTISITE"] == "yes" and self.__config_global["SERVER_NAME"] != "" : + for k, v in self.__config_sites.items() : + for k2, v2 in v.items() : + real_config[k + "_" + k2] = v2 if not server_name is None : real_config["SERVER_NAME"] = server_name if not first_server is None :