bunkerweb icon indicating copy to clipboard operation
bunkerweb copied to clipboard

[BUG] code defined in CUSTOM_CONF_SERVER_HTTP disappears after 60 minutes

Open istvano opened this issue 2 years ago • 0 comments

Description The custom provided in a bunkerweb.CUSTOM_CONF_SERVER_HTTP tag disappears after 60 minutes.

How to reproduce

  • I am using docker with autoconf with multisite
  • define a dummy location section using bunkerweb.CUSTOM_CONF_SERVER_HTTP_example=
  • start the app container
  • check inside the nginx container that the custom config is generated and present in the filesystem
  • wait 60 minutes for a config reload
  • check the filesystem again the custom config file is removed hence the custom code in the custom config is no longer working

Logs [2022-08-31 11:43:43] GENERATOR - ?? - Generator successfully executed ! [2022-08-31 11:43:43] API - ?? - Successfully sent API request to http://bunkerweb-mybunker-1:5000/confs [2022-08-31 11:43:50] API - ?? - Successfully sent API request to http://bunkerweb-mybunker-1:5000/data [2022-08-31 11:43:51] API - ?? - Successfully sent API request to http://bunkerweb-mybunker-1:5000/reload [2022-08-31 11:43:51] DOCKER-CONTROLLER - ?? - Successfully deployed new configuration

At this point everything is good and working as expected. In 60 minutes

[2022-08-31 12:43:43] SCHEDULER - ?? - Executing job bunkernet-register from plugin bunkernet ... [2022-08-31 12:43:43] BUNKERNET - ?? - BunkerNet is not activated, skipping registration... [2022-08-31 12:43:43] SCHEDULER - ?? - Successfuly executed job bunkernet-register from plugin bunkernet [2022-08-31 12:43:43] SCHEDULER - ?? - Executing job realip-download from plugin realip ... [2022-08-31 12:43:43] REALIP - ?? - RealIP is not activated, skipping download... [2022-08-31 12:43:43] SCHEDULER - ?? - Successfuly executed job realip-download from plugin realip [2022-08-31 12:43:43] SCHEDULER - ?? - Executing job blacklist-download from plugin blacklist ... [2022-08-31 12:43:43] BLACKLIST - ?? - Blacklist for IP is not cached, processing downloads.. [2022-08-31 12:43:43] BLACKLIST - ?? - Blacklist for RDNS is not cached, processing downloads.. [2022-08-31 12:43:43] BLACKLIST - ?? - Blacklist for ASN is not cached, processing downloads.. [2022-08-31 12:43:43] BLACKLIST - ?? - Blacklist for USER_AGENT is not cached, processing downloads.. [2022-08-31 12:43:43] BLACKLIST - ?? - Blacklist for URI is not cached, processing downloads.. [2022-08-31 12:43:43] BLACKLIST - ?? - Downloading blacklist data from https://www.dan.me.uk/torlist/?exit ... [2022-08-31 12:43:43] BLACKLIST - ?? - Downloaded 2184 bad IP [2022-08-31 12:43:43] BLACKLIST - ?? - New file IP.list is different than cache file, reload is needed [2022-08-31 12:43:43] BLACKLIST - ?? - Downloading blacklist data from https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/_generator_lists/bad-user-agents.list ... [2022-08-31 12:43:43] BLACKLIST - ?? - Downloaded 637 bad USER_AGENT [2022-08-31 12:43:43] BLACKLIST - ?? - New file USER_AGENT.list is identical to cache file, reload is not needed [2022-08-31 12:43:43] SCHEDULER - ?? - Successfuly executed job blacklist-download from plugin blacklist [2022-08-31 12:43:43] SCHEDULER - ?? - Executing job whitelist-download from plugin whitelist ... [2022-08-31 12:43:43] WHITELIST - ?? - Whitelist for IP is not cached, processing downloads... [2022-08-31 12:43:43] WHITELIST - ?? - Whitelist for RDNS is not cached, processing downloads... [2022-08-31 12:43:43] WHITELIST - ?? - Whitelist for ASN is not cached, processing downloads... [2022-08-31 12:43:43] WHITELIST - ?? - Whitelist for USER_AGENT is not cached, processing downloads... [2022-08-31 12:43:43] WHITELIST - ?? - Whitelist for URI is not cached, processing downloads... [2022-08-31 12:43:43] SCHEDULER - ?? - Successfuly executed job whitelist-download from plugin whitelist [2022-08-31 12:43:43] SCHEDULER - ?? - Sending /data folder ... [2022-08-31 12:43:50] API - ?? - Successfully sent API request to http://bunkerweb-mybunker-1:5000/data [2022-08-31 12:43:50] SCHEDULER - ?? - Successfuly sent /data folder [2022-08-31 12:43:50] SCHEDULER - ?? - Reloading nginx ... [2022-08-31 12:43:51] API - ?? - Successfully sent API request to http://bunkerweb-mybunker-1:5000/reload [2022-08-31 12:43:51] SCHEDULER - ?? - Successfuly reloaded nginx

At this point the custom config file is no longer generated and present in nginx.

It looks as if Successfully sent API request to http://bunkerweb-mybunker-1:5000/confs is missing at this point but this is just a guess.

istvano avatar Aug 31 '22 14:08 istvano