85 lines
3.8 KiB
Markdown
85 lines
3.8 KiB
Markdown
# Эталонный production-пример
|
||
|
||
Документ фиксирует эталонное состояние production после успешной установки и preflight. Значения обезличены и предназначены как ориентир для smoke-проверки.
|
||
|
||
```text
|
||
SSH:
|
||
host: <server-ip>
|
||
port: 2323
|
||
user: root
|
||
|
||
Amnezia:
|
||
container: amnezia-awg2
|
||
interface: awg0
|
||
published UDP: 443
|
||
peer CIDR: 10.8.1.0/24
|
||
|
||
AmneziaDNS:
|
||
container: amnezia-dns
|
||
status: healthy
|
||
internal_ip: 172.29.172.254 # example value; verify with docker inspect
|
||
exposed_ports: 53/tcp, 53/udp inside Docker only
|
||
published_ports: none
|
||
public_53: closed
|
||
|
||
Expected status:
|
||
service: active
|
||
network tuning drift: no
|
||
traffic drift: no
|
||
host firewall drift: no
|
||
Docker/Amnezia port_contract: ok
|
||
anti-torrent drift: no
|
||
swap drift: no
|
||
```
|
||
|
||
Проверка ключевых сигналов:
|
||
|
||
```bash
|
||
systemctl status awg2-harness.service --no-pager -l
|
||
systemctl status awg2-reboot-scheduler.service --no-pager -l
|
||
awg2-harness --config /etc/awg2-harness/config.toml status
|
||
```
|
||
|
||
Проверка Docker/Amnezia runtime:
|
||
|
||
```bash
|
||
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
|
||
C="$(docker ps --format '{{.Names}}' | grep -E '^(amnezia-awg2|amnezia-awg)$' | head -n1)"
|
||
docker port "$C"
|
||
docker exec "$C" awg show
|
||
docker exec "$C" awg show awg0 listen-port
|
||
docker inspect -f 'ports={{json .NetworkSettings.Ports}}' amnezia-dns
|
||
```
|
||
|
||
В `status` для AWG publish ожидается полный список фактических bindings, например `0.0.0.0:443` и `[::]:443`. Это внешний Docker publish; он не меняет IPv4-only server peer topology. Каждый server peer обязан иметь ровно один IPv4 `/32` внутри configured CIDR. Смешанный/IPv6/multiple `AllowedIPs` должен останавливать traffic и anti-torrent reconcile с `unsupported topology`.
|
||
|
||
Проверка host firewall выполняется через Docker-совместимый frontend. В `INPUT` ожидается первый jump с comment `awg2-harness:host-firewall`, но не allow-rule для `443/udp`:
|
||
|
||
```bash
|
||
iptables -S INPUT
|
||
iptables -S AWG2H_A 2>/dev/null || iptables -S AWG2H_B
|
||
ip6tables -S INPUT
|
||
ip6tables -S AWG2H_A 2>/dev/null || ip6tables -S AWG2H_B
|
||
```
|
||
|
||
Проверка AWG-контракта внутри контейнера (без раскрытия секретов):
|
||
|
||
```bash
|
||
docker exec "$C" readlink -f /usr/bin/wg # ожидается /usr/bin/awg
|
||
docker exec "$C" awg --version
|
||
docker exec "$C" ip -o link show awg0
|
||
docker exec "$C" ip -d link show awg0
|
||
docker exec "$C" awg show all allowed-ips
|
||
docker exec "$C" awg show all dump | awk -F '\t' '{ print "row=" NR, "fields=" NF, "interface=" $1 }'
|
||
```
|
||
|
||
Reference AWG 3.1 tools `v3.1.20260812` дают 30 полей interface-row и 9 полей peer-row. Исторически WireGuard/AWG 2.x/AWG 3.0 interface-row имели 5/14/28 полей. Width используется только как acceptance evidence: harness не определяет по нему версию и не классифицирует peer. Полный вывод `awg show all dump` передавать нельзя: во второй колонке interface-row находится приватный ключ устройства. Точная upstream-база приведена в [`UPSTREAM_COMPATIBILITY.md`](UPSTREAM_COMPATIBILITY.md).
|
||
|
||
Проверка, что runtime config создан вручную (ожидаемое поведение):
|
||
|
||
```bash
|
||
test -f /etc/awg2-harness/config.toml && echo "runtime config present"
|
||
```
|
||
|
||
Если файл отсутствует после `apt install`, это корректно: создайте его вручную из `/usr/share/doc/awg2-harness/repo/config.example.toml`.
|