docs: rewrite diagram as 2-column (networks left, stacks right)

Per user request: complete restructure.

Left column: ALL 22 networks (lan + 21 swarm overlay) as small blocks.
Right column: stacks, with nodes listed inside each.
No physical hosts, no reachability annotations, no legend noise.

Inside each stack: <rect class="node-fill"> per node with:
- container name + short task id
- current IPs in relevant networks
- image (where relevant)

Dead nodes (brencher-state-proxy, nginx_*) shown with class="node-dead"
(red dashed border) to keep them visible but clearly off.

Connector lines: amber = LAN reach, dashed rose = brencher deploy flow.

README.md rewritten: minimal — what / how to update / sources.
Removed svg-adaptive.md (info now in README).
This commit is contained in:
hermes
2026-08-27 17:29:12 +00:00
parent df1b2ce715
commit 8dc466ced3
3 changed files with 450 additions and 390 deletions
+26 -50
View File
@@ -1,60 +1,36 @@
# Production architecture — финальный вариант
# Architecture diagram
> **Snapshot:** 2026-08-27 · sources: `docker_socket_proxy` (read-only) + gitea admin API + gitea_server logs.
![Architecture diagram](./standalone-adaptive.svg)
## Что в этой папке
Snapshot: 2026-08-27. Light/dark theme via `prefers-color-scheme`.
| Файл | Назначение |
|---|---|
| `svg-adaptive.md` | **Главный файл** — preview в Gitea, обёртка с описанием |
| `standalone-adaptive.svg` | Собственно SVG (адаптивный light/dark) |
## What
## История решений (что было отброшено)
- **Left column:** all 22 networks (lan + 21 swarm overlay). One block = one network.
- **Right column:** all stacks. Inside each stack — its nodes (containers).
Это финал после серии экспериментов. Сначала я сделал 10 вариантов одной диаграммы:
No physical hosts shown (per spec). No reachability annotations (kept minimal).
1. ❌ Mermaid в md — спартанский стиль, трудно контролировать layout
2. ❌ `<img>` без sizing — теряется контроль над размером
3. ❌ `<img>` с sizing (но `style` санитизируется gitea)
4. ❌ Inline SVG в `<details>` — diff нечитаемый, дублирование
5. ❌ `<object>` — gitea вырезает через goldmark санитайзер
6. ✅ **Adaptive SVG** — `<img src>` + `@media prefers-color-scheme` в самом SVG
7. ❌ Plain SVG без адаптивности
8. ❌ HTML+SVG dark theme — не рендерится в Gitea preview
9. ❌ ASCII art — работает везде, но некрасиво
## How to update
**Почему adaptive SVG зашёл:**
- Один файл, рендерится и в Gitea preview, и при прямом открытии в браузере
- Автоматически подстраивается под light/dark тему пользователя (через `<img>` это работает только в браузере, не в Gitea-preview, но при прямом открытии SVG — адаптивно)
- Точный layout (ручной SVG, не auto-generated)
- Жёлтые кружки для физических хостов + reachability-аннотации ясно показывают кто кого видит
1. Re-fetch live state from the cluster:
```
curl http://docker_socket_proxy:2375/networks | python3 -m json.tool > /tmp/nets.json
curl http://docker_socket_proxy:2375/services | python3 -m json.tool > /tmp/services.json
curl http://docker_socket_proxy:2375/tasks?filters='{"desired-state":"running"}' > /tmp/tasks.json
```
2. Compare counts/labels against `standalone-adaptive.svg`. Update blocks that changed.
3. For new stacks/services: add a stack rect in the right column + 1+ node rects inside.
4. For new networks: add a network block in the left column at the matching height.
## Что показывает финальная диаграмма
Convention:
- Each network block: `class="net-fill"` (overlay) or `class="net-external-fill"` (lan).
- Each stack: `class="stack-fill"`, contains `<rect class="node-fill">` per node.
- Dead nodes: `class="node-dead"` (red dashed border).
- Numbers in node title = network IPs in current state.
- **Сеть `lan`** (192.168.1.0/24) — amber-bordered блок между Keenetic и физическими хостами
- **Физические хосты** — жёлтые кружки с цифрами (① odroid, ② xu4)
- **Стеки** на odroid: gitea, hermes, hermes_infra, immich, brencher, gmail_mcp, torrserv_proxy
- **Dead:** `nginx_nginx` (Replicas=0)
- **Reachability** — зелёные ● и красные ● показывают кто кого видит
## Sources
## Что НЕ показывает (для следующих уровней)
- Каждый отдельный контейнер в overlay-сетях
- Volume mounts и где лежат данные
- Swarm secrets (LFS_JWT_SECRET, JWT_SECRET, INTERNAL_TOKEN)
- DNS-резолвинг детально
- Traffic flow конкретных сервисов
## Известные TODO
1. `endpoint.Ports` у gitea_server пустое, но ingress маршрутизирует — legacy.
2. `xu4` worker пуст в снапшоте.
3. `nginx_nginx` Replicas=0 — dead.
4. Tailscale роль (subnet router) требует подтверждения.
5. brencher-stack-compose для каждого стека отсутствует в `admin/ansible`.
## Связанные тикеты
- `admin/ansible#5` — re-deploy `hermes_squid`
- `admin/ansible#6` — pre-create `socket_proxy` overlay
- `admin/ansible#7` — gitea stack deploy / app.ini fix
- `docker_socket_proxy` (read-only): `/networks`, `/services`, `/tasks`, `/containers/{id}/json`
- `admin/ansible` repo: `poc/*/stack-compose.yml` for stack definitions
- Gitea admin API: `POST /api/v1/repos/admin/ansible/issues` for tickets about drift
+424 -285
View File
@@ -1,85 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 950" font-family="ui-monospace, SFMono-Regular, monospace" font-size="12">
<title>Production architecture · Adaptive (dark/light via prefers-color-scheme)</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1400" font-family="ui-monospace, SFMono-Regular, monospace" font-size="11">
<title>Production architecture · networks and stacks</title>
<desc>
Cluster overview. Snapshot 2026-08-27.
Yellow numbered circles = physical hosts (1=odroid, 2=xu4).
"lan" = the shared LAN 192.168.1.0/24 segment between Keenetic and the swarm hosts.
Left column: all 22 overlay networks (lan + 21 swarm overlay).
Right column: stacks, each stack contains its nodes (containers).
Snapshot 2026-08-27.
</desc>
<style>
/* Default = dark theme */
.bg { fill: #020617; }
.grid-dot { fill: #1e293b; }
.title { fill: #e2e8f0; }
.col-label { fill: #94a3b8; font-size: 12; font-weight: bold; letter-spacing: 1px; }
.ext-bg { fill: #1e293b; fill-opacity: 0.5; stroke: #94a3b8; }
.ext-text { fill: #94a3b8; }
.net-fill { fill: #422006; fill-opacity: 0.4; stroke: #f59e0b; }
.net-text { fill: #fde68a; }
.net-sub { fill: #fbbf24; font-size: 9; }
.net-external-fill { fill: #1e293b; fill-opacity: 0.5; stroke: #94a3b8; }
.net-external-text { fill: #cbd5e1; }
.lan-fill { fill: #422006; fill-opacity: 0.4; stroke: #f59e0b; }
.lan-text { fill: #fbbf24; }
.lan-label { fill: #fde68a; }
.stack-fill { fill: #0c4a6e; fill-opacity: 0.3; stroke: #22d3ee; }
.stack-text { fill: #cffafe; font-weight: bold; }
.stack-sub { fill: #67e8f9; font-size: 9; }
.node-fill { fill: #0f172a; stroke: #fbbf24; }
.node-text { fill: #fef3c7; }
.node-fill { fill: #0f172a; stroke: #475569; stroke-width: 1; }
.node-text { fill: #cbd5e1; }
.node-dead { fill: #1f1717; stroke: #fb7185; stroke-dasharray: 3 2; }
.node-dead-text { fill: #fecaca; }
.stack-fill { fill: #0c4a6e; stroke: #22d3ee; }
.stack-text { fill: #cffafe; }
.arrow-lan { stroke: #f59e0b; fill: none; }
.arrow-net { stroke: #cbd5e1; fill: none; }
.arrow-deploy { stroke: #fb7185; fill: none; stroke-dasharray: 4 3; }
.dead-fill { fill: #1f1717; stroke: #fb7185; }
.dead-text { fill: #fecaca; }
.edge-fill { fill: #064e3b; stroke: #34d399; }
.edge-text { fill: #d1fae5; }
.arrow { stroke: #cbd5e1; }
.arrow-d { stroke: #fb7185; }
.arrow-lan { stroke: #f59e0b; }
.host-circle { fill: #fbbf24; stroke: #78350f; stroke-width: 1.5; }
.host-text { fill: #451a03; font-weight: bold; }
.legend-text { fill: #cbd5e1; }
.footer { fill: #475569; }
/* Reachability annotations */
.reach-can { fill: #34d399; }
.reach-no { fill: #fb7185; }
.reach-text { fill: #cbd5e1; font-size: 9; font-style: italic; }
/* Light theme */
@media (prefers-color-scheme: light) {
.bg { fill: #f8fafc; }
.grid-dot { fill: #cbd5e1; }
.title { fill: #0f172a; }
.col-label { fill: #475569; }
.ext-bg { fill: #e2e8f0; fill-opacity: 0.7; stroke: #64748b; }
.ext-text { fill: #475569; }
.net-fill { fill: #fef3c7; fill-opacity: 0.6; stroke: #b45309; }
.net-text { fill: #78350f; }
.net-sub { fill: #92400e; }
.net-external-fill { fill: #e2e8f0; fill-opacity: 0.7; stroke: #64748b; }
.net-external-text { fill: #1e293b; }
.lan-fill { fill: #fef3c7; fill-opacity: 0.6; stroke: #b45309; }
.lan-text { fill: #78350f; }
.lan-label { fill: #92400e; }
.stack-fill { fill: #ecfeff; fill-opacity: 0.4; stroke: #0e7490; }
.stack-text { fill: #0c4a6e; }
.stack-sub { fill: #155e75; }
.node-fill { fill: #fffbeb; stroke: #b45309; }
.node-text { fill: #78350f; }
.node-fill { fill: #ffffff; stroke: #94a3b8; }
.node-text { fill: #1e293b; }
.stack-fill { fill: #ecfeff; stroke: #0e7490; }
.stack-text { fill: #164e63; }
.dead-fill { fill: #fff1f2; stroke: #be123c; }
.dead-text { fill: #881337; }
.edge-fill { fill: #ecfdf5; stroke: #047857; }
.edge-text { fill: #064e3b; }
.arrow { stroke: #475569; }
.arrow-d { stroke: #be123c; }
.arrow-lan { stroke: #b45309; }
.arrow-net { stroke: #475569; }
.arrow-deploy { stroke: #be123c; }
.host-circle { fill: #fbbf24; stroke: #92400e; }
.host-text { fill: #451a03; }
.legend-text { fill: #1e293b; }
.footer { fill: #94a3b8; }
.reach-text { fill: #475569; }
}
</style>
@@ -87,273 +67,432 @@
<pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">
<circle cx="20" cy="20" r="0.5" class="grid-dot"/>
</pattern>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<marker id="a-net" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#cbd5e1"/>
</marker>
<marker id="arrow-d" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#fb7185"/>
</marker>
<marker id="arrow-lan" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<marker id="a-lan" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#f59e0b"/>
</marker>
<marker id="a-deploy" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#fb7185"/>
</marker>
</defs>
<rect width="1400" height="950" class="bg"/>
<rect width="1400" height="950" fill="url(#grid)"/>
<rect width="1600" height="1400" class="bg"/>
<rect width="1600" height="1400" fill="url(#grid)"/>
<text x="40" y="40" class="title" font-size="20" font-weight="bold">
Production architecture · Adaptive (dark/light)
<!-- Title -->
<text x="40" y="36" class="title" font-size="20" font-weight="bold">
Production architecture · networks &amp; stacks
</text>
<!-- ============================================================== -->
<!-- External: Client -->
<!-- LEFT COLUMN: Networks -->
<!-- ============================================================== -->
<text x="40" y="80" class="col-label">NETWORKS (22)</text>
<!-- LAN -->
<g>
<ellipse cx="100" cy="100" rx="70" ry="22" class="ext-bg"/>
<text x="100" y="106" text-anchor="middle" class="title" font-size="11" font-weight="bold">Client</text>
<text x="100" y="135" text-anchor="middle" class="ext-text" font-size="9">из tailscale-сети</text>
<rect x="40" y="100" width="280" height="50" rx="6" class="net-external-fill" stroke-width="2"/>
<text x="180" y="120" text-anchor="middle" class="net-external-text" font-size="12" font-weight="bold">lan</text>
<text x="180" y="135" text-anchor="middle" class="net-external-text" font-size="9">192.168.1.0/24</text>
<text x="180" y="146" text-anchor="middle" class="net-external-text" font-size="8">(физическая LAN)</text>
</g>
<!-- Swarm core -->
<g>
<rect x="40" y="160" width="280" height="40" rx="6" class="net-fill" stroke-width="1.5"/>
<text x="180" y="180" text-anchor="middle" class="net-text" font-size="12" font-weight="bold">ingress</text>
<text x="180" y="194" text-anchor="middle" class="net-sub">10.0.0.0/24 · swarm routing mesh</text>
</g>
<!-- Stack-internal networks (10) -->
<text x="40" y="222" class="col-label" font-size="10">STACK NETWORKS</text>
<g>
<rect x="40" y="232" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="247" class="net-text" font-size="11">gitea_gitea</text>
<text x="270" y="250" text-anchor="end" class="net-sub">10.0.17.0/24</text>
<text x="50" y="261" class="net-sub" font-size="8">→ gitea stack</text>
</g>
<g>
<rect x="40" y="272" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="287" class="net-text" font-size="11">immich_default</text>
<text x="270" y="290" text-anchor="end" class="net-sub">10.0.2.0/24</text>
<text x="50" y="301" class="net-sub" font-size="8">→ immich stack</text>
</g>
<g>
<rect x="40" y="312" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="327" class="net-text" font-size="11">hermes_hermes</text>
<text x="270" y="330" text-anchor="end" class="net-sub">10.0.11.0/24</text>
<text x="50" y="341" class="net-sub" font-size="8">→ hermes stack</text>
</g>
<g>
<rect x="40" y="352" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="367" class="net-text" font-size="11">hermes_infra_default</text>
<text x="270" y="370" text-anchor="end" class="net-sub">10.0.13.0/24</text>
<text x="50" y="381" class="net-sub" font-size="8">→ hermes_infra stack</text>
</g>
<g>
<rect x="40" y="392" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="407" class="net-text" font-size="11">gmail_mcp_default</text>
<text x="270" y="410" text-anchor="end" class="net-sub">10.0.8.0/24</text>
<text x="50" y="421" class="net-sub" font-size="8">→ gmail_mcp stack</text>
</g>
<g>
<rect x="40" y="432" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="447" class="net-text" font-size="11">torrserv_proxy_default</text>
<text x="270" y="450" text-anchor="end" class="net-sub">10.0.10.0/24</text>
<text x="50" y="461" class="net-sub" font-size="8">→ torrserv_proxy stack</text>
</g>
<g>
<rect x="40" y="472" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="487" class="net-text" font-size="11">brencher_brencher-net</text>
<text x="270" y="490" text-anchor="end" class="net-sub">10.0.6.0/24</text>
<text x="50" y="501" class="net-sub" font-size="8">→ brencher stack</text>
</g>
<g>
<rect x="40" y="512" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="527" class="net-text" font-size="11">brencher2_brencher-net</text>
<text x="270" y="530" text-anchor="end" class="net-sub">10.0.5.0/24</text>
<text x="50" y="541" class="net-sub" font-size="8">→ brencher2 stack</text>
</g>
<g>
<rect x="40" y="552" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="567" class="net-text" font-size="11">photosHelper_default</text>
<text x="270" y="570" text-anchor="end" class="net-sub">10.0.9.0/24</text>
<text x="50" y="581" class="net-sub" font-size="8">→ photosHelper stack</text>
</g>
<g>
<rect x="40" y="592" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="607" class="net-text" font-size="11">docker_socket_proxy_default</text>
<text x="270" y="610" text-anchor="end" class="net-sub">10.0.21.0/24</text>
<text x="50" y="621" class="net-sub" font-size="8">→ docker_socket_proxy stack</text>
</g>
<!-- Cross-stack (11) -->
<text x="40" y="652" class="col-label" font-size="10">CROSS-STACK NETWORKS</text>
<g>
<rect x="40" y="662" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="677" class="net-text" font-size="11">nginx_ingress</text>
<text x="270" y="680" text-anchor="end" class="net-sub">10.0.3.0/24</text>
<text x="50" y="691" class="net-sub" font-size="8">→ gitea, brencher-state-proxy</text>
</g>
<g>
<rect x="40" y="702" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="717" class="net-text" font-size="11">nginx_default</text>
<text x="270" y="720" text-anchor="end" class="net-sub">10.0.4.0/24</text>
<text x="50" y="731" class="net-sub" font-size="8">→ nginx stack</text>
</g>
<g>
<rect x="40" y="742" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="757" class="net-text" font-size="11">hermes_infra_admin</text>
<text x="270" y="760" text-anchor="end" class="net-sub">10.0.14.0/24</text>
<text x="50" y="771" class="net-sub" font-size="8">→ admin overlay</text>
</g>
<g>
<rect x="40" y="782" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="797" class="net-text" font-size="11">hermes_infra_hermes_proxy</text>
<text x="270" y="800" text-anchor="end" class="net-sub">10.0.15.0/24</text>
<text x="50" y="811" class="net-sub" font-size="8">→ hermes egress</text>
</g>
<g>
<rect x="40" y="822" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="837" class="net-text" font-size="11">hermes_infra_squid_egress</text>
<text x="270" y="840" text-anchor="end" class="net-sub">10.0.12.0/24</text>
<text x="50" y="851" class="net-sub" font-size="8">→ squid egress</text>
</g>
<g>
<rect x="40" y="862" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="877" class="net-text" font-size="11">docker_socket_proxy_admin</text>
<text x="270" y="880" text-anchor="end" class="net-sub">10.0.18.0/24</text>
<text x="50" y="891" class="net-sub" font-size="8">→ admin overlay</text>
</g>
<g>
<rect x="40" y="902" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="917" class="net-text" font-size="11">docker_socket_proxy_socket_proxy</text>
<text x="270" y="920" text-anchor="end" class="net-sub">10.0.16.0/24</text>
<text x="50" y="931" class="net-sub" font-size="8">→ socket_proxy overlay</text>
</g>
<g>
<rect x="40" y="942" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="957" class="net-text" font-size="11">docker_socket_proxy_squid_egress</text>
<text x="270" y="960" text-anchor="end" class="net-sub">10.0.20.0/24</text>
<text x="50" y="971" class="net-sub" font-size="8">→ squid egress</text>
</g>
<g>
<rect x="40" y="982" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="997" class="net-text" font-size="11">docker_socket_proxy_hermes_proxy</text>
<text x="270" y="1000" text-anchor="end" class="net-sub">10.0.19.0/24</text>
<text x="50" y="1011" class="net-sub" font-size="8">→ hermes proxy</text>
</g>
<g>
<rect x="40" y="1022" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="1037" class="net-text" font-size="11">brencher_default</text>
<text x="270" y="1040" text-anchor="end" class="net-sub">10.0.7.0/24</text>
<text x="50" y="1051" class="net-sub" font-size="8">→ brencher_default</text>
</g>
<g>
<rect x="40" y="1062" width="280" height="34" rx="5" class="net-fill"/>
<text x="50" y="1077" class="net-text" font-size="11">brencher2_default</text>
<text x="270" y="1080" text-anchor="end" class="net-sub">10.0.1.0/24</text>
<text x="50" y="1091" class="net-sub" font-size="8">→ brencher2_default</text>
</g>
<!-- ============================================================== -->
<!-- LAN network (192.168.1.0/24) — between Keenetic and swarm hosts -->
<!-- RIGHT COLUMN: Stacks -->
<!-- ============================================================== -->
<text x="380" y="80" class="col-label">STACKS</text>
<!-- gitea -->
<g>
<rect x="40" y="180" width="240" height="500" rx="14" class="lan-fill" stroke-width="2"/>
<text x="160" y="208" text-anchor="middle" class="lan-label" font-size="13" font-weight="bold">lan</text>
<text x="160" y="226" text-anchor="middle" class="lan-text" font-size="10">192.168.1.0/24</text>
<rect x="380" y="100" width="1200" height="100" rx="8" class="stack-fill"/>
<text x="395" y="120" class="stack-text" font-size="14">gitea</text>
<text x="395" y="135" class="stack-sub">2 nodes · image: docker.gitea.com/gitea:1.27.0</text>
<g class="node-fill">
<rect x="395" y="148" width="540" height="42" rx="4"/>
<text x="408" y="163" class="node-text" font-size="11">gitea_server.1.fx8lrhxza6s7xhjeqr46oiioa</text>
<text x="408" y="178" class="node-text" font-size="9" fill="#67e8f9">10.0.0.235 ingress · 10.0.17.13 gitea_gitea · 10.0.3.134 nginx_ingress</text>
</g>
<g class="node-fill">
<rect x="950" y="148" width="615" height="42" rx="4"/>
<text x="963" y="163" class="node-text" font-size="11">gitea_runner.1.7qu01adpg71cpk5seaa22ve76</text>
<text x="963" y="178" class="node-text" font-size="9" fill="#67e8f9">10.0.0.6 ingress · gitea_gitea overlay</text>
</g>
</g>
<!-- Keenetic on LAN -->
<rect x="60" y="260" width="200" height="60" rx="6" class="ext-bg"/>
<text x="160" y="280" text-anchor="middle" class="title" font-size="11" font-weight="bold">Keenetic router</text>
<text x="160" y="295" text-anchor="middle" class="ext-text" font-size="9">DNS · Let's Encrypt · TLS termination</text>
<text x="160" y="308" text-anchor="middle" class="ext-text" font-size="9">192.168.1.1</text>
<!-- hermes -->
<g>
<rect x="380" y="210" width="1200" height="100" rx="8" class="stack-fill"/>
<text x="395" y="230" class="stack-text" font-size="14">hermes</text>
<text x="395" y="245" class="stack-sub">2 nodes · image: nousresearch/hermes-agent:...</text>
<g class="node-fill">
<rect x="395" y="258" width="580" height="42" rx="4"/>
<text x="408" y="273" class="node-text" font-size="11">hermes_hermes-agent.1.lbx30ov89d2nhukviexnb32sz</text>
<text x="408" y="288" class="node-text" font-size="9" fill="#67e8f9">10.0.0.204 ingress · hermes_hermes overlay</text>
</g>
<g class="node-fill">
<rect x="990" y="258" width="575" height="42" rx="4"/>
<text x="1003" y="273" class="node-text" font-size="11">hermes_hermes-gateway.1.4ceprn5xwyd1jdvxk7r5i9mde</text>
<text x="1003" y="288" class="node-text" font-size="9" fill="#67e8f9">10.0.0.204 ingress · hermes_hermes overlay</text>
</g>
</g>
<!-- Tailscale on LAN (subnet router running on odroid) -->
<rect x="60" y="350" width="200" height="55" rx="6" class="ext-bg"/>
<text x="160" y="370" text-anchor="middle" class="title" font-size="11" font-weight="bold">Tailscale subnet</text>
<text x="160" y="385" text-anchor="middle" class="ext-text" font-size="9">announces 192.168.1.0/24</text>
<text x="160" y="398" text-anchor="middle" class="ext-text" font-size="9">(runs on host 1)</text>
<!-- hermes_infra -->
<g>
<rect x="380" y="320" width="1200" height="130" rx="8" class="stack-fill"/>
<text x="395" y="340" class="stack-text" font-size="14">hermes_infra</text>
<text x="395" y="355" class="stack-sub">5 nodes · squid / sarg / hermes-ui / hermes-gateway / docker_socket_proxy</text>
<g class="node-fill">
<rect x="395" y="368" width="380" height="32" rx="4"/>
<text x="408" y="382" class="node-text" font-size="10">squid.1.l9zssq6kvlxwdw7ywlzri7miw</text>
<text x="408" y="395" class="node-text" font-size="9" fill="#67e8f9">.108 ingress · squid_egress</text>
</g>
<g class="node-fill">
<rect x="395" y="404" width="380" height="32" rx="4"/>
<text x="408" y="418" class="node-text" font-size="10">sarg.1.ucvl44g6djt49y4fgfydmia4y</text>
<text x="408" y="431" class="node-text" font-size="9" fill="#67e8f9">.107 ingress · hermes_infra_default</text>
</g>
<g class="node-fill">
<rect x="790" y="368" width="380" height="32" rx="4"/>
<text x="803" y="382" class="node-text" font-size="10">hermes-ui.1.8mohposymmwn3sxcrupcf2a4h</text>
<text x="803" y="395" class="node-text" font-size="9" fill="#67e8f9">.106 ingress · hermes_infra_default</text>
</g>
<g class="node-fill">
<rect x="790" y="404" width="380" height="32" rx="4"/>
<text x="803" y="418" class="node-text" font-size="10">hermes-gateway.1.vrbji4iqmw2e69zq1cbf2ooqb</text>
<text x="803" y="431" class="node-text" font-size="9" fill="#67e8f9">hermes_infra_hermes_proxy</text>
</g>
<g class="node-fill">
<rect x="1185" y="368" width="380" height="32" rx="4"/>
<text x="1198" y="382" class="node-text" font-size="10">docker_socket_proxy.1.h80ql7v0e...</text>
<text x="1198" y="395" class="node-text" font-size="9" fill="#67e8f9">tecnativa/docker-socket-proxy</text>
</g>
<g class="node-dead">
<rect x="1185" y="404" width="380" height="32" rx="4"/>
<text x="1198" y="418" class="node-dead-text" font-size="10">brencher-state-proxy.1.* (exited)</text>
<text x="1198" y="431" class="node-dead-text" font-size="9">nginx:alpine · dead · Replicas: 0</text>
</g>
</g>
<!-- Reachability annotations for LAN -->
<text x="60" y="430" class="reach-text">Reachability:</text>
<text x="60" y="445" class="reach-text">
<tspan class="reach-can">●</tspan> Client ⇄ Tailscale ⇄ Keenetic
</text>
<text x="60" y="460" class="reach-text">
<tspan class="reach-can">●</tspan> Keenetic ⇄ host 1 (odroid):443
</text>
<text x="60" y="475" class="reach-text">
<tspan class="reach-can">●</tspan> host 1 (odroid) ⇄ host 2 (xu4)
</text>
<text x="60" y="490" class="reach-text">
<tspan class="reach-can">●</tspan> Tailscale ⇄ host 1 (odroid)
</text>
<text x="60" y="510" class="reach-text">
<tspan class="reach-can">●</tspan> ANY stack ⇄ ANY stack (overlay mesh)
</text>
<text x="60" y="528" class="reach-text">
<tspan class="reach-no">●</tspan> Client ❌ host 2 direct (no route)
</text>
<text x="60" y="546" class="reach-text">
<tspan class="reach-no">●</tspan> Client ❌ gitea:3000 (no port forward)
</text>
<text x="60" y="562" class="reach-text">
<tspan class="reach-can">●</tspan> ANY stack ⇄ Keenetic (LAN gw)
</text>
<text x="60" y="582" class="reach-text">
<tspan class="reach-can">●</tspan> ANY stack ⇄ Tailscale (via host 1)
</text>
<text x="60" y="598" class="reach-text">
<tspan class="reach-no">●</tspan> gitea ❌ nginx_nginx (dead, no flow)
</text>
<text x="60" y="618" class="reach-text">
<tspan class="reach-can">●</tspan> brencher ⇄ admin/ansible git (git pull)
</text>
<text x="60" y="638" class="reach-text">
<tspan class="reach-can">●</tspan> stacks ⇄ external DNS via Keenetic
</text>
<text x="60" y="658" class="reach-text">
<tspan class="reach-can">●</tspan> brencher ⇄ stacks (deploys via docker socket)
</text>
<!-- immich -->
<g>
<rect x="380" y="460" width="1200" height="130" rx="8" class="stack-fill"/>
<text x="395" y="480" class="stack-text" font-size="14">immich</text>
<text x="395" y="495" class="stack-sub">4 nodes · server / database / redis / machine-learning</text>
<g class="node-fill">
<rect x="395" y="508" width="280" height="32" rx="4"/>
<text x="408" y="522" class="node-text" font-size="10">immich_server.1.a83c7oac6f4ukkzhae1tsj2ym</text>
<text x="408" y="535" class="node-text" font-size="9" fill="#67e8f9">.225 ingress · 10.0.2.0/24</text>
</g>
<g class="node-fill">
<rect x="690" y="508" width="280" height="32" rx="4"/>
<text x="703" y="522" class="node-text" font-size="10">immich_database.1.lstdz3kkogsrcg7vx7sae6rfa</text>
<text x="703" y="535" class="node-text" font-size="9" fill="#67e8f9">.13 ingress · 10.0.2.0/24</text>
</g>
<g class="node-fill">
<rect x="985" y="508" width="280" height="32" rx="4"/>
<text x="998" y="522" class="node-text" font-size="10">immich_redis.1.85hnh4elu9xxl9jcs64v4u0u2</text>
<text x="998" y="535" class="node-text" font-size="9" fill="#67e8f9">.11 ingress · 10.0.2.0/24</text>
</g>
<g class="node-fill">
<rect x="1280" y="508" width="285" height="32" rx="4"/>
<text x="1293" y="522" class="node-text" font-size="10">immich_machine-learning.1.wnkv2...</text>
<text x="1293" y="535" class="node-text" font-size="9" fill="#67e8f9">.11 ingress · 10.0.2.0/24</text>
</g>
</g>
<!-- brencher -->
<g>
<rect x="380" y="600" width="1200" height="60" rx="8" class="stack-fill"/>
<text x="395" y="620" class="stack-text" font-size="14">brencher</text>
<text x="395" y="635" class="stack-sub">deploy tool · 1 node</text>
<g class="node-fill">
<rect x="395" y="640" width="1170" height="14" rx="3"/>
<text x="408" y="651" class="node-text" font-size="9" fill="#67e8f9">brencher_brencher-backend.1.vdeqwr97iafplzieas71sq55a · .105 ingress · brencher_brencher-net · /var/run/docker.sock bind mount (deploys all stacks)</text>
</g>
</g>
<!-- brencher2 -->
<g>
<rect x="380" y="670" width="1200" height="60" rx="8" class="stack-fill"/>
<text x="395" y="690" class="stack-text" font-size="14">brencher2</text>
<text x="395" y="705" class="stack-sub">deploy tool · 1 node</text>
<g class="node-fill">
<rect x="395" y="710" width="1170" height="14" rx="3"/>
<text x="408" y="721" class="node-text" font-size="9" fill="#67e8f9">brencher2_brencher-backend.1.ma4m7uabhe5lckk0fktaicf19 · .102 ingress · brencher2_brencher-net · /var/run/docker.sock bind mount</text>
</g>
</g>
<!-- gmail_mcp -->
<g>
<rect x="380" y="740" width="1200" height="100" rx="8" class="stack-fill"/>
<text x="395" y="760" class="stack-text" font-size="14">gmail_mcp</text>
<text x="395" y="775" class="stack-sub">2 nodes · gmail + telegram MCP servers</text>
<g class="node-fill">
<rect x="395" y="788" width="580" height="42" rx="4"/>
<text x="408" y="803" class="node-text" font-size="11">gmail_mcp_gmail-mcp-server.1.wxhzdnibwssve5trbwffzyzpu</text>
<text x="408" y="818" class="node-text" font-size="9" fill="#67e8f9">.10 ingress · gmail_mcp_default</text>
</g>
<g class="node-fill">
<rect x="990" y="788" width="575" height="42" rx="4"/>
<text x="1003" y="803" class="node-text" font-size="11">gmail_mcp_telegram-mcp-server.1.yehnql7ova2a65s6d6wly5y6m</text>
<text x="1003" y="818" class="node-text" font-size="9" fill="#67e8f9">.6 ingress · gmail_mcp_default</text>
</g>
</g>
<!-- torrserv_proxy -->
<g>
<rect x="380" y="850" width="1200" height="100" rx="8" class="stack-fill"/>
<text x="395" y="870" class="stack-text" font-size="14">torrserv_proxy</text>
<text x="395" y="885" class="stack-sub">2 nodes · reverseproxy + fileserver</text>
<g class="node-fill">
<rect x="395" y="898" width="580" height="42" rx="4"/>
<text x="408" y="913" class="node-text" font-size="11">torrserv_proxy_reverseproxy.1.r906zcw2jyny6g6w56an1u193</text>
<text x="408" y="928" class="node-text" font-size="9" fill="#67e8f9">.15 ingress · torrserv_proxy_default · cache registry.rudolf.keenetic.link</text>
</g>
<g class="node-fill">
<rect x="990" y="898" width="575" height="42" rx="4"/>
<text x="1003" y="913" class="node-text" font-size="11">torrserv_proxy_fileserver.1.zrum9hzhght93z9yxv0ae7hbs</text>
<text x="1003" y="928" class="node-text" font-size="9" fill="#67e8f9">.12 ingress · python:3.11-slim</text>
</g>
</g>
<!-- nginx (dead) -->
<g>
<rect x="380" y="960" width="1200" height="60" rx="8" class="node-dead" stroke-width="1.5"/>
<text x="395" y="980" class="node-dead-text" font-size="14">nginx (dead)</text>
<text x="395" y="995" class="node-dead-text" font-size="9">Replicas: 0 · networks есть, контейнеров нет</text>
<g class="node-dead">
<rect x="395" y="1000" width="580" height="14" rx="3"/>
<text x="408" y="1011" class="node-dead-text" font-size="9">nginx_nginx (jwilder/nginx-proxy:latest)</text>
</g>
<g class="node-dead">
<rect x="990" y="1000" width="575" height="14" rx="3"/>
<text x="1003" y="1011" class="node-dead-text" font-size="9">nginx_nginx_acme (nginxproxy/acme-companion:latest)</text>
</g>
</g>
<!-- photosHelper, docker_socket_proxy (other stacks) -->
<g>
<rect x="380" y="1030" width="1200" height="60" rx="8" class="stack-fill"/>
<text x="395" y="1050" class="stack-text" font-size="14">photosHelper</text>
<text x="395" y="1065" class="stack-sub">1 node · photo backup helper</text>
<g class="node-fill">
<rect x="395" y="1070" width="1170" height="14" rx="3"/>
<text x="408" y="1081" class="node-text" font-size="9" fill="#67e8f9">photosHelper_nfs_crypt · .9 ingress · photosHelper_default · 10.0.9.0/24</text>
</g>
</g>
<g>
<rect x="380" y="1100" width="1200" height="60" rx="8" class="stack-fill"/>
<text x="395" y="1120" class="stack-text" font-size="14">docker_socket_proxy (standalone)</text>
<text x="395" y="1135" class="stack-sub">1 node · sidecar for hermes-gateway</text>
<g class="node-fill">
<rect x="395" y="1140" width="1170" height="14" rx="3"/>
<text x="408" y="1151" class="node-text" font-size="9" fill="#67e8f9">docker_socket_proxy_hermes-gateway.1.kb09yigdxe9i7yqk9m0ecu2h5 · nousresearch/hermes-agent:v2026.8.3 · docker_socket_proxy_default 10.0.21.0/24</text>
</g>
</g>
<g>
<rect x="380" y="1170" width="1200" height="60" rx="8" class="node-fill" stroke-dasharray="3 2"/>
<text x="395" y="1190" class="node-text" font-size="14" font-style="italic">lampa-jackett (standalone, не swarm)</text>
<text x="395" y="1205" class="node-text" font-size="9" fill="#94a3b8">1 node · port 9117:9117 на хосте (не swarm)</text>
</g>
<!-- ============================================================== -->
<!-- Cluster (swarm hosts) -->
<!-- Connector lines: networks (left) to stacks (right) -->
<!-- ============================================================== -->
<rect x="320" y="80" width="1060" height="800" rx="14" fill="none" stroke="#fbbf24" stroke-dasharray="8 4"/>
<text x="850" y="105" text-anchor="middle" class="lan-label" font-size="12" font-weight="bold">DOCKER SWARM CLUSTER</text>
<!-- lan → stacks via ingress (everyone on ingress) -->
<line x1="320" y1="125" x2="380" y2="148" class="arrow-lan" stroke-width="1" marker-end="url(#a-lan)" stroke-opacity="0.3"/>
<!-- ===== Host 1: odroid ===== -->
<!-- ingress → all stacks (just visual hint) -->
<line x1="320" y1="180" x2="380" y2="148" class="arrow-net" stroke-width="0.5" marker-end="url(#a-net)" stroke-opacity="0.3"/>
<!-- brencher deploys → all stacks -->
<line x1="395" y1="654" x2="380" y2="600" class="arrow-deploy" stroke-width="1" marker-end="url(#a-deploy)" stroke-opacity="0.5"/>
<line x1="395" y1="654" x2="380" y2="460" class="arrow-deploy" stroke-width="1" marker-end="url(#a-deploy)" stroke-opacity="0.5"/>
<line x1="395" y1="654" x2="380" y2="320" class="arrow-deploy" stroke-width="1" marker-end="url(#a-deploy)" stroke-opacity="0.5"/>
<line x1="395" y1="724" x2="380" y2="600" class="arrow-deploy" stroke-width="1" marker-end="url(#a-deploy)" stroke-opacity="0.3"/>
<!-- ============================================================== -->
<!-- LEGEND (bottom-left, small) -->
<!-- ============================================================== -->
<g>
<rect x="340" y="130" width="510" height="500" rx="10" class="node-fill" stroke-width="2"/>
<rect x="40" y="1240" width="600" height="130" rx="8" class="stack-fill" stroke="#22d3ee"/>
<text x="55" y="1262" class="col-label">LEGEND</text>
<!-- Yellow numbered circle for the physical host -->
<circle cx="370" cy="160" r="18" class="host-circle"/>
<text x="370" y="166" text-anchor="middle" class="host-text" font-size="18">1</text>
<rect x="55" y="1275" width="30" height="16" rx="3" class="net-external-fill"/>
<text x="95" y="1288" class="legend-text" font-size="10">external network (lan)</text>
<text x="585" y="158" text-anchor="middle" class="node-text" font-size="13" font-weight="bold">odroid (manager)</text>
<text x="585" y="174" text-anchor="middle" class="node-text" font-size="10">192.168.1.96 · arm64 · Linux 5.15</text>
<text x="585" y="188" text-anchor="middle" class="node-text" font-size="9">j9bljgaqh9qc · 192.168.1.96:443 (Keenetic TLS term target)</text>
<rect x="55" y="1296" width="30" height="16" rx="3" class="net-fill"/>
<text x="95" y="1309" class="legend-text" font-size="10">overlay network</text>
<!-- ingress -->
<rect x="360" y="210" width="160" height="50" rx="6" class="edge-fill"/>
<text x="440" y="230" text-anchor="middle" class="edge-text" font-size="11" font-weight="bold">swarm ingress</text>
<text x="440" y="245" text-anchor="middle" class="edge-text" font-size="9">10.0.0.2</text>
<text x="440" y="256" text-anchor="middle" class="edge-text" font-size="8">(routing mesh)</text>
<rect x="220" y="1275" width="30" height="16" rx="3" class="stack-fill"/>
<text x="260" y="1288" class="legend-text" font-size="10">stack (running)</text>
<!-- Stacks row 1 -->
<rect x="360" y="280" width="140" height="78" rx="6" class="stack-fill"/>
<text x="430" y="301" text-anchor="middle" class="stack-text" font-weight="bold">gitea</text>
<text x="430" y="316" text-anchor="middle" class="stack-text" font-size="9">server · runner</text>
<text x="430" y="329" text-anchor="middle" class="stack-text" font-size="9">.235 / .17.13</text>
<text x="430" y="342" text-anchor="middle" class="stack-text" font-size="9">.3.134</text>
<rect x="220" y="1296" width="30" height="16" rx="3" class="node-dead"/>
<text x="260" y="1309" class="legend-text" font-size="10">dead / disabled</text>
<rect x="510" y="280" width="140" height="78" rx="6" class="stack-fill"/>
<text x="580" y="301" text-anchor="middle" class="stack-text" font-weight="bold">hermes</text>
<text x="580" y="316" text-anchor="middle" class="stack-text" font-size="9">agent · gateway</text>
<text x="580" y="329" text-anchor="middle" class="stack-text" font-size="9">.204</text>
<text x="580" y="342" text-anchor="middle" class="stack-text" font-size="9">.11.x</text>
<rect x="400" y="1275" width="30" height="16" rx="3" class="node-fill"/>
<text x="440" y="1288" class="legend-text" font-size="10">node (container)</text>
<rect x="660" y="280" width="170" height="78" rx="6" class="stack-fill"/>
<text x="745" y="301" text-anchor="middle" class="stack-text" font-weight="bold">hermes_infra</text>
<text x="745" y="313" text-anchor="middle" class="stack-text" font-size="8">squid · sarg · ui</text>
<text x="745" y="324" text-anchor="middle" class="stack-text" font-size="8">docker_proxy</text>
<text x="745" y="335" text-anchor="middle" class="stack-text" font-size="8">brencher-state</text>
<text x="745" y="348" text-anchor="middle" class="stack-text" font-size="9">.106-108</text>
<rect x="400" y="1296" width="30" height="2" fill="#f59e0b"/>
<text x="440" y="1309" class="legend-text" font-size="10">LAN traffic (amber)</text>
<!-- Stacks row 2 -->
<rect x="360" y="370" width="140" height="68" rx="6" class="stack-fill"/>
<text x="430" y="391" text-anchor="middle" class="stack-text" font-weight="bold">brencher</text>
<text x="430" y="406" text-anchor="middle" class="stack-text" font-size="9">+ brencher2</text>
<text x="430" y="419" text-anchor="middle" class="stack-text" font-size="9">deploy tools</text>
<text x="430" y="432" text-anchor="middle" class="stack-text" font-size="9">.105 / .102</text>
<line x1="55" y1="1330" x2="85" y2="1330" class="arrow-net" stroke-width="1" marker-end="url(#a-net)"/>
<text x="95" y="1334" class="legend-text" font-size="10">solid = reach</text>
<rect x="510" y="370" width="140" height="68" rx="6" class="stack-fill"/>
<text x="580" y="391" text-anchor="middle" class="stack-text" font-weight="bold">gmail_mcp</text>
<text x="580" y="406" text-anchor="middle" class="stack-text" font-size="9">gmail + telegram</text>
<text x="580" y="419" text-anchor="middle" class="stack-text" font-size="9">MCP servers</text>
<text x="580" y="432" text-anchor="middle" class="stack-text" font-size="9">.6 / .10</text>
<line x1="220" y1="1330" x2="250" y2="1330" class="arrow-deploy" stroke-width="1.5" marker-end="url(#a-deploy)"/>
<text x="260" y="1334" class="legend-text" font-size="10">dashed rose = deploy / dead</text>
<rect x="660" y="370" width="170" height="68" rx="6" class="stack-fill"/>
<text x="745" y="391" text-anchor="middle" class="stack-text" font-weight="bold">torrserv_proxy</text>
<text x="745" y="406" text-anchor="middle" class="stack-text" font-size="9">reverseproxy</text>
<text x="745" y="419" text-anchor="middle" class="stack-text" font-size="9">fileserver</text>
<text x="745" y="432" text-anchor="middle" class="stack-text" font-size="9">.15 / .12</text>
<!-- Dead nginx -->
<rect x="360" y="455" width="470" height="55" rx="6" class="dead-fill" stroke-width="1.5" stroke-dasharray="6 3"/>
<text x="595" y="476" text-anchor="middle" class="dead-text" font-size="12" font-weight="bold">nginx_nginx (dead)</text>
<text x="595" y="491" text-anchor="middle" class="dead-text" font-size="9">jwilder/nginx-proxy · Replicas: 0</text>
<text x="595" y="504" text-anchor="middle" class="dead-text" font-size="9">overlay-сеть nginx_ingress (10.0.3.0/24) жива, контейнеров нет</text>
<!-- Tailscale (host 1) -->
<rect x="360" y="525" width="470" height="50" rx="6" fill="none" stroke="#94a3b8" stroke-dasharray="3 3"/>
<text x="595" y="544" text-anchor="middle" class="ext-text" font-size="11" font-weight="bold">Tailscale daemon (хост 1)</text>
<text x="595" y="558" text-anchor="middle" class="ext-text" font-size="9">advertises 192.168.1.0/24 как subnet router</text>
<text x="595" y="570" text-anchor="middle" class="ext-text" font-size="9">100.x.x.x для tailscale-клиентов вне LAN</text>
</g>
<!-- ===== Host 2: xu4 ===== -->
<g>
<rect x="870" y="130" width="490" height="500" rx="10" class="node-fill" stroke-width="2"/>
<!-- Yellow numbered circle -->
<circle cx="900" cy="160" r="18" class="host-circle"/>
<text x="900" y="166" text-anchor="middle" class="host-text" font-size="18">2</text>
<text x="1115" y="158" text-anchor="middle" class="node-text" font-size="13" font-weight="bold">xu4 (worker)</text>
<text x="1115" y="174" text-anchor="middle" class="node-text" font-size="10">id=u2ynmimtl0lu</text>
<text x="1115" y="188" text-anchor="middle" class="node-text" font-size="9">tasks: пусто в снапшоте 2026-08-27</text>
<rect x="900" y="210" width="430" height="410" rx="6" fill="none" stroke="#fbbf24" stroke-dasharray="4 2"/>
<text x="1115" y="240" text-anchor="middle" class="node-text" font-size="11" font-weight="bold">worker tasks</text>
<text x="1115" y="258" text-anchor="middle" class="node-text" font-size="10">ожидаются будущие сервисы</text>
<text x="1115" y="278" text-anchor="middle" class="node-text" font-size="9">.5-6 (например brencher_local2)</text>
<text x="1115" y="295" text-anchor="middle" class="node-text" font-size="9">.2 (например immich ml сейчас тут?)</text>
</g>
<!-- ===== Inter-host link (odroid <-> xu4) ===== -->
<line x1="850" y1="380" x2="870" y2="380" stroke="#fbbf24" stroke-width="2" stroke-dasharray="6 3"/>
<text x="860" y="372" text-anchor="middle" class="lan-text" font-size="9">↔ swarm</text>
<text x="860" y="394" text-anchor="middle" class="lan-text" font-size="9">manager-worker</text>
<!-- ============================================================== -->
<!-- Arrows: traffic flows with reachability -->
<!-- ============================================================== -->
<!-- Client → Tailscale (subnet) -->
<path d="M 130 122 Q 130 150 130 180" fill="none" class="arrow" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="138" y="148" class="legend-text" font-size="9">https</text>
<!-- Tailscale subnet → Keenetic (within LAN, traffic goes through Keenetic for TLS) -->
<line x1="220" y1="290" x2="220" y2="335" class="arrow-lan" stroke-width="1.5" marker-end="url(#arrow-lan)"/>
<!-- Keenetic → odroid (LAN host 1) -->
<line x1="260" y1="290" x2="340" y2="220" class="arrow-lan" stroke-width="2" marker-end="url(#arrow-lan)"/>
<text x="270" y="240" class="reach-text">TLS term →</text>
<text x="270" y="252" class="reach-text">plain HTTP</text>
<!-- odroid → xu4 (manager-worker) -->
<line x1="850" y1="220" x2="870" y2="220" class="arrow" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow)"/>
<text x="860" y="212" text-anchor="middle" class="legend-text" font-size="9">swarm</text>
<!-- ingress → stacks (on odroid) -->
<line x1="440" y1="260" x2="430" y2="280" class="arrow" stroke-width="1.5" marker-end="url(#arrow)"/>
<line x1="440" y1="260" x2="580" y2="280" class="arrow" stroke-width="1" stroke-opacity="0.4" marker-end="url(#arrow)"/>
<line x1="440" y1="260" x2="745" y2="280" class="arrow" stroke-width="1" stroke-opacity="0.4" marker-end="url(#arrow)"/>
<!-- ingress → xu4 (cross-node) -->
<line x1="510" y1="240" x2="900" y2="240" class="arrow" stroke-width="1" stroke-opacity="0.4" stroke-dasharray="3 3" marker-end="url(#arrow)"/>
<text x="700" y="234" text-anchor="middle" class="reach-text" font-size="9">cross-node via swarm mesh (если бы task был на xu4)</text>
<!-- brencher → stacks (deploy flow) -->
<line x1="430" y1="370" x2="430" y2="358" class="arrow-d" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow-d)"/>
<!-- ============================================================== -->
<!-- LEGEND -->
<!-- ============================================================== -->
<g id="legend">
<rect x="40" y="700" width="240" height="220" rx="10" class="lan-fill" stroke="#f59e0b"/>
<text x="60" y="725" class="lan-label" font-size="12" font-weight="bold">LEGEND</text>
<!-- Host circle -->
<circle cx="65" cy="748" r="13" class="host-circle"/>
<text x="65" y="754" text-anchor="middle" class="host-text" font-size="13">1</text>
<text x="90" y="753" class="legend-text" font-size="10">физический хост (N=odroid, 2=xu4)</text>
<!-- lan -->
<rect x="50" y="765" width="30" height="14" rx="3" class="lan-fill" stroke="#f59e0b"/>
<text x="90" y="776" class="legend-text" font-size="10">сеть lan (192.168.1.0/24)</text>
<!-- node -->
<rect x="50" y="784" width="30" height="14" rx="3" class="node-fill"/>
<text x="90" y="795" class="legend-text" font-size="10">swarm node (физический хост)</text>
<!-- stack -->
<rect x="50" y="803" width="30" height="14" rx="3" class="stack-fill"/>
<text x="90" y="814" class="legend-text" font-size="10">stack (running service)</text>
<!-- edge -->
<rect x="50" y="822" width="30" height="14" rx="3" class="edge-fill"/>
<text x="90" y="833" class="legend-text" font-size="10">routing mesh / ingress</text>
<!-- dead -->
<rect x="50" y="841" width="30" height="14" rx="3" class="dead-fill" stroke-dasharray="3 2"/>
<text x="90" y="852" class="legend-text" font-size="10">dead / disabled service</text>
<!-- arrows -->
<line x1="50" y1="868" x2="80" y2="868" class="arrow" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="90" y="872" class="legend-text" font-size="10">solid = reach / flow</text>
<line x1="50" y1="884" x2="80" y2="884" class="arrow-d" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow-d)"/>
<text x="90" y="888" class="legend-text" font-size="10">dashed rose = deploy / dead</text>
<line x1="50" y1="900" x2="80" y2="900" class="arrow-lan" stroke-width="1.5" marker-end="url(#arrow-lan)"/>
<text x="90" y="904" class="legend-text" font-size="10">amber = LAN traffic</text>
<line x1="400" y1="1330" x2="430" y2="1330" class="arrow-lan" stroke-width="1.5" marker-end="url(#a-lan)"/>
<text x="440" y="1334" class="legend-text" font-size="10">amber = LAN</text>
</g>
<!-- Footer -->
<text x="40" y="940" class="footer" font-size="10">
adaptive SVG · prefers-color-scheme: light/dark · open standalone-adaptive.svg directly in browser · snapshot 2026-08-27
<text x="40" y="1390" class="footer" font-size="10">
snapshot 2026-08-27 · 22 networks · 11+ stacks · snapshot via docker_socket_proxy + gitea admin API
</text>
</svg>

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 26 KiB

-55
View File
@@ -1,55 +0,0 @@
# Production architecture (adaptive SVG variant)
> **Финальный вариант** — один SVG с автоматической адаптацией тёмной/светлой темы.
> Рендерится inline в Gitea preview, читается везде.
## Диаграмма
![Production architecture (adaptive)](./standalone-adaptive.svg)
## Что показывает
- **Сеть `lan`** (192.168.1.0/24) — отдельный amber-bordered блок, соединяет Keenetic с физическими хостами
- **Жёлтые кружки с цифрами** на каждом физическом хосте:
- **① odroid** (manager) — id `j9bljgaqh9qc`, 192.168.1.96, arm64
- **② xu4** (worker) — id `u2ynmimtl0lu`, пуст в снапшоте
- **6 стеков на odroid** (gitea, hermes, hermes_infra, immich, brencher, gmail_mcp, torrserv_proxy) + dead `nginx_nginx` (Replicas=0)
- **Reachability** — кто кого видит (зелёные ● = да, красные ● = нет), с конкретными flow'ами:
- Client ⇄ Tailscale ⇄ Keenetic
- Keenetic ⇄ odroid:443 (TLS term target)
- odroid ⇄ xu4 (swarm manager-worker)
- **Cross-node** через swarm mesh (если бы task был на xu4)
- **Brake:** gitea ❌ nginx_nginx (dead, нет flow)
- **Brake:** Client ❌ gitea:3000 напрямую (нет port forwarding)
## Как читать
1. **Слева** — `lan` блок (amber) с Keenetic и Tailscale subnet router
2. **В центре** — `odroid (①)` со всеми стеками
3. **Справа** — `xu4 (②)` (пустой, готов принимать tasks)
4. **Жёлтые стрелки (amber)** = LAN трафик, **белые сплошные** = reach, **розовые dashed** = deploy / dead
## Reachability легенда
Зелёная `●` = "видит и может связаться", красная `●` = "не видит / нет маршрута".
## Как проверить light theme
Открой [`./standalone-adaptive.svg`](./standalone-adaptive.svg) напрямую в браузере, переключи тему:
- **Chrome/Edge:** DevTools → Rendering → "Emulate CSS prefers-color-scheme"
- **Firefox:** `about:config` → `ui.systemUsesDarkTheme`
## Файлы в этой папке
| Файл | Что это |
|---|---|
| `standalone-adaptive.svg` | Собственно SVG (single file, адаптивный) |
| `svg-adaptive.md` | Этот файл — обёртка с описанием |
| `README.md` | История решений, что было отброшено |
## Связанные
- `admin/ansible#5` — re-deploy `hermes_squid`
- `admin/ansible#6` — pre-create `socket_proxy` overlay
- `admin/ansible#7` — gitea stack deploy / app.ini fix