feat(adidos): add adaptive ddos protection system plugin#159
Conversation
Add new ADIDOS plugin that monitors remote server load and dynamically enables/disables antibot protection based on configured thresholds. Includes webhook notifications and cooldown period settings.
feat(adidos): add adaptive ddos protection system plugin
|
Hi @zolotarev, apologies for the delay in our review. I really like the idea behind this new plugin. That said, I think it would be a better fit as an external plugin rather than being included directly. Would you be able to open a pull request on this repository? Thanks, and great work! |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
Warning Review limit reached
More reviews will be available in 34 minutes and 49 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Pull request overview
Adds a new adidos plugin intended to provide adaptive, load-triggered antibot enable/disable behavior driven by a scheduler job, with optional webhook notifications and configurable thresholds/cooldowns.
Changes:
- Introduces ADIDOS plugin metadata and settings (
plugin.json) including webhook and monitoring configuration. - Adds the scheduler job (
adidos-monitor.py) to poll remote CPU load over SSH and update antibot settings in the DB. - Adds user documentation (
README.md) describing setup, configuration, and operational notes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
adidos/README.md |
Documents ADIDOS usage, SSH requirements, settings, and Docker deployment guidance. |
adidos/plugin.json |
Declares the plugin, its settings (host, thresholds, webhook fields), and the scheduled job. |
adidos/jobs/adidos-monitor.py |
Implements the monitoring loop, decision logic, DB updates, caching, and webhook notifications. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "ADIDOS_WEB_HOOK_URL": { | ||
| "context": "global", | ||
| "default": "https://ashoo:ashooPaZZword@n8n.its.bz/webhook/ashoo-telegram-send", | ||
| "help": "Web hook URL-address used to POST message", | ||
| "id": "adidos-seb-hook-url", | ||
| "label": "Web hook URL", | ||
| "regex": "^.*$", | ||
| "type": "text" | ||
| }, |
| @@ -0,0 +1,139 @@ | |||
| { | |||
| "id": "Adidos", | |||
| "description": "Adaptive DDoS Protection System", | ||
| "category": "antibot", | ||
| "help": "Monitor remote server system load and enable|disable antibot feature based on load metrics.", | ||
| "version": "1.2", |
| "default": "85.198.111.8", | ||
| "help": "Remote server hostname or IP to monitor.", | ||
| "id": "adidos-host", |
| config = DB.get_config(with_drafts=True) | ||
| services = getenv("ADIDOS_SERVICES", "").split(" ") | ||
| config_update = config | ||
|
|
| else: | ||
| cached_antibot = "yes" | ||
| last_activation = datetime.now() | ||
| cache_data = f"{cached_antibot},{datetime.now().isoformat()}" | ||
| JOB.cache_file("antibot_state", cache_data.encode()) |
| if response.status_code == 200: | ||
| LOGGER.info(f"Webhook sent successfully: {message}") | ||
| else: | ||
| LOGGER.error(f"Webhook failed with status {response.status_code}: {response.text}") |
|
|
||
| # Save to database | ||
| try: | ||
| captcha_type = getenv("ADIDOS_CAPTCHA_TYPE", "captcha") |
| ssh_key_path, | ||
| "-o", | ||
| "StrictHostKeyChecking=no", | ||
| "-o", |
| The bw-scheduler container already includes SSH client pre-installed. You only need to: | ||
| - Mount or manually place an SSH private key in the container at the path specified in `ADIDOS_SSH_KEY` (default: `/usr/share/bunkerweb/scheduler/.ssh/id_rsa`) | ||
| - Ensure the key has passwordless access to the monitored server | ||
| - The SSH client is already available in the container via the src/scheduler/Dockerfile installation (at line 44 add `RUN apk add .... ssh`) or by installing it manually (docker exec bw-scheduler bash -c "apk add --no-cache openssh && which ssh") | ||
| - The SSH client version must be at least 7.0 (docker exec bw-scheduler bash -c "ssh -V") |
Add new ADIDOS plugin that monitors remote server load and dynamically enables/disables antibot protection based on configured thresholds. Includes webhook notifications and cooldown period settings.