Skip to content

Commit 1f94ed7

Browse files
authored
Merge pull request #49 from metabrainz/multi
Suppport for multiple websites and logs in one instance
2 parents b6a3b17 + 1d1a609 commit 1f94ed7

70 files changed

Lines changed: 9332 additions & 282 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Bot-Detector is a high-performance Go application designed to monitor live acces
66

77
The application operates in a continuous loop:
88

9-
1. **Tails a log file** (like an HAProxy or Nginx access log) in real-time.
9+
1. **Tails log files** (like HAProxy or Nginx access logs) in real-time - supports both single and multi-website modes.
1010
2. **Parses each new log line** against a configurable regex format defined in the config file.
1111
3. **Checks the entry** against a series of behavioral chains defined in the YAML configuration file.
1212
4. **Tracks the state** of each IP address (or IP+User-Agent) as it progresses through these chains.
@@ -15,6 +15,7 @@ The application operates in a continuous loop:
1515

1616
## Features
1717

18+
* **Multi-Website Support:** Monitor multiple websites with separate log files, each with global and website-specific detection rules.
1819
* **Real-Time Behavioral Analysis:** Uses flexible YAML configurations to detect sequential patterns.
1920
* **Blocker Integration:** Executes immediate IP blocking via the configured backend (e.g., HAProxy Runtime API, TCP or Unix Socket).
2021
* **High Resilience:** Handles backend instance unavailability by logging the failure and continuing operation.
@@ -125,7 +126,7 @@ See [Cluster Configuration](docs/ClusterConfiguration.md) and [Cluster and Docke
125126
| **`--exit-on-eof`** | | Exits after processing the log file to EOF instead of tailing. |
126127
| **`--help`** | | Display command-line help. |
127128
| **`--listen`** | string | Starts a web server on this address (e.g., `:8080` or `:8080,role=api`). Can be specified multiple times for multiple listeners. |
128-
| **`--log-path`** | filepath | Path to the access log file to tail (or to read in dry-run mode). |
129+
| **`--log-path`** | filepath | Path to the access log file to tail (or to read in dry-run mode). Ignored in multi-website mode where log paths are defined in `config.yaml`. |
129130
| **`--reload-on`** | string | Controls config reloading: `watcher`, `HUP`, `USR1`, or `USR2`. |
130131
| **`--state-dir`** | dirpath | Path to the state directory. Enables persistence if set. |
131132
| **`--top-n`** | number | In dry-run mode, show top N actors per chain. |
@@ -221,6 +222,7 @@ graph TD;
221222
### Configuration and Setup
222223

223224
- [Configuration.md](docs/Configuration.md) - Complete configuration reference including all YAML options, matcher syntax, and examples
225+
- [MultiWebsite.md](docs/MultiWebsite.md) - Multi-website mode setup and configuration
224226
- [HaproxySetup.md](docs/HaproxySetup.md) - HAProxy configuration guide for stick tables, ACLs, and runtime API setup
225227

226228
### Deployment

0 commit comments

Comments
 (0)