openspec: move-vps01-fronts-to-vps02 — s3/ollama/gitea/webui/search на vps02, qdrant и n8n не публикуются (validate -> archive)

This commit is contained in:
2026-11-27 13:08:29 +00:00
parent 179462b0c5
commit 2f744af682
7 changed files with 338 additions and 0 deletions
@@ -0,0 +1,51 @@
# Design — move-vps01-fronts-to-vps02
## Что было на vps01 и где этому место
| имя | апстрим на vps01 | на vps02 уже было | решение |
|---|---|---|---|
| `ollama.nixg.ru` | `http://10.8.0.2` (порт 80, мёртв) | `10.8.0.2:11434` | использовать блок vps02 |
| `s3.nixg.ru` | `localhost:3900` (Garage vps01) | нет | добавлен `127.0.0.1:3900` (Garage vps02, тот же кластер) |
| `gitea.nixg.ru` | `10.8.0.2:3000` | `10.8.0.2:3000` | только DNS |
| `webui.nixg.ru` | `10.8.0.2:11435` | `10.8.0.2:11435` | только DNS |
| `search.nixg.ru` | `10.8.0.2:11436` | `10.8.0.2:11436` | только DNS |
| `mailagent.nixg.ru` | `10.8.0.2:8085` | `10.8.0.2:8085` | DNS уже на vps02 |
| `qdrant.nixg.ru` | блока не было | нет | не публикуем (нет авторизации) |
| `n8n.nixg.ru` | `http://10.8.0.2` (порт 80, мёртв) | нет | сервиса нет — не поднимаем |
| `wf.gelonet.ru` | `127.0.0.1:8080` (WriteFreely) | нет | сервис на vps01 — отдельная смена |
| `cdn2.nixg.ru` | `127.0.0.1:50002` (XRay) | нет | сервис на vps01 — отдельная смена |
Наблюдение: блоки vps01 с апстримом `http://10.8.0.2` (без порта) указывают
на порт 80 bigbox, где **ничего не слушает** — `curl http://10.8.0.2/` →
`000` и с самого bigbox, и с vps02. То есть `ollama` и `n8n` через vps01 были
сломаны ещё до блокировки адреса; рабочий апстрим Ollama — `10.8.0.2:11434`.
Поэтому перенос блока копированием «как есть» не годится: для каждого имени
проверяется фактический порт.
## Почему s3 через ноду vps02
Garage — кластер из трёх здоровых нод (`garage status`): vps01
`10.8.0.1:3901`, vps02 `10.8.0.4:3901`, bigbox `10.8.0.2:3901`, версия v2.1.0.
S3 API кластерный: ключи и бакеты общие, `garage bucket list` с vps02 видит
`obsidian` и `lad`. Фронт на vps02 → `127.0.0.1:3900` не гоняет S3-трафик по
WG и не добавляет хоп.
## Проверка, которую надо повторить после правок DNS
DNS на bigbox кэширован (TTL 10800), поэтому проверять нужно с явным
адресом, иначе тест покажет старый заблокированный IP:
```bash
curl -s --noproxy '*' --resolve ollama.nixg.ru:443:87.242.100.206 -o /dev/null \
-w '%{http_code}\n' https://ollama.nixg.ru/ # 200
curl -s --noproxy '*' --resolve s3.nixg.ru:443:87.242.100.206 https://s3.nixg.ru/obsidian
# XML AccessDenied от Garage — значит S3-API живой, 404 быть не должно
```
Ожидаемые коды: `ollama` 200 (`Ollama is running`), `gitea` 200,
`webui` 200, `search` 200, `s3` 403 на корне (норма S3 без подписи).
## Откат
Вернуть DNS-записи на `5.129.217.146` — фронты vps01 никто не удалял. Правка
Caddy на vps02 откатывается `Caddyfile.bak-s3-2026-11-27` + `caddy reload`.
@@ -0,0 +1,43 @@
# Перенос фронтов с vps01 на vps02
## Why
26.11.2026 публичный адрес vps01 (`5.129.217.146`) перестал быть достижим с
российских маршрутов (ICMP, TCP и UDP одинаково). На vps01 оставались
Caddy-фронты, чьи DNS-записи указывали на этот адрес, поэтому сервисы,
которые живут на bigbox и в Garage-кластере, стали недоступны для клиентов из
РФ, хотя сами сервисы работали.
vps02 (`87.242.100.206`, Cloud.ru) уже фронтует десятки имён
(`reverse_proxy 10.8.0.2:…`) и после включения WG-релея достаёт bigbox по
`10.8.0.2`. Перенос фронтов на него возвращает доступ без изменения самих
сервисов.
## What Changes
- На vps02 добавлен блок `s3.nixg.ru → reverse_proxy 127.0.0.1:3900`
(Garage-нода vps02 в том же кластере; бакеты `obsidian`, `lad` видны с неё).
- Остальные имена (`ollama`, `gitea`, `webui`, `search`, `mailagent`) уже имели
блоки на vps02 — они проверены и работают, нужна была только правка DNS.
- DNS-записи `s3`, `ollama`, `gitea`, `webui`, `search`, `qdrant`, `n8n`
переведены владельцем на `87.242.100.206` (авторитативные NS jino уже
отдают новый адрес).
- Фронты на vps01 не удаляются: они остаются как есть и снова начнут
обслуживать трафик, если адрес разблокируют.
## Impact
- `/opt/caddy/Caddyfile` на vps02 (бэкап `Caddyfile.bak-s3-2026-11-27`).
- DNS у регистратора jino.ru — правка владельцем, TTL 10800.
- Сертификаты: Caddy на vps02 отдаёт валидные Let's Encrypt для всех имён,
где есть блок (проверено на `gitea.nixg.ru`, срок до 25.02.2027).
## Non-goals
- `qdrant.nixg.ru` не публикуется: на vps01 блока для него не было, а Qdrant
на bigbox работает без API-ключа (`QDRANT__SERVICE__API_KEY` пустой).
Публиковать векторную базу без авторизации нельзя — решение отдельно.
- `n8n.nixg.ru` не поднимается: сервиса n8n нет ни на bigbox, ни на vps02,
запись была мёртвой и до блокировки.
- `wf.gelonet.ru` (WriteFreely на `127.0.0.1:8080` vps01) и `cdn2.nixg.ru`
(XRay-выход на vps01) требуют переноса самих сервисов — отдельные смены.
@@ -0,0 +1,55 @@
# public-fronts Specification
## ADDED Requirements
### Requirement: Public Fronts Live on a Reachable Node
A hostname served to clients MUST terminate on a node whose public address is
reachable from the intended audience, independently of the node that runs the
backend service.
#### Scenario: Front is moved without touching the service
- GIVEN a Caddy site on a node whose public IP is blocked for part of the
audience
- AND the backend service listens on another node reachable over the WireGuard
mesh
- WHEN the site block is added to a reachable node with the same upstream
(via `10.8.0.x`) and the DNS record is repointed
- THEN clients reach the service through the new node
- AND the backend service is not reconfigured, restarted or moved
#### Scenario: Upstream port is verified, not copied
- GIVEN a site block that proxies to `http://10.8.0.2` and nothing listens on
port 80 of that host
- WHEN the block is transferred to another node
- THEN the upstream MUST be probed from the target node before the transfer is
claimed as working (`curl -o /dev/null -w '%{http_code}'`)
- AND a dead upstream is corrected to the real port instead of being copied
#### Scenario: Cluster-backed storage is fronted by any healthy node
- GIVEN an S3 gateway backed by a multi-node cluster where every node exposes
the S3 API and sees the same buckets
- WHEN the public front is moved to another cluster node
- THEN that node answers S3 requests for the same buckets
- AND an anonymous request returns the gateway's XML `AccessDenied`, which
proves the API is served rather than a 404 from a web server
#### Scenario: Verification ignores the DNS cache
- GIVEN the record TTL is measured in hours and the previous answer is cached
- WHEN the move is verified right after the DNS change
- THEN the check uses the explicit target address
(`curl --resolve host:443:<ip>`) or the authoritative NS
(`dig @ns1.<registrar> host A`)
- AND a stale cached answer is reported as cache, not as a failed move
#### Scenario: Unauthenticated data services are not published
- GIVEN an internal service that has no authentication enabled
- WHEN its hostname is repointed to a public front
- THEN no site block is added for it
- AND the absence of the block is reported to the owner together with the
options (enable an API key first, or keep WG-only access)
@@ -0,0 +1,66 @@
# Tasks — move-vps01-fronts-to-vps02
## 1. Инвентаризация (что вообще было на vps01)
- [x] 1.1 Список сайтов из `/etc/caddy/Caddyfile` на vps01: `wf.gelonet.ru`,
`n8n.nixg.ru`, `ollama.nixg.ru`, `webui.nixg.ru`, `search.nixg.ru`,
`vwar.nixg.ru`, `s3.nixg.ru`, `gitea.nixg.ru`, `mailagent.nixg.ru`,
`cdn2.nixg.ru`.
- [x] 1.2 DNS по каждому: на `5.129.217.146` смотрели `ollama`, `s3`,
`gitea`, `webui`, `search`, `qdrant`, `wf.gelonet`, `cdn2`;
`n8n`, `vwar`, `mailagent`, `tgate` — уже на `87.242.100.206`.
- [x] 1.3 Проверка апстримов с vps02 (через WG-релей):
gitea `:3000` → 200, webui `:11435` → 200, search `:11436` → 200,
ollama `:11434` → 200, s3 `:3900` → 403 (норма), qdrant `:6333` → 000.
## 2. Caddy на vps02
- [x] 2.1 Добавлен блок `s3.nixg.ru → reverse_proxy 127.0.0.1:3900`
(бэкап `Caddyfile.bak-s3-2026-11-27`).
Верификация: `caddy validate` → `Valid configuration`, `caddy reload` → ok.
- [x] 2.2 Убедиться, что Garage-нода vps02 в кластере: `garage status` → три
HEALTHY ноды (vps01/vps02/bigbox, v2.1.0), `garage bucket list` → бакеты
`obsidian`, `lad` видны с vps02.
- [x] 2.3 Блоки `ollama`, `gitea`, `webui`, `search`, `mailagent` на vps02 уже
были — сверены с фактическими портами апстримов.
## 3. DNS (выполняет владелец)
- [x] 3.1 Переведены на `87.242.100.206`: `s3`, `ollama`, `gitea`, `webui`,
`search`, `qdrant`, `n8n`.
Верификация: `dig @ns1.jino.ru <имя> A` → `87.242.100.206`.
- [ ] 3.2 Дождаться истечения кэша у резолверов (TTL 10800): локальный
резолвер bigbox на момент проверки всё ещё отдавал `5.129.217.146`.
## 4. Проверка по существу (через `--resolve`, мимо DNS-кэша)
- [x] 4.1 `ollama.nixg.ru` → HTTP 200, тело `Ollama is running`.
- [x] 4.2 `gitea.nixg.ru` → HTTP 200, HTML Gitea; сертификат Let's Encrypt
(`CN=gitea.nixg.ru`, до 25.02.2027).
- [x] 4.3 `webui.nixg.ru` → HTTP 200, `search.nixg.ru` → HTTP 200.
- [x] 4.4 `s3.nixg.ru/obsidian` → XML `AccessDenied` от Garage
(`Garage does not support anonymous access yet`) — S3-API обслуживается
фронтом vps02, а не 404.
- [ ] 4.5 `qdrant.nixg.ru` и `n8n.nixg.ru` → `tls: alert internal error`:
блоков на vps02 нет. Ожидаемо и зафиксировано в Non-goals.
## 5. Фиксация
- [x] 5.1 Обновить `STATUS.md` и `WALKTHROUGH.md`.
- [x] 5.2 `openspec validate move-vps01-fronts-to-vps02 --strict` → archive.
- [x] 5.3 Коммит и push.
## postMVP
1. Qdrant наружу: сгенерировать API-ключ, проставить
`QDRANT__SERVICE__API_KEY`, опубликовать контейнер на `10.8.0.2:6333`
(только WG), добавить блок на vps02 и обновить клиентов memory-os на
bigbox (сейчас ходят на `127.0.0.1:6333` без ключа — с ключом сломаются,
если не обновить). Проверка: `curl -H 'api-key: …'` отдаёт коллекции,
без ключа — 401.
2. `wf.gelonet.ru` — перенести WriteFreely с vps01 (там SQLite и `/var/www`),
иначе имя остаётся мёртвым. Проверка: 200 через vps02.
3. `cdn2.nixg.ru` — перенести XRay-выход (сейчас `127.0.0.1:50002` на vps01,
участвует в цепочке роутера). Проверка: WS-хендшейк 101 через Caddy vps02.
4. Почистить мёртвые блоки на vps01 с апстримом `http://10.8.0.2` (порт 80),
чтобы они не выглядели рабочими. Проверка: `grep -c '10.8.0.2$'`.
+58
View File
@@ -0,0 +1,58 @@
# public-fronts Specification
## Purpose
TBD - created by archiving change move-vps01-fronts-to-vps02. Update Purpose after archive.
## Requirements
### Requirement: Public Fronts Live on a Reachable Node
A hostname served to clients MUST terminate on a node whose public address is
reachable from the intended audience, independently of the node that runs the
backend service.
#### Scenario: Front is moved without touching the service
- GIVEN a Caddy site on a node whose public IP is blocked for part of the
audience
- AND the backend service listens on another node reachable over the WireGuard
mesh
- WHEN the site block is added to a reachable node with the same upstream
(via `10.8.0.x`) and the DNS record is repointed
- THEN clients reach the service through the new node
- AND the backend service is not reconfigured, restarted or moved
#### Scenario: Upstream port is verified, not copied
- GIVEN a site block that proxies to `http://10.8.0.2` and nothing listens on
port 80 of that host
- WHEN the block is transferred to another node
- THEN the upstream MUST be probed from the target node before the transfer is
claimed as working (`curl -o /dev/null -w '%{http_code}'`)
- AND a dead upstream is corrected to the real port instead of being copied
#### Scenario: Cluster-backed storage is fronted by any healthy node
- GIVEN an S3 gateway backed by a multi-node cluster where every node exposes
the S3 API and sees the same buckets
- WHEN the public front is moved to another cluster node
- THEN that node answers S3 requests for the same buckets
- AND an anonymous request returns the gateway's XML `AccessDenied`, which
proves the API is served rather than a 404 from a web server
#### Scenario: Verification ignores the DNS cache
- GIVEN the record TTL is measured in hours and the previous answer is cached
- WHEN the move is verified right after the DNS change
- THEN the check uses the explicit target address
(`curl --resolve host:443:<ip>`) or the authoritative NS
(`dig @ns1.<registrar> host A`)
- AND a stale cached answer is reported as cache, not as a failed move
#### Scenario: Unauthenticated data services are not published
- GIVEN an internal service that has no authentication enabled
- WHEN its hostname is repointed to a public front
- THEN no site block is added for it
- AND the absence of the block is reported to the owner together with the
options (enable an API key first, or keep WG-only access)