Block BitTorrent on the server
- awg-ctrl: optional nft table awg_torrent (GET/PUT /api/torrent, off by default). A connection is judged by its first packets, like Xray's sniffing: DHT, UDP trackers, uTP SYN, and with @ih support the plain TCP handshake and HTTP announce. A match marks the connection in conntrack and drops it whole; without @ih only the UDP part is used - devices that tried are kept in a 10-minute set and flagged as "torrent" in user and device stats; with shaping on they sit in the background class while the flag lasts - metrics: awg_torrent_block_enabled/active, awg_torrent_blocked_total, awg_torrent_devices and per-peer awg_peer_torrent - panel: "Торренты" section in server settings, "торренты" chip on users and devices; Save sends only what changed
This commit is contained in:
@@ -6,16 +6,19 @@ import type { Priority } from '../lib/shared';
|
||||
// Текущая приоритетность ключа/устройства. «Фоновый» — только пока канал занят, а устройство давно
|
||||
// качает заметно больше своей доли: оно уступает остальным, но свободный канал занимает по-прежнему.
|
||||
// Когда деление канала выключено или канал свободен, у всех «обычный». Без поля (awg-ctrl старше
|
||||
// деления канала) чип не показываем: «обычный» там было бы выдумкой.
|
||||
export default function PriorityChip({ priority }: { priority?: Priority }) {
|
||||
// деления канала) чип не показываем: «обычный» там было бы выдумкой. С меткой «торренты» устройство
|
||||
// фоновое независимо от загрузки канала — подсказка говорит об этом.
|
||||
export default function PriorityChip({ priority, torrent }: { priority?: Priority; torrent?: boolean }) {
|
||||
if (!priority) return null;
|
||||
const bg = priority === 'background';
|
||||
return (
|
||||
<span
|
||||
className="tip-wrap"
|
||||
data-tip={bg
|
||||
? 'Канал занят, а это устройство давно качает больше своей доли — пока оно уступает остальным'
|
||||
: 'Обычный приоритет: канал делится поровну'}
|
||||
data-tip={!bg
|
||||
? 'Обычный приоритет: канал делится поровну'
|
||||
: torrent
|
||||
? 'Пытается качать торренты — пока висит метка, устройство уступает остальным'
|
||||
: 'Канал занят, а это устройство давно качает больше своей доли — пока оно уступает остальным'}
|
||||
>
|
||||
<span className={`chip ${bg ? 'chip--warm' : 'chip--offline'}`}>
|
||||
<span className="chip-dot" />{bg ? 'фоновый' : 'обычный'}
|
||||
|
||||
Reference in New Issue
Block a user