fix wrong init of counter in badbehavior and fix nextcloud/docker example
This commit is contained in:
parent
8e72050625
commit
41e8f5c937
|
@ -10,6 +10,7 @@ services:
|
|||
- SERVER_NAME=www.example.com # replace with your domain
|
||||
- AUTO_LETS_ENCRYPT=yes
|
||||
- DISABLE_DEFAULT_SERVER=yes
|
||||
- API_WHITELIST_IP=127.0.0.1 10.20.30.0/24
|
||||
- MAX_CLIENT_SIZE=10G
|
||||
- USE_CLIENT_CACHE=yes
|
||||
- SERVE_FILES=no
|
||||
|
@ -84,9 +85,9 @@ services:
|
|||
- TRUSTED_PROXIES=192.168.0.0/16 172.16.0.0/12 10.0.0.0/8
|
||||
- APACHE_DISABLE_REWRITE_IP=1
|
||||
- MYSQL_HOST=mydb
|
||||
- MYSQL_DATABASE=${NEXTCLOUD_DATABASE:-nextclouddb}
|
||||
- MYSQL_USER=${NEXTCLOUD_USER:-user}
|
||||
- MYSQL_PASSWORD=${NEXTCLOUD_PASSWORD:-secret} # set a stronger password in a .env file (must match MYSQL_PASSWORD)
|
||||
- MYSQL_DATABASE=nc
|
||||
- MYSQL_USER=user
|
||||
- MYSQL_PASSWORD=db-user-pwd # set a stronger password in a .env file (must match MYSQL_PASSWORD)
|
||||
networks:
|
||||
- bw-services
|
||||
|
||||
|
@ -94,7 +95,7 @@ services:
|
|||
image: mariadb:10.9
|
||||
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
||||
volumes:
|
||||
- ./db-data:/var/lib/mysql
|
||||
- db-data:/var/lib/mysql
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=db-root-pwd # replace with a stronger password
|
||||
- MYSQL_DATABASE=nc
|
||||
|
|
|
@ -31,9 +31,9 @@ function _M.increase(premature, use_redis, ip, count_time, ban_time, threshold)
|
|||
return false, "can't get counts from the datastore : " .. err
|
||||
end
|
||||
if local_counter == nil then
|
||||
counter = 0
|
||||
local_counter = 0
|
||||
end
|
||||
counter = counter + 1
|
||||
counter = local_counter + 1
|
||||
end
|
||||
-- Call decrease later
|
||||
local ok, err = ngx.timer.at(count_time, _M.decrease, use_redis, ip)
|
||||
|
|
Loading…
Reference in New Issue