mirror of
https://github.com/DanielLavrushin/b4.git
synced 2026-04-28 19:42:02 +00:00
- Created UDP documentation detailing traffic handling and filtering options. - Added backup settings documentation for configuration backup and restoration. - Introduced core settings documentation covering service management, packet processing, and logging. - Added discovery settings documentation for automatic configuration detection. - Created geodata documentation explaining GeoSite and GeoIP databases and their usage. - Added payloads documentation for generating and managing TLS payloads for faking. - Introduced security documentation for web interface authorization and HTTPS setup. - Added domain monitoring documentation for automatic detection of blocked domains and recovery processes. - Created footer and navbar localization files for Russian language support.
74 lines
1.6 KiB
Markdown
74 lines
1.6 KiB
Markdown
---
|
||
sidebar_position: 6
|
||
title: Docker
|
||
---
|
||
|
||
# Docker
|
||
|
||
Образ: [lavrushin/b4](https://hub.docker.com/r/lavrushin/b4) на Docker Hub.
|
||
|
||
## docker-compose
|
||
|
||
Создайте файл `docker-compose.yml`:
|
||
|
||
```yaml
|
||
services:
|
||
b4:
|
||
image: lavrushin/b4:latest
|
||
container_name: b4
|
||
network_mode: host
|
||
cap_add:
|
||
- NET_ADMIN
|
||
- NET_RAW
|
||
- SYS_MODULE
|
||
volumes:
|
||
- ./config:/etc/b4
|
||
restart: unless-stopped
|
||
```
|
||
|
||
Запуск:
|
||
|
||
```bash
|
||
mkdir -p config
|
||
docker compose up -d
|
||
```
|
||
|
||
## docker run
|
||
|
||
```bash
|
||
mkdir -p config
|
||
docker run -d \
|
||
--name b4 \
|
||
--network host \
|
||
--cap-add NET_ADMIN \
|
||
--cap-add NET_RAW \
|
||
--cap-add SYS_MODULE \
|
||
-v ./config:/etc/b4 \
|
||
--restart unless-stopped \
|
||
lavrushin/b4:latest
|
||
```
|
||
|
||
## Параметры
|
||
|
||
| Параметр | Зачем |
|
||
| --- | --- |
|
||
| `network_mode: host` | b4 работает с сетевым стеком хоста напрямую |
|
||
| `NET_ADMIN` | управление netfilter и правилами firewall |
|
||
| `NET_RAW` | работа с raw-сокетами |
|
||
| `SYS_MODULE` | загрузка модулей ядра (modprobe) |
|
||
| `-v ./config:/etc/b4` | конфигурация сохраняется на хосте |
|
||
|
||
## Управление
|
||
|
||
```bash
|
||
docker compose logs -f b4 # логи
|
||
docker compose restart b4 # перезапуск
|
||
docker compose down # остановка
|
||
docker compose pull && docker compose up -d # обновление
|
||
```
|
||
|
||
## Веб-интерфейс
|
||
|
||
После запуска: `http://localhost:7000`
|
||
|
||
Порт настраивается в `config/b4.json` (параметр `web_server.port`).
|