diff --git a/docs/ANTI_TORRENT.md b/docs/ANTI_TORRENT.md index 7aadb86..c320304 100644 --- a/docs/ANTI_TORRENT.md +++ b/docs/ANTI_TORRENT.md @@ -25,7 +25,7 @@ nft add rule inet filter forward ip saddr 10.8.1.0/24 ct count over 200 drop Нужен per-source key через meter/set и отдельная таблица, которой владеет только AWG2 Harness. -## 3. Recommended v1 nftables shape +## 3. Recommended nftables shape Правило должно применяться в том же network namespace, где живёт Amnezia AWG/WG interface и где уже применяются `tc`/`ifb0` rules. На практике это namespace контейнера Amnezia, полученный через `/proc//ns/net`. diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 4ee6e23..6d43f80 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -53,7 +53,7 @@ swappiness = 1 `amnezia.interface_candidates` — точные имена интерфейса, которые пробуются первыми. -`amnezia.interface_patterns` — fallback-паттерны для устойчивости к обновлениям Amnezia. Старые материалы прямо отмечают риск переименования интерфейса между `awg0`, `wg0`, `amnezia0`. +`amnezia.interface_patterns` — fallback-паттерны для устойчивости к обновлениям Amnezia. Они нужны для снижения риска переименования интерфейса между `awg0`, `wg0`, `amnezia0`, `tun0`. `amnezia.peer_ipv4_cidr` — подсеть VPN peers. Production default — `10.8.1.0/24`; значение конфигурируемое. @@ -65,9 +65,9 @@ swappiness = 1 `traffic.container_ready_timeout_secs` — сколько ждать появления интерфейса после старта контейнера. -`traffic.class_start_id` — первый class id. В старой системе это `10`, что даёт классы `1:10`, `2:10` и дальше. +`traffic.class_start_id` — первый class id. Production default — `10`, что даёт классы `1:10`, `2:10` и дальше. -`traffic.ifb_name` — имя IFB-интерфейса для ingress shaping. В старой системе это `ifb0`. Этот параметр можно оставить в конфиге, потому что бинарь реально создаёт/удаляет этот интерфейс. +`traffic.ifb_name` — имя IFB-интерфейса для ingress shaping. Production default — `ifb0`. Этот параметр можно оставить в конфиге, потому что бинарь реально создаёт/удаляет этот интерфейс. При drift orchestrator всегда делает controlled rebuild owned topology. @@ -77,7 +77,7 @@ swappiness = 1 `host_firewall.ssh_port` — SSH порт хоста, который обязательно должен быть открыт. Production default/example: `2323`. Значение обязано совпадать с реально слушающим sshd портом до применения `apply-firewall`. -`host_firewall.amnezia_port` — внешний UDP/TCP порт Amnezia, который AWG2 открывает в host `INPUT` (в зависимости от `host_firewall.amnezia_protocols`). Значение должно совпадать с портом, указанным в панели/инсталляторе AmneziaWG. В старых инсталляциях это мог быть `44344`, в новой целевой конфигурации default — `443`. +`host_firewall.amnezia_port` — внешний UDP/TCP порт Amnezia, который AWG2 открывает в host `INPUT` (в зависимости от `host_firewall.amnezia_protocols`). В текущей целевой конфигурации default — `443`; значение должно совпадать с реально опубликованным Amnezia UDP/TCP port. Для диагностического блока `Docker/Amnezia port path` в `status` приоритет сопоставления такой: сначала ищется published UDP binding с `HostPort == host_firewall.amnezia_port`, затем fallback на ключ `"/udp"` как container port, затем (если UDP binding ровно один) берётся он. Если UDP bindings несколько и однозначного совпадения нет, статус показывает `published_udp_port: unknown`. @@ -106,7 +106,7 @@ swappiness = 1 `reboot.enabled` — включает плановую перезагрузку. -`reboot.window_start_utc` / `reboot.window_end_utc` — UTC-окно плановой перезагрузки. В старом Rust-модуле это было зашито как 01:00–02:00 UTC. +`reboot.window_start_utc` / `reboot.window_end_utc` — UTC-окно плановой перезагрузки. Production default/example — `01:00`–`02:00` UTC. `swap.enabled` — включает setup-задачу swap. diff --git a/docs/IMPLEMENTATION_SPEC.md b/docs/IMPLEMENTATION_SPEC.md index f60ba86..20c88f5 100644 --- a/docs/IMPLEMENTATION_SPEC.md +++ b/docs/IMPLEMENTATION_SPEC.md @@ -123,7 +123,7 @@ struct PeerTrafficClass { } ``` -Class assignment must be deterministic. Peer IP strings are sorted lexicographically, then assigned `class_start_id + index`. Do not silently switch this to numeric IPv4 sorting in v1: the production class-id contract maps `10.8.1.10` before `10.8.1.2` because sorting is textual, not numeric. +Class assignment must be deterministic. Peer IP strings are sorted lexicographically, then assigned `class_start_id + index`. Do not silently switch this to numeric IPv4 sorting: the production class-id contract maps `10.8.1.10` before `10.8.1.2` because sorting is textual, not numeric. ## 5. Namespace strategy @@ -136,7 +136,7 @@ Preferred strategy: Implementation options: -- transitional v1: spawn host tools with namespace entry, for example `nsenter -t -n tc ...`, `nsenter -t -n ip ...`, `nsenter -t -n wg ...`; +- current path: spawn host tools with namespace entry, for example `nsenter -t -n tc ...`, `nsenter -t -n ip ...`, `nsenter -t -n wg ...`; - later/native: use netlink crates and explicit namespace switching where practical. `docker exec` should not be the architectural default. It can remain as compatibility fallback if `nsenter`/host tools are unavailable, but the design assumption is that the Rust binary has host authority and controls the relevant namespace. @@ -174,7 +174,7 @@ Parsing rules: - parse lines structurally into peer public key and allowed IPs; - keep IPv4 `/32` addresses within `amnezia.peer_ipv4_cidr`; - include offline peers; online state is not a requirement for shaping; -- sort peer IP strings lexicographically before class assignment to preserve the v1 lexicographic class-id contract. +- sort peer IP strings lexicographically before class assignment to preserve the current lexicographic class-id contract. Fallback: @@ -182,7 +182,7 @@ Fallback: wg show ``` -The fallback parser should support the old output format from `wg-peers.txt`, extracting `allowed ips:` lines. +The fallback parser should support standard `wg show` text output by extracting `allowed ips:` lines. Execution policy for production: @@ -192,7 +192,7 @@ Execution policy for production: ## 8. Desired traffic topology -The expected topology is the v1 AWG2 traffic topology. +The expected topology is the AWG2 traffic topology contract. Egress: @@ -253,7 +253,7 @@ reconcile_traffic(): verify_firewall_after_apply(target, firewall_desired) ``` -For production v1, controlled full rebuild on drift is the only supported path. +For production, controlled full rebuild on drift is the only supported path. Parser hardening requirements: @@ -300,7 +300,7 @@ The rule must not be implemented as a global subnet limit: ip saddr 10.8.1.0/24 ct count over 200 drop ``` -That form can become one shared counter for the whole matched traffic set, depending on how it is written and where it is placed. For per-peer behavior, key the stateful object by source VPN IP. Recommended v1 shape: +That form can become one shared counter for the whole matched traffic set, depending on how it is written and where it is placed. For per-peer behavior, key the stateful object by source VPN IP. Recommended shape: ```nft table inet awg2_harness { @@ -416,7 +416,7 @@ Last actions: last error if any ``` -The old status banner “system ready” is not enough. Rust status must be falsifiable: it should clearly say when state is partial. +A generic status banner like “system ready” is not enough. Rust status must be falsifiable: it should clearly say when state is partial. ## 16. Reboot module integration