docs: add production architecture diagram in three formats

- README.md explains what's shown vs not, known TODOs, when to pick which
- mermaid.md: Mermaid flowchart, renders inline in Gitea PR preview
- standalone.svg: raw SVG, embeddable as image in any README/wiki
- standalone.html: HTML wrapper with dark theme + summary cards

All three show the same graph:
- 2 swarm nodes (odroid manager, xu4 worker)
- 7 stacks on odroid: gitea, hermes, hermes_infra, immich, brencher,
  brencher2, gmail_mcp, torrserv_proxy
- external: Keenetic router, Tailscale subnet, Client
- dead: nginx_nginx (Replicas=0)
- deploy flow: brencher -> stacks

Snapshot 2026-08-27, sources: docker_socket_proxy + gitea admin API
This commit is contained in:
hermes
2026-08-27 11:57:44 +00:00
parent 4cb8eeae35
commit 793908ae14
4 changed files with 695 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
# Production architecture
Три варианта одной диаграммы продакшна. Выбери удобный и оставь только его (или предложи другой).
> **Snapshot:** 2026-08-27
> **Sources:** `docker_socket_proxy` (read-only) + gitea admin API + gitea_server logs
> **Один и тот же граф**, разные форматы.
## Что показывает
- 2 swarm nodes: **odroid** (manager, 192.168.1.96) и **xu4** (worker, пуст в снапшоте)
- 7 stacks на odroid: gitea, hermes, hermes_infra, immich, brencher, brencher2, gmail_mcp, torrserv_proxy
- External: Keenetic router (DNS + Let's Encrypt TLS termination), Tailscale (subnet router — транспорт), Client
- Dead component: `nginx_nginx` (jwilder/nginx-proxy, Replicas=0)
- Deploy flow: brencher → стеки
## Что НЕ показывает (для следующих уровней)
- Каждый отдельный контейнер и его IP в overlay-сетях
- Volume mounts и где лежат данные (особенно `gitea_data` NFS на 192.168.1.96)
- Swarm secrets (LFS_JWT_SECRET, JWT_SECRET, INTERNAL_TOKEN)
- DNS-резолвинг детально (search `anoa-bebop.ts.net`, ExtServers 192.168.1.1)
- Traffic flow конкретных сервисов (gmail MCP, immich ML pipeline и т.д.)
## Известные неточности (TODO перед фиксацией)
1. `endpoint.Ports` у gitea_server пустое, но ingress маршрутизирует — legacy endpoint или ручной `docker service update --publish-add`.
2. `xu4` worker пуст в снапшоте — перепроверить перед merge.
3. `nginx_nginx` Replicas=0 — dead, но overlay-сеть `nginx_ingress` (10.0.3.0/24) жива.
4. Tailscale роль — subnet router (подтверждено), но MagicDNS для `rudolf.keenetic.link` неизвестно.
5. brencher-stack-compose для каждого стека отсутствует в `admin/ansible` (только `poc/*`) — долг.
## Варианты
| Файл | Формат | Где рендерится | Плюсы | Минусы |
|---|---|---|---|---|
| `mermaid.md` | Markdown + Mermaid | Gitea UI, PR preview, любой MD-рендерер | Diff-friendly, версионируется, не требует внешних тулзов | Стиль спартанский, нет полного layout-control |
| `standalone.svg` | Raw SVG | Браузер, можно вставить в README/wiki/slack | Single file, no deps, точный layout | Ручная правка, нет динамики |
| `standalone.html` | HTML + inline SVG + dark theme | Браузер | Красиво (pulsing dot, summary cards), single file, no JS | Не рендерится в Gitea preview, нужен браузер |
## Какой выбрать
**Если важно версионировать и видеть diff в PR** → `mermaid.md`. Он рендерится прямо в Gitea.
**Если важно показать всем (внешним людям, в презентации, в slack)** → `standalone.html`. Открывается в браузере, выглядит презентабельно.
**Если нужен в README.md файле как изображение** → `standalone.svg`. Вставляется как `![arch](docs/architecture/standalone.svg)`.
## Связанные тикеты
- `admin/ansible#7` — gitea stack actually deploys (RCA для og:url warning)
- `admin/ansible#5` — re-deploy `hermes_squid` from feat/docker-socket-proxy-readonly
- `admin/ansible#6` — pre-create `socket_proxy` overlay network
## Следующие уровни (если зайдёт этот стиль)
- **Level 2 — Network diagram:** все 22 overlay-сети, какие контейнеры в каких, IP-адреса
- **Level 3 — Service topology:** gitea stack целиком (server + runner + volumes + secrets + DB)
- **Level 4 — Deploy flow:** brencher → git pull → docker stack deploy → brencher-state-proxy отчёт
- **Level 5 — Secrets/Vault:** где лежат LFS_JWT_SECRET, JWT_SECRET, gmail token, registry auth
## Редактирование
Все три файла можно править руками:
- `mermaid.md` — поменять Mermaid-блок
- `standalone.svg` — поменять `<rect>`, `<text>`, `<path>`
- `standalone.html` — поменять CSS или SVG-блок
После правок пересмотри в браузере. Когда устаканится — коммить в `docs/architecture/` этого репо.
+89
View File
@@ -0,0 +1,89 @@
# Production architecture — variant 1: Mermaid
> **Формат:** Mermaid внутри Markdown. Рендерится прямо в Gitea (preview в PR, page view).
> Diff-friendly, версионируется вместе с кодом, не требует внешних тулзов.
## Level 1: Cluster overview
```mermaid
flowchart TB
Client(["Client<br/>из tailscale-сети"])
subgraph EXT["External (LAN 192.168.1.0/24)"]
Keenetic["Keenetic router<br/>192.168.1.1<br/>DNS + Let's Encrypt<br/>TLS termination"]
Tailscale["Tailscale<br/>subnet router на odroid<br/>только транспорт"]
end
subgraph SWARM["Docker Swarm cluster"]
subgraph ODROID["Node: odroid (manager)<br/>192.168.1.96 · arm64 · Linux 5.15"]
direction TB
Ingress["swarm ingress-endpoint<br/>10.0.0.2<br/>(routing mesh)"]
subgraph STACKS["Stacks"]
direction LR
Gitea["gitea stack<br/>gitea_server (3000)<br/>gitea_runner<br/>gitea_gitea 10.0.17/24"]
Hermes["hermes stack<br/>hermes-agent<br/>hermes-gateway"]
HermesInfra["hermes_infra stack<br/>squid · sarg · hermes-ui<br/>docker_socket_proxy<br/>brencher-state-proxy"]
Immich["immich stack<br/>server · db · redis · ml<br/>10.0.2.0/24"]
Brencher["brencher · brencher2<br/>deploy tools"]
GmailMCP["gmail_mcp<br/>gmail + telegram MCP"]
Torrserv["torrserv_proxy<br/>reverseproxy · fileserver"]
end
NginxDead["nginx_nginx<br/>jwilder/nginx-proxy<br/>Replicas: 0 (dead)"]
end
subgraph XU4["Node: xu4 (worker)"]
Worker["worker tasks<br/>(пусто в снапшоте)"]
end
end
Client -->|"https://gitea.rudolf.keenetic.link<br/>(tailscale subnet)"| Tailscale
Tailscale -->|"HTTPS"| Keenetic
Keenetic -->|"plain HTTP после TLS term"| Ingress
Ingress -->|"swarm routing<br/>(endpoint.Ports stale)"| Gitea
Ingress --> Immich
Ingress --> Hermes
NginxDead -.->|"сеть есть<br/>контейнеров нет"| Ingress
Brencher -.->|"deploys"| Gitea
Brencher -.->|"deploys"| Immich
Brencher -.->|"deploys"| HermesInfra
classDef external fill:#1e293b,stroke:#94a3b8,color:#e2e8f0
classDef node fill:#0f172a,stroke:#fbbf24,color:#fef3c7
classDef stack fill:#0c4a6e,stroke:#22d3ee,color:#cffafe
classDef dead fill:#1f1717,stroke:#fb7185,color:#fecaca,stroke-dasharray: 4 4
classDef edge fill:#064e3b,stroke:#34d399,color:#d1fae5
class Client,Keenetic,Tailscale external
class ODROID,XU4 node
class STACKS stack
class Gitea,Hermes,HermesInfra,Immich,Brencher,GmailMCP,Torrserv stack
class NginxDead dead
class Ingress edge
```
## Плюсы / минусы
**+** Рендерится в Gitea сразу, без дополнительных инструментов.
**+** Plain text, mergeable, diff-friendly.
**+** Легко править — текстовый формат.
**+** Gitea поддерживает `classDef`, subgraphs, разные стрелки.
**-** Стиль Mermaid спартанский (не dark theme by default — нужны `classDef`).
**-** Большие графы плохо помещаются в PR preview.
**-** Сложные layout-ы (force-directed) не поддерживаются.
## Известные неточности в данных
1. `endpoint.Ports` у gitea_server пустое, но ingress маршрутизирует — legacy endpoint или ручной `service update --publish-add`.
2. `xu4` worker пуст в снапшоте 2026-08-27 — перепроверить перед фиксацией.
3. `nginx_nginx` Replicas=0 — "dead" блок показан отдельно.
4. Tailscale роль: subnet router (транспорт), не MagicDNS — но это требует подтверждения.
## Связанные файлы
- `standalone.svg` — тот же граф в raw SVG (вариант 2)
- `standalone.html` — тот же граф в HTML-обёртке (вариант 3)
- `../README.md` — обзор всех вариантов
+304
View File
@@ -0,0 +1,304 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Production architecture · Cluster overview</title>
<style>
/* No external dependencies, no JS. Single file.
Open in any browser, share as-is, embed in docs. */
:root {
--bg: #020617;
--fg: #e2e8f0;
--muted: #94a3b8;
--external-fill: rgba(30, 41, 59, 0.5);
--external-stroke: #94a3b8;
--node-stroke: #fbbf24;
--stack-fill: rgba(8, 51, 68, 0.4);
--stack-stroke: #22d3ee;
--dead-fill: rgba(136, 19, 55, 0.4);
--dead-stroke: #fb7185;
--edge-fill: rgba(6, 78, 59, 0.4);
--edge-stroke: #34d399;
--arrow: #cbd5e1;
}
html, body {
margin: 0; padding: 0;
background: var(--bg);
color: var(--fg);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.wrap {
max-width: 1500px; margin: 0 auto; padding: 32px 24px;
}
.header {
display: flex; align-items: center; gap: 12px;
margin-bottom: 8px;
}
.pulse {
width: 10px; height: 10px; border-radius: 50%;
background: #34d399;
box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
70% { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0); }
100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
h1 { margin: 0; font-size: 22px; font-weight: 600; }
.subtitle { color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.card {
background: #0f172a;
border: 1px solid #1e293b;
border-radius: 12px;
padding: 24px;
overflow-x: auto;
}
.cards {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 16px;
margin-top: 24px;
}
@media (max-width: 900px) {
.cards { grid-template-columns: 1fr; }
}
.info-card {
background: #0f172a;
border: 1px solid #1e293b;
border-radius: 12px;
padding: 18px 20px;
}
.info-card h3 {
margin: 0 0 10px 0;
font-size: 13px;
color: var(--muted);
font-weight: 600;
letter-spacing: 0.5px;
text-transform: uppercase;
}
.info-card ul {
margin: 0; padding-left: 16px;
font-size: 12px;
line-height: 1.7;
color: var(--fg);
}
.info-card li::marker { color: var(--edge-stroke); }
.footer {
margin-top: 24px;
color: #475569;
font-size: 10px;
text-align: right;
}
</style>
</head>
<body>
<div class="wrap">
<div class="header">
<span class="pulse"></span>
<h1>Production architecture · Cluster overview</h1>
</div>
<div class="subtitle">
Snapshot 2026-08-27 · sources: docker_socket_proxy (read-only) + gitea admin API + gitea_server logs
</div>
<div class="card">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 900" font-size="12">
<title>Production architecture · Cluster overview</title>
<defs>
<marker id="arrow" 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-dashed" 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>
<pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">
<circle cx="20" cy="20" r="0.5" fill="#1e293b"/>
</pattern>
</defs>
<rect width="1400" height="900" fill="#020617"/>
<rect width="1400" height="900" fill="url(#grid)"/>
<!-- External -->
<rect x="40" y="130" width="260" height="220" rx="12" fill="#1e293b" fill-opacity="0.5" stroke="#94a3b8" stroke-width="1.5"/>
<text x="60" y="155" fill="#94a3b8" font-size="11" font-weight="bold">EXTERNAL (LAN 192.168.1.0/24)</text>
<rect x="60" y="175" width="220" height="44" rx="22" fill="#1e293b" stroke="#94a3b8" stroke-width="1.5"/>
<text x="170" y="193" text-anchor="middle" fill="#e2e8f0" font-size="12" font-weight="bold">Client</text>
<text x="170" y="210" text-anchor="middle" fill="#94a3b8" font-size="10">из tailscale-сети</text>
<rect x="60" y="235" width="105" height="44" rx="6" fill="#0f172a" stroke="#94a3b8" stroke-width="1.5"/>
<text x="112" y="253" text-anchor="middle" fill="#e2e8f0" font-size="12" font-weight="bold">Tailscale</text>
<text x="112" y="270" text-anchor="middle" fill="#94a3b8" font-size="9">subnet router</text>
<rect x="175" y="235" width="105" height="44" rx="6" fill="#0f172a" stroke="#94a3b8" stroke-width="1.5"/>
<text x="227" y="253" text-anchor="middle" fill="#e2e8f0" font-size="12" font-weight="bold">Keenetic</text>
<text x="227" y="267" text-anchor="middle" fill="#94a3b8" font-size="9">DNS + TLS term</text>
<text x="227" y="277" text-anchor="middle" fill="#94a3b8" font-size="9">192.168.1.1</text>
<!-- Arrows client→tailscale→keenetic -->
<path d="M 112 219 L 112 235" fill="none" stroke="#cbd5e1" stroke-width="1.5" marker-end="url(#arrow)"/>
<path d="M 167 257 L 175 257" fill="none" stroke="#cbd5e1" stroke-width="1.5" marker-end="url(#arrow)"/>
<!-- Swarm cluster -->
<rect x="340" y="130" width="720" height="740" rx="12" fill="none" stroke="#fbbf24" stroke-width="1" stroke-dasharray="8 4"/>
<text x="360" y="155" fill="#fbbf24" font-size="11" font-weight="bold">DOCKER SWARM CLUSTER</text>
<!-- odroid node -->
<rect x="360" y="175" width="680" height="460" rx="10" fill="none" stroke="#fbbf24" stroke-width="1.5"/>
<text x="380" y="200" fill="#fef3c7" font-size="12" font-weight="bold">Node: odroid (manager)</text>
<text x="380" y="216" fill="#94a3b8" font-size="10">192.168.1.96 · arm64 · Linux 5.15 · id=j9bljgaqh9qc</text>
<!-- ingress -->
<rect x="380" y="235" width="180" height="50" rx="6" fill="#064e3b" stroke="#34d399" stroke-width="1.5"/>
<text x="470" y="255" text-anchor="middle" fill="#d1fae5" font-size="12" font-weight="bold">swarm ingress</text>
<text x="470" y="270" text-anchor="middle" fill="#a7f3d0" font-size="10">10.0.0.2</text>
<text x="470" y="281" text-anchor="middle" fill="#a7f3d0" font-size="9">(routing mesh)</text>
<!-- Stacks label -->
<text x="380" y="315" fill="#22d3ee" font-size="11" font-weight="bold">STACKS</text>
<!-- stack boxes -->
<g font-size="12">
<rect x="380" y="330" width="160" height="80" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="460" y="350" text-anchor="middle" fill="#cffafe" font-weight="bold">gitea</text>
<text x="460" y="366" text-anchor="middle" fill="#cffafe" font-size="9">gitea_server (3000)</text>
<text x="460" y="378" text-anchor="middle" fill="#cffafe" font-size="9">gitea_runner</text>
<text x="460" y="392" text-anchor="middle" fill="#cffafe" font-size="9">gitea_gitea 10.0.17/24</text>
<text x="460" y="404" text-anchor="middle" fill="#cffafe" font-size="9">ingress: 10.0.0.235</text>
<rect x="555" y="330" width="160" height="80" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="635" y="350" text-anchor="middle" fill="#cffafe" font-weight="bold">hermes</text>
<text x="635" y="366" text-anchor="middle" fill="#cffafe" font-size="9">hermes-agent</text>
<text x="635" y="378" text-anchor="middle" fill="#cffafe" font-size="9">hermes-gateway</text>
<text x="635" y="392" text-anchor="middle" fill="#cffafe" font-size="9">ingress: 10.0.0.204</text>
<rect x="730" y="330" width="160" height="80" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="810" y="350" text-anchor="middle" fill="#cffafe" font-size="11" font-weight="bold">hermes_infra</text>
<text x="810" y="364" text-anchor="middle" fill="#cffafe" font-size="8">squid · sarg · hermes-ui</text>
<text x="810" y="375" text-anchor="middle" fill="#cffafe" font-size="8">docker_socket_proxy</text>
<text x="810" y="386" text-anchor="middle" fill="#cffafe" font-size="8">brencher-state-proxy</text>
<text x="810" y="400" text-anchor="middle" fill="#cffafe" font-size="9">ingress: 10.0.0.106/108</text>
<rect x="905" y="330" width="115" height="80" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="962" y="350" text-anchor="middle" fill="#cffafe" font-weight="bold">immich</text>
<text x="962" y="366" text-anchor="middle" fill="#cffafe" font-size="9">server · db</text>
<text x="962" y="378" text-anchor="middle" fill="#cffafe" font-size="9">redis · ml</text>
<text x="962" y="392" text-anchor="middle" fill="#cffafe" font-size="9">10.0.2.0/24</text>
<text x="962" y="404" text-anchor="middle" fill="#cffafe" font-size="9">.225 / .13</text>
<rect x="380" y="425" width="160" height="70" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="460" y="445" text-anchor="middle" fill="#cffafe" font-weight="bold">brencher · brencher2</text>
<text x="460" y="461" text-anchor="middle" fill="#cffafe" font-size="9">deploy tools</text>
<text x="460" y="473" text-anchor="middle" fill="#cffafe" font-size="9">ingress: 10.0.0.105</text>
<text x="460" y="485" text-anchor="middle" fill="#cffafe" font-size="9"> 10.0.0.102</text>
<rect x="555" y="425" width="160" height="70" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="635" y="445" text-anchor="middle" fill="#cffafe" font-weight="bold">gmail_mcp</text>
<text x="635" y="461" text-anchor="middle" fill="#cffafe" font-size="9">gmail-mcp-server</text>
<text x="635" y="473" text-anchor="middle" fill="#cffafe" font-size="9">telegram-mcp-server</text>
<text x="635" y="485" text-anchor="middle" fill="#cffafe" font-size="9">10.0.0.6 / 10</text>
<rect x="730" y="425" width="160" height="70" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="810" y="445" text-anchor="middle" fill="#cffafe" font-weight="bold">torrserv_proxy</text>
<text x="810" y="461" text-anchor="middle" fill="#cffafe" font-size="9">reverseproxy</text>
<text x="810" y="473" text-anchor="middle" fill="#cffafe" font-size="9">fileserver</text>
<text x="810" y="485" text-anchor="middle" fill="#cffafe" font-size="9">.15 / .12</text>
</g>
<!-- Dead nginx_nginx -->
<rect x="380" y="525" width="280" height="50" rx="6" fill="#1f1717" stroke="#fb7185" stroke-width="1.5" stroke-dasharray="6 3"/>
<text x="520" y="545" text-anchor="middle" fill="#fecaca" font-size="12" font-weight="bold">nginx_nginx (dead)</text>
<text x="520" y="560" text-anchor="middle" fill="#fecaca" font-size="9">jwilder/nginx-proxy · Replicas: 0</text>
<text x="520" y="571" text-anchor="middle" fill="#fecaca" font-size="9">контейнеров нет, overlay-сеть nginx_ingress жива</text>
<!-- xu4 worker -->
<rect x="360" y="660" width="680" height="180" rx="10" fill="none" stroke="#fbbf24" stroke-width="1.5"/>
<text x="380" y="685" fill="#fef3c7" font-size="12" font-weight="bold">Node: xu4 (worker)</text>
<text x="380" y="700" fill="#94a3b8" font-size="10">id=u2ynmimtl0lu</text>
<rect x="500" y="725" width="400" height="60" rx="6" fill="#0f172a" stroke="#fbbf24" stroke-width="1.5" fill-opacity="0.5"/>
<text x="700" y="750" text-anchor="middle" fill="#fbbf24" font-size="12" font-weight="bold">worker tasks</text>
<text x="700" y="767" text-anchor="middle" fill="#94a3b8" font-size="10">(пусто в снапшоте 2026-08-27 — перепроверить)</text>
<!-- Legend -->
<g id="legend">
<rect x="40" y="660" width="260" height="180" rx="8" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="60" y="685" fill="#e2e8f0" font-size="11" font-weight="bold">LEGEND</text>
<rect x="60" y="700" width="20" height="14" rx="3" fill="#1e293b" stroke="#94a3b8" stroke-width="1"/>
<text x="90" y="711" fill="#cbd5e1" font-size="10">external</text>
<rect x="60" y="720" width="20" height="14" rx="3" fill="#0f172a" stroke="#fbbf24" stroke-width="1"/>
<text x="90" y="731" fill="#cbd5e1" font-size="10">node</text>
<rect x="60" y="740" width="20" height="14" rx="3" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1"/>
<text x="90" y="751" fill="#cbd5e1" font-size="10">stack</text>
<rect x="60" y="760" width="20" height="14" rx="3" fill="#064e3b" stroke="#34d399" stroke-width="1"/>
<text x="90" y="771" fill="#cbd5e1" font-size="10">edge / routing</text>
<rect x="60" y="780" width="20" height="14" rx="3" fill="#1f1717" stroke="#fb7185" stroke-width="1" stroke-dasharray="3 2"/>
<text x="90" y="791" fill="#cbd5e1" font-size="10">dead / disabled</text>
<line x1="60" y1="810" x2="80" y2="810" stroke="#cbd5e1" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="90" y="814" fill="#cbd5e1" font-size="10">solid = flow</text>
<line x1="60" y1="828" x2="80" y2="828" stroke="#fb7185" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow-dashed)"/>
<text x="90" y="832" fill="#cbd5e1" font-size="10">dashed = deploy</text>
</g>
<!-- Arrows (drawn last for z-order) -->
<path d="M 280 257 L 360 257" fill="none" stroke="#cbd5e1" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="290" y="250" fill="#cbd5e1" font-size="9">plain HTTP</text>
<text x="290" y="262" fill="#cbd5e1" font-size="9">post TLS term</text>
<path d="M 470 285 L 470 330" fill="none" stroke="#cbd5e1" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="475" y="305" fill="#cbd5e1" font-size="9">to gitea</text>
<path d="M 540 260 Q 750 260 962 330" fill="none" stroke="#cbd5e1" stroke-width="1" stroke-opacity="0.4" marker-end="url(#arrow)"/>
<path d="M 530 255 Q 600 280 635 330" fill="none" stroke="#cbd5e1" stroke-width="1" stroke-opacity="0.4" marker-end="url(#arrow)"/>
<path d="M 460 425 L 460 410" fill="none" stroke="#fb7185" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow-dashed)"/>
<path d="M 540 455 Q 700 455 962 410" fill="none" stroke="#fb7185" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow-dashed)"/>
<text x="700" y="448" fill="#fb7185" font-size="9">deploys</text>
<path d="M 540 460 Q 680 495 810 410" fill="none" stroke="#fb7185" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow-dashed)"/>
<path d="M 520 525 L 520 285" fill="none" stroke="#fb7185" stroke-width="1" stroke-dasharray="4 3" stroke-opacity="0.5" marker-end="url(#arrow-dashed)"/>
<text x="528" y="425" fill="#fb7185" font-size="9" stroke-opacity="0.6">overlay-сеть жива,<br/>контейнеров нет</text>
</svg>
</div>
<!-- Summary cards -->
<div class="cards">
<div class="info-card">
<h3>Что показывает</h3>
<ul>
<li>2 swarm nodes (odroid manager, xu4 worker)</li>
<li>7 stacks on odroid (gitea, hermes, hermes_infra, immich, brencher, gmail_mcp, torrserv_proxy)</li>
<li>External: Keenetic router, Tailscale subnet, Client</li>
<li>Dead component: nginx_nginx (Replicas=0)</li>
<li>Deploy flow: brencher → stacks (dashed arrows)</li>
</ul>
</div>
<div class="info-card">
<h3>Чего НЕ показывает</h3>
<ul>
<li>Каждый отдельный контейнер в overlay-сетях</li>
<li>Volume mounts и где лежат данные</li>
<li>Swarm secrets (LFS_JWT_SECRET, JWT_SECRET)</li>
<li>DNS-резолвинг (search anoa-bebop.ts.net)</li>
<li>Traffic flow отдельных сервисов</li>
</ul>
</div>
<div class="info-card">
<h3>Известные TODO</h3>
<ul>
<li>endpoint.Ports у gitea_server пустое, но ingress маршрутизирует — legacy</li>
<li>xu4 worker пуст в снапшоте 2026-08-27</li>
<li>nginx_nginx Replicas=0 — dead</li>
<li>Tailscale роль требует подтверждения (subnet vs MagicDNS)</li>
<li>Дополнительные уровни: networks, secrets, deploy flow</li>
</ul>
</div>
</div>
<div class="footer">
generated 2026-08-27 · sources: docker_socket_proxy + gitea admin API · single-file HTML, no JS, no external deps
</div>
</div>
</body>
</html>
+233
View File
@@ -0,0 +1,233 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 900" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12">
<title>Production architecture · Cluster overview (snapshot 2026-08-27)</title>
<desc>Dark-themed SVG showing 2 swarm nodes (odroid manager + xu4 worker), 7 stacks on odroid (gitea, hermes, hermes_infra, immich, brencher, gmail_mcp, torrserv_proxy), external entities (Keenetic, Tailscale, Client), and a dead nginx_nginx service with Replicas=0.</desc>
<!--
Production architecture — variant 2: standalone SVG
Same graph as variant 1 (Mermaid), but rendered as raw SVG.
Open in any browser, embed in docs, share as-is.
Color palette (semantic):
external: slate #1e293b stroke #94a3b8
node: amber #0f172a stroke #fbbf24
stack: cyan #0c4a6e stroke #22d3ee
dead: rose #1f1717 stroke #fb7185 dashed
edge: emerald #064e3b stroke #34d399
-->
<defs>
<!-- Arrowheads -->
<marker id="arrow" 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-dashed" 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>
<!-- Subtle dot grid background -->
<pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">
<circle cx="20" cy="20" r="0.5" fill="#1e293b"/>
</pattern>
<!-- Reusable component style via <use> would be overkill — inline styles used instead -->
</defs>
<!-- Background -->
<rect width="1400" height="900" fill="#020617"/>
<rect width="1400" height="900" fill="url(#grid)"/>
<!-- Title -->
<text x="40" y="40" fill="#e2e8f0" font-size="20" font-weight="bold">
Production architecture · Cluster overview
</text>
<text x="40" y="60" fill="#94a3b8" font-size="11">
Source: docker_socket_proxy (read-only) + gitea API + gitea_server logs · Snapshot 2026-08-27
</text>
<!-- ============================================================== -->
<!-- External subnet (LAN) -->
<!-- ============================================================== -->
<g id="external">
<rect x="40" y="90" width="260" height="220" rx="12" fill="#1e293b" fill-opacity="0.5" stroke="#94a3b8" stroke-width="1.5"/>
<text x="60" y="115" fill="#94a3b8" font-size="11" font-weight="bold">EXTERNAL (LAN 192.168.1.0/24)</text>
<!-- Client -->
<rect x="60" y="135" width="220" height="44" rx="22" fill="#1e293b" stroke="#94a3b8" stroke-width="1.5"/>
<text x="170" y="153" text-anchor="middle" fill="#e2e8f0" font-size="12" font-weight="bold">Client</text>
<text x="170" y="170" text-anchor="middle" fill="#94a3b8" font-size="10">из tailscale-сети</text>
<!-- Tailscale -->
<rect x="60" y="195" width="105" height="44" rx="6" fill="#0f172a" stroke="#94a3b8" stroke-width="1.5"/>
<text x="112" y="213" text-anchor="middle" fill="#e2e8f0" font-size="12" font-weight="bold">Tailscale</text>
<text x="112" y="230" text-anchor="middle" fill="#94a3b8" font-size="9">subnet router</text>
<!-- Keenetic -->
<rect x="175" y="195" width="105" height="44" rx="6" fill="#0f172a" stroke="#94a3b8" stroke-width="1.5"/>
<text x="227" y="213" text-anchor="middle" fill="#e2e8f0" font-size="12" font-weight="bold">Keenetic</text>
<text x="227" y="227" text-anchor="middle" fill="#94a3b8" font-size="9">DNS + TLS term</text>
<text x="227" y="237" text-anchor="middle" fill="#94a3b8" font-size="9">192.168.1.1</text>
</g>
<!-- Arrows: Client → Tailscale → Keenetic -->
<path d="M 112 179 L 112 195" fill="none" stroke="#cbd5e1" stroke-width="1.5" marker-end="url(#arrow)"/>
<path d="M 167 217 L 175 217" fill="none" stroke="#cbd5e1" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="120" y="190" fill="#cbd5e1" font-size="9">tails</text>
<!-- ============================================================== -->
<!-- Swarm cluster -->
<!-- ============================================================== -->
<g id="swarm">
<rect x="340" y="90" width="720" height="780" rx="12" fill="none" stroke="#fbbf24" stroke-width="1" stroke-dasharray="8 4" fill-opacity="0"/>
<text x="360" y="115" fill="#fbbf24" font-size="11" font-weight="bold">DOCKER SWARM CLUSTER</text>
<!-- ============================================================ -->
<!-- Node: odroid (manager) -->
<!-- ============================================================ -->
<rect x="360" y="135" width="680" height="500" rx="10" fill="none" stroke="#fbbf24" stroke-width="1.5" fill-opacity="0"/>
<text x="380" y="160" fill="#fef3c7" font-size="12" font-weight="bold">Node: odroid (manager)</text>
<text x="380" y="176" fill="#94a3b8" font-size="10">192.168.1.96 · arm64 · Linux 5.15 · id=j9bljgaqh9qc</text>
<!-- Swarm ingress-endpoint -->
<rect x="380" y="195" width="180" height="50" rx="6" fill="#064e3b" stroke="#34d399" stroke-width="1.5"/>
<text x="470" y="215" text-anchor="middle" fill="#d1fae5" font-size="12" font-weight="bold">swarm ingress</text>
<text x="470" y="230" text-anchor="middle" fill="#a7f3d0" font-size="10">10.0.0.2</text>
<text x="470" y="241" text-anchor="middle" fill="#a7f3d0" font-size="9">(routing mesh)</text>
<!-- Stack boxes -->
<text x="380" y="275" fill="#22d3ee" font-size="11" font-weight="bold">STACKS</text>
<!-- gitea -->
<rect x="380" y="290" width="160" height="80" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="460" y="310" text-anchor="middle" fill="#cffafe" font-size="12" font-weight="bold">gitea</text>
<text x="460" y="326" text-anchor="middle" fill="#cffafe" font-size="9">gitea_server (3000)</text>
<text x="460" y="338" text-anchor="middle" fill="#cffafe" font-size="9">gitea_runner</text>
<text x="460" y="352" text-anchor="middle" fill="#cffafe" font-size="9">gitea_gitea 10.0.17/24</text>
<text x="460" y="364" text-anchor="middle" fill="#cffafe" font-size="9">ingress: 10.0.0.235</text>
<!-- hermes -->
<rect x="555" y="290" width="160" height="80" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="635" y="310" text-anchor="middle" fill="#cffafe" font-size="12" font-weight="bold">hermes</text>
<text x="635" y="326" text-anchor="middle" fill="#cffafe" font-size="9">hermes-agent</text>
<text x="635" y="338" text-anchor="middle" fill="#cffafe" font-size="9">hermes-gateway</text>
<text x="635" y="352" text-anchor="middle" fill="#cffafe" font-size="9">ingress: 10.0.0.204</text>
<!-- hermes_infra -->
<rect x="730" y="290" width="160" height="80" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="810" y="310" text-anchor="middle" fill="#cffafe" font-size="11" font-weight="bold">hermes_infra</text>
<text x="810" y="324" text-anchor="middle" fill="#cffafe" font-size="8">squid · sarg · hermes-ui</text>
<text x="810" y="335" text-anchor="middle" fill="#cffafe" font-size="8">docker_socket_proxy</text>
<text x="810" y="346" text-anchor="middle" fill="#cffafe" font-size="8">brencher-state-proxy</text>
<!-- immich -->
<rect x="905" y="290" width="115" height="80" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="962" y="310" text-anchor="middle" fill="#cffafe" font-size="12" font-weight="bold">immich</text>
<text x="962" y="326" text-anchor="middle" fill="#cffafe" font-size="9">server · db</text>
<text x="962" y="338" text-anchor="middle" fill="#cffafe" font-size="9">redis · ml</text>
<text x="962" y="352" text-anchor="middle" fill="#cffafe" font-size="9">10.0.2.0/24</text>
<!-- brencher -->
<rect x="380" y="390" width="160" height="70" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="460" y="410" text-anchor="middle" fill="#cffafe" font-size="12" font-weight="bold">brencher · brencher2</text>
<text x="460" y="426" text-anchor="middle" fill="#cffafe" font-size="9">deploy tools</text>
<text x="460" y="438" text-anchor="middle" fill="#cffafe" font-size="9">ingress: 10.0.0.105</text>
<text x="460" y="450" text-anchor="middle" fill="#cffafe" font-size="9"> 10.0.0.102</text>
<!-- gmail_mcp -->
<rect x="555" y="390" width="160" height="70" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="635" y="410" text-anchor="middle" fill="#cffafe" font-size="12" font-weight="bold">gmail_mcp</text>
<text x="635" y="426" text-anchor="middle" fill="#cffafe" font-size="9">gmail-mcp-server</text>
<text x="635" y="438" text-anchor="middle" fill="#cffafe" font-size="9">telegram-mcp-server</text>
<text x="635" y="450" text-anchor="middle" fill="#cffafe" font-size="9">10.0.0.6 / 10</text>
<!-- torrserv_proxy -->
<rect x="730" y="390" width="160" height="70" rx="6" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1.5"/>
<text x="810" y="410" text-anchor="middle" fill="#cffafe" font-size="12" font-weight="bold">torrserv_proxy</text>
<text x="810" y="426" text-anchor="middle" fill="#cffafe" font-size="9">reverseproxy</text>
<text x="810" y="438" text-anchor="middle" fill="#cffafe" font-size="9">fileserver</text>
<!-- Dead: nginx_nginx -->
<rect x="380" y="500" width="280" height="50" rx="6" fill="#1f1717" stroke="#fb7185" stroke-width="1.5" stroke-dasharray="6 3"/>
<text x="520" y="520" text-anchor="middle" fill="#fecaca" font-size="12" font-weight="bold">nginx_nginx (dead)</text>
<text x="520" y="535" text-anchor="middle" fill="#fecaca" font-size="9">jwilder/nginx-proxy · Replicas: 0</text>
<text x="520" y="546" text-anchor="middle" fill="#fecaca" font-size="9">контейнеров нет, overlay-сеть nginx_ingress жива</text>
<!-- ============================================================ -->
<!-- Node: xu4 (worker) -->
<!-- ============================================================ -->
<rect x="360" y="660" width="680" height="180" rx="10" fill="none" stroke="#fbbf24" stroke-width="1.5" fill-opacity="0"/>
<text x="380" y="685" fill="#fef3c7" font-size="12" font-weight="bold">Node: xu4 (worker)</text>
<text x="380" y="700" fill="#94a3b8" font-size="10">id=u2ynmimtl0lu</text>
<rect x="500" y="725" width="400" height="60" rx="6" fill="#0f172a" stroke="#fbbf24" stroke-width="1.5" fill-opacity="0.5"/>
<text x="700" y="750" text-anchor="middle" fill="#fbbf24" font-size="12" font-weight="bold">worker tasks</text>
<text x="700" y="767" text-anchor="middle" fill="#94a3b8" font-size="10">(пусто в снапшоте 2026-08-27 — перепроверить)</text>
</g>
<!-- ============================================================== -->
<!-- Legend (внизу, за пределами swarm-boundary) -->
<!-- ============================================================== -->
<g id="legend">
<rect x="40" y="660" width="260" height="180" rx="8" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="60" y="685" fill="#e2e8f0" font-size="11" font-weight="bold">LEGEND</text>
<rect x="60" y="700" width="20" height="14" rx="3" fill="#1e293b" stroke="#94a3b8" stroke-width="1"/>
<text x="90" y="711" fill="#cbd5e1" font-size="10">external</text>
<rect x="60" y="720" width="20" height="14" rx="3" fill="#0f172a" stroke="#fbbf24" stroke-width="1"/>
<text x="90" y="731" fill="#cbd5e1" font-size="10">node</text>
<rect x="60" y="740" width="20" height="14" rx="3" fill="#0c4a6e" stroke="#22d3ee" stroke-width="1"/>
<text x="90" y="751" fill="#cbd5e1" font-size="10">stack</text>
<rect x="60" y="760" width="20" height="14" rx="3" fill="#064e3b" stroke="#34d399" stroke-width="1"/>
<text x="90" y="771" fill="#cbd5e1" font-size="10">edge / routing</text>
<rect x="60" y="780" width="20" height="14" rx="3" fill="#1f1717" stroke="#fb7185" stroke-width="1" stroke-dasharray="3 2"/>
<text x="90" y="791" fill="#cbd5e1" font-size="10">dead / disabled</text>
<line x1="60" y1="810" x2="80" y2="810" stroke="#cbd5e1" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="90" y="814" fill="#cbd5e1" font-size="10">solid arrow = flow</text>
<line x1="60" y1="828" x2="80" y2="828" stroke="#fb7185" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow-dashed)"/>
<text x="90" y="832" fill="#cbd5e1" font-size="10">dashed arrow = deploy</text>
</g>
<!-- ============================================================== -->
<!-- Arrows (drawn LAST so they appear on top of fills, but routed through clear gaps) -->
<!-- ============================================================== -->
<!-- Keenetic → swarm ingress -->
<path d="M 280 217 L 360 217" fill="none" stroke="#cbd5e1" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="290" y="210" fill="#cbd5e1" font-size="9">plain HTTP</text>
<text x="290" y="222" fill="#cbd5e1" font-size="9">post TLS term</text>
<!-- swarm ingress → gitea -->
<path d="M 470 245 L 470 290" fill="none" stroke="#cbd5e1" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="475" y="265" fill="#cbd5e1" font-size="9">to gitea_server</text>
<!-- swarm ingress → immich -->
<path d="M 540 220 Q 750 220 962 290" fill="none" stroke="#cbd5e1" stroke-width="1" stroke-opacity="0.4" marker-end="url(#arrow)"/>
<!-- swarm ingress → hermes -->
<path d="M 530 215 Q 600 240 635 290" fill="none" stroke="#cbd5e1" stroke-width="1" stroke-opacity="0.4" marker-end="url(#arrow)"/>
<!-- brencher → gitea (deploy) -->
<path d="M 460 390 L 460 370" fill="none" stroke="#fb7185" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow-dashed)"/>
<text x="465" y="382" fill="#fb7185" font-size="9">deploys</text>
<!-- brencher → immich (deploy) -->
<path d="M 540 420 Q 700 420 962 380" fill="none" stroke="#fb7185" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow-dashed)"/>
<text x="700" y="412" fill="#fb7185" font-size="9">deploys</text>
<!-- brencher → hermes_infra (deploy) -->
<path d="M 540 425 Q 680 460 810 370" fill="none" stroke="#fb7185" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrow-dashed)"/>
<!-- nginx_nginx → ingress (dead, dashed) -->
<path d="M 520 500 L 520 245" fill="none" stroke="#fb7185" stroke-width="1" stroke-dasharray="4 3" stroke-opacity="0.5" marker-end="url(#arrow-dashed)"/>
<text x="528" y="400" fill="#fb7185" font-size="9" stroke-opacity="0.6">overlay-сеть жива,<br/>контейнеров нет</text>
<!-- Footer note -->
<text x="40" y="880" fill="#475569" font-size="10">
generated 2026-08-27 · sources: docker_socket_proxy + gitea admin API · single file, no external deps
</text>
</svg>

After

Width:  |  Height:  |  Size: 15 KiB