kutovoys / marzban-torrent-blocker

Torrents blocker service for Xray based panels and nodes
59 stars 8 forks source link

Marzban Torrent Blocker

en ru

Marzban Torrent Blocker is an application designed to block torrent usage by users of the Marzban panel. The application analyzes logs, detects torrent activity, and temporarily blocks the user, sending notifications to the administrator via Telegram, and optionally to the user. It can also work with other panels and directly with Xray.

Features:

Preparation

Xray Configuration

Marzban Configuration

Node Configuration

Ensure that the volume is correctly mounted in docker-compose.yml:

volumes:
  - /var/lib/marzban-node:/var/lib/marzban-node

By default, this volume is present, ensuring logs are accessible on the host.

Installation

To automatically install the application, follow these steps:

Configuration

After installation, you can configure the application's behavior via the configuration file located at: /opt/torrent-blocker/config.yaml.

Key configuration parameters:

An example configuration file with detailed comments is available at /opt/torrent-blocker/config.yaml.

Example for Sending Notifications to Users:

If the user's CHAT_ID is included in their login on the Marzban panel, you can configure the application to send notifications directly to the user.

For example, if the user's login in Marzban looks like this: kutovoys_tgid-1234111, you can set up the following in config.yaml:

In this case, the administrator will receive notifications with the username kutovoys, and the user will also be notified directly via Telegram when they are blocked.

Contributing

We welcome contributions from the community! If you have ideas for improvements or have found a bug, please create an issue or submit a pull request on GitHub.