feat(iis-migration): win-acme HTTP-01 auto-renewal on RUVDS IIS
Stood up a permanent self-renewing Let's Encrypt pipeline on the RUVDS IIS host, replacing the manual traefik acme.json -> PFX import and closing the 2026-07-22 cert-expiry deadline (new 25-SAN cert valid to 2026-09-03, SYSTEM scheduled task renews 55 days before expiry). Key obstacle: the MoreThenCms OWIN catch-all (owin:HandleAllRequests) swallowed /.well-known/acme-challenge/. Solved by carving the challenge path into a separate IIS application in a No-Managed-Code app pool, plus patching win-acme's Web_Config.xml template to remove the inherited Owin handler. Staging + prod validation green for all 25 hostnames; live TLS smoke confirms the new cert is served (incl degraded maljarka/rimiz). - scripts/iis-migration-to-ruvds/03-ruvds-winacme.ps1 (idempotent setup) - scripts/iis-migration-to-ruvds/winacme-Web_Config.xml (patched template) - .wiki/concepts/winacme-iis-owin-catchall-http01.md (recipe + gotchas) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,45 +1,51 @@
|
||||
---
|
||||
_last_updated_: 2026-06-05T00:30:00+03:00
|
||||
session_id: 2026-06-05-iis-migration-full-cutover
|
||||
_last_updated_: 2026-06-05T02:00:00+03:00
|
||||
session_id: 2026-06-05-iis-cutover-and-winacme-renewal
|
||||
---
|
||||
|
||||
# Next session handoff
|
||||
|
||||
_Сессия: **FULL CUTOVER достигнут** — все 25 hostname (tandemmebel + вся зона snolla.com) authoritative
|
||||
на RUVDS `80.64.31.36`. Source НЕ заглушен (user-decision: 7-day soak warm rollback). Зафиксировано в
|
||||
`.tasks/iis-migration-to-ruvds.md`. Ничего не висит._
|
||||
_Сессия: (1) full DNS cutover на RUVDS достигнут; (2) поднят постоянный win-acme HTTP-01 auto-renewal
|
||||
на RUVDS IIS — дедлайн cert-expiry 2026-07-22 СНЯТ. Source НЕ заглушен (warm rollback). Всё проверено,
|
||||
ничего не висит._
|
||||
|
||||
## Recent commits
|
||||
|
||||
- `539f1a07` task(iis-migration): tandemmebel DNS cutover 2026-06-05
|
||||
- (+ commit этой сессии с full-cutover записью)
|
||||
- `9cd6d4e2` task(iis-migration): full DNS cutover reached 2026-06-05
|
||||
- (+ commit этой сессии: win-acme renewal pipeline + wiki concept)
|
||||
|
||||
## Что сделано (iis-migration, 05.06)
|
||||
|
||||
- ✅ **Full cutover:** все 25 hostname → RUVDS на authoritative ns1.reg.ru. На windows-source
|
||||
(`94.19.247.14`) authoritative не осталось ничего. Вся зона `snolla.com` (apex + 10 субдоменов,
|
||||
независимые A) переехала вслед за tandemmebel.
|
||||
- ✅ Хвост кэша: `on.snolla.com` + `tandemmebel.snolla.com` ещё `94.19.247.14` на Google 8.8.8.8
|
||||
(TTL 86400, дотекает; 1.1.1.1/Yandex уже RUVDS). Дренаж до ~24ч.
|
||||
- ✅ RUVDS smoke: `snolla.com` 200, `tandemmebel.snolla.com` 200. `maljarka` 502 (pre-existing CMS, не cutover).
|
||||
- ✅ **Full cutover:** все 25 hostname authoritative на RUVDS `80.64.31.36`. На windows-source ничего authoritative.
|
||||
- ✅ **win-acme auto-renewal** на RUVDS: 25-SAN LE cert (до **2026-09-03**) во всех SNI-биндингах +
|
||||
SYSTEM scheduled task `win-acme-renew-snolla` (renew 55д до expiry). RUVDS больше НЕ зависит от
|
||||
домашнего traefik по сертификатам.
|
||||
- Gotcha решён: OWIN-catch-all CMS жрал `/.well-known/acme-challenge/` → challenge вынесен в отдельное
|
||||
IIS-приложение (пул «No Managed Code») + патч шаблона `C:\win-acme\Web_Config.xml`.
|
||||
- Артефакты: `scripts/iis-migration-to-ruvds/03-ruvds-winacme.ps1` + `winacme-Web_Config.xml`;
|
||||
recipe в `.wiki/concepts/winacme-iis-owin-catchall-http01.md`.
|
||||
- Доступ к RUVDS: SSH `~/.ssh/ruvds-iis-migration` → `Administrator@80.64.31.36` (elevated сессия).
|
||||
|
||||
## Спроси user'а
|
||||
|
||||
- **Decommission `snolla` site** — ждём soak (~2026-06-12) + drain кэша, или форсировать раньше?
|
||||
Когда решит: elevated PS → `Stop-Website snolla` → архив `C:\sites\snolla` (8.66 ГБ) → kreknin →
|
||||
cleanup temp SSH-ключей + FW-правил (`ssh-from-source`/`smb-from-source` на RUVDS).
|
||||
- **LE-renewal на RUVDS** — теперь DNS полностью на RUVDS → можно win-acme + HTTP-01. Дедлайн ~2026-07-15
|
||||
(certs expire 2026-07-22). Поднимать?
|
||||
- `maljarka.tandemmebel.ru` 502 — чинить CMS-тенант отдельно? (pre-existing, не блокер).
|
||||
- **Decommission `snolla` site** на windows-source — ждём soak (~2026-06-12) + drain кэша, или раньше?
|
||||
Когда решит: elevated PS → `Stop-Website snolla` → архив `C:\sites\snolla` (8.66 ГБ) → kreknin +
|
||||
cleanup temp SSH-ключей/FW-правил. (win-acme на RUVDS от этого не зависит — он самостоятелен.)
|
||||
- `maljarka.tandemmebel.ru` 502 — чинить CMS-тенант отдельно? (pre-existing, не блокер; HTTPS-cert у него валиден).
|
||||
|
||||
## Не делать (preemptive guards)
|
||||
|
||||
- **Не `Stop-Website snolla` пока хвост кэша течёт** — `on.`/`tandemmebel.snolla.com` ещё резолвятся
|
||||
на windows у части юзеров (Google). Остановка сейчас = частичный downtime до drain.
|
||||
- **Не глушить до soak** без явного запроса — user выбрал 7-day warm rollback.
|
||||
- IIS-правки требуют **elevated shell** (текущий `vitya` — не admin; W3SVC running).
|
||||
- **branch ahead от origin** — push без явного grant'а (Rule 4). Этой сессии grant НЕ давали.
|
||||
- **Не `--test` в win-acme под SSH** — включает интерактив, виснет. Для staging — `--baseuri <staging>`.
|
||||
- **Не трогать `acme-challenge` IIS-приложение / пул «No Managed Code» / патченый `Web_Config.xml`** —
|
||||
на них держится авто-renewal. Detail: `.wiki/concepts/winacme-iis-owin-catchall-http01.md`.
|
||||
- **Не `Stop-Website snolla` пока хвост кэша течёт / без явного запроса** (warm rollback).
|
||||
- IIS-правки — elevated shell. **branch ahead от origin** — push без явного grant'а (Rule 4); grant НЕ давали.
|
||||
|
||||
## Memory updates за сессию
|
||||
|
||||
- (нет нового файла)
|
||||
- (нет нового файла; знание — в wiki concept + task decisions log)
|
||||
|
||||
## ⚠️ Sensitive (НЕ в git)
|
||||
|
||||
- Корневой `C:\sites\snolla\web.config` содержит plaintext-креды (MSSQL/SMTP/Azure/API-ключи). Pre-existing,
|
||||
не вводилось этой сессией. Если будешь декоммишить/архивировать — не плодить копии в трекаемых местах.
|
||||
|
||||
@@ -62,6 +62,7 @@ Migrate IIS hosting from [[../entities/windows-recovery-host]] (DESKTOP-NSEF0UK)
|
||||
- **На windows source 94.19.247.14** (16): `labtools.ru` + `www.labtools.ru`, `snolla.com` + 12× *.snolla.com (incl `rimiz.snolla.com`), `maljarka.tandemmebel.ru`, `tandemmebel.ru` + `www.tandemmebel.ru` (scope exception). TTL 86400s — не lowered.
|
||||
- **Live smoke** через real DNS: `kupimknigi.spb.ru`/`www.emspb.ru`/`www.pilorama98.ru`/`www.labtools.pro` → 200 OK + correct per-tenant title. Bare-domain 3 redirects работают (emspb/pilorama98/labtools.pro). `rimiz.ru` / `www.rimiz.ru` → 404 — pre-existing CMS-defect (тоже 404 на source), не migration regression.
|
||||
- **2026-06-05 (tandemmebel cutover — post-closure follow-up):** user (владелец tandemmebel) сам перенастроил DNS в reg.ru. Проверено `Resolve-DnsName`: `tandemmebel.ru` + `www.tandemmebel.ru` + `maljarka.tandemmebel.ru` → `80.64.31.36` (RUVDS) на authoritative ns1.reg.ru + 8.8.8.8 + 1.1.1.1 + Yandex. apex+CNAME сработал (www/maljarka follow apex автоматом). Smoke через real DNS: `tandemmebel.ru`/`www` → **200 OK** correct content; `maljarka.tandemmebel.ru` → **502** (pre-existing CMS-дефект, на source ровно так же — не регрессия cutover'а, см. Open questions). **Снимает прежнюю scope-exception 2026-05-24** (tandemmebel больше НЕ остаётся на windows). **Source НЕ заглушен** — user-decision держать как warm rollback: сайт `snolla` — общий catch-all, 11 `*.snolla.com` (incl `tandemmebel.snolla.com`) ещё резолвятся на `94.19.247.14`, полный `Stop-Website` невозможен; индивидуальное снятие 3 HTTPS-биндингов отложено до full-site decommission. Текущий баланс: **14 hostnames на RUVDS / 11 на windows-source**.
|
||||
- **2026-06-05 (LE auto-renewal pipeline построен — win-acme):** на RUVDS поднят постоянный self-renewing HTTP-01 pipeline (win-acme v2.2.9). Один **25-SAN cert** (store WebHosting, Issuer LE YR2, valid до **2026-09-03**) установлен во все 25 SNI-биндинга; **scheduled task `win-acme-renew-snolla`** (SYSTEM, daily, renew 55д до expiry). **Закрывает дедлайн cert-expiry 2026-07-22** и снимает зависимость RUVDS от домашнего traefik по сертификатам. Главный gotcha: OWIN-catch-all CMS (`owin:HandleAllRequests=true`) перехватывал `/.well-known/acme-challenge/` → решено выносом challenge-пути в **отдельное IIS-приложение в пуле «No Managed Code»** + патч шаблона `C:\win-acme\Web_Config.xml` (`<remove name="Owin"/>`). Staging + prod валидация всех 25 хостов зелёная; живые HTTPS-эндпоинты отдают новый cert (проверено TLS-смоком, incl maljarka/rimiz). Скрипт `scripts/iis-migration-to-ruvds/03-ruvds-winacme.ps1` + шаблон `winacme-Web_Config.xml`. Полный recipe: [[../.wiki/concepts/winacme-iis-owin-catchall-http01]].
|
||||
- **2026-06-05 (FULL CUTOVER достигнут):** проверка всех 25 hostname против authoritative ns1.reg.ru — **все → `80.64.31.36` (RUVDS), на windows-source authoritative не осталось ничего**. Вся зона `snolla.com` (apex + 10 субдоменов, независимые A-записи) переехала. Хвост кэша: `on.snolla.com` + `tandemmebel.snolla.com` ещё `94.19.247.14` на Google 8.8.8.8 (TTL 86400, дотекает; 1.1.1.1/Yandex уже RUVDS). RUVDS smoke: `snolla.com` 200 (default лендинг), `tandemmebel.snolla.com` 200 (tenant content). **Разблокирует decommission** `snolla` site + LE-renewal через win-acme+HTTP-01 (теперь challenge не отскочит на windows). **Source НЕ заглушен** — user-decision: 7-day soak warm rollback + ждём drain кэша. Целевой decommission ~2026-06-12; cert-renewal deadline ~2026-07-15 (certs expire 2026-07-22).
|
||||
- **2026-05-25 (close decision):** user-decision close — несмотря на 16 hostnames pending DNS swap + source IIS:8089 still live + LE renewal pipeline pending + cleanup pending, **task закрывается** на этом этапе. Reason: Phase 1 (RUVDS infra + scp + IIS recreate + cert import + 9 DNS swaps) выполнен и live; остальное — coordination/wait/decommission character, не agent-work load. Future actions перечислены в Closure note ниже, не trackable как `iis-migration-to-ruvds` continuation.
|
||||
|
||||
@@ -71,7 +72,7 @@ Migrate IIS hosting from [[../entities/windows-recovery-host]] (DESKTOP-NSEF0UK)
|
||||
- [ ] **Source IIS state backup НЕ снят** (skip'нули — appcmd требует elevated source-shell которого не было). Acceptable risk — source IIS всё ещё running как rollback. Если RUVDS proves stable за 1 неделю → можно decommission source без forensic snapshot'а.
|
||||
- [ ] **CMS-side 502/404 на 4 hostnames** — `maljarka.tandemmebel.ru` / `rimiz.ru` / `www.rimiz.ru` / `rimiz.snolla.com`. На source тоже не работают (return default page). Pre-existing dead-routes от `[iis-traefik-dead-routes-cleanup]` 2026-05-21. Изоляция не блокер для migration; защититься от cutover-blame — отдельная investigation если нужно.
|
||||
- [ ] **Backup strategy для RUVDS** — расширить `vds-backup-rsync-kreknin` cron как третий source? Решение отложено до после full cutover.
|
||||
- [ ] **LE renewal на RUVDS** — текущие certs valid до 2026-07-22 (~60 дней). До expiry нужен permanent renewal pipeline:
|
||||
- [x] **LE renewal на RUVDS** — ✅ DONE 2026-06-05 (win-acme HTTP-01, см. Decisions log + [[../.wiki/concepts/winacme-iis-owin-catchall-http01]]). Выбран Option A (win-acme + HTTP-01 после full cutover). Новый 25-SAN cert до 2026-09-03, авто-renewal через SYSTEM scheduled task. Дедлайн 2026-07-22 снят. ~~Историческая формулировка ниже:~~ текущие certs valid до 2026-07-22 (~60 дней). До expiry нужен permanent renewal pipeline:
|
||||
- Option A: win-acme (wacs.exe) standalone-на-RUVDS с DNS-01 (manual TXT на reg.ru — нет reg.ru-plugin) или HTTP-01 (но только после DNS swap'а — иначе LE challenge bounce'нется на home).
|
||||
- Option B: cron-job который re-extract'ит из traefik acme.json + scp upload + Import-PfxCertificate на RUVDS. Pollute source's traefik lifecycle.
|
||||
- Recommendation: Option A win-acme + HTTP-01 после full cutover (~95 days margin до cert expiry — 60 days minus DNS-stabilization window).
|
||||
@@ -105,9 +106,7 @@ Task **closed 🟢** per user decision. Phase 1 — RUVDS infra + cert pipeline
|
||||
|
||||
2. **Source IIS НЕ decommission'ен.** `localhost:8089` snolla site + port 80 catch-all still live на windows-recovery-host. Не трогать пока 16 hostnames на 94.19.247.14. После full cutover + 7-day soak — `Stop-Website snolla` + archive `C:\sites\snolla` (8.66GB) → kreknin.
|
||||
|
||||
3. **LE renewal pipeline НЕ построен.** Текущие RUVDS PFX certs valid до 2026-07-22 (~57 days от 2026-05-25). До этой даты нужен renewal-mechanism:
|
||||
- Recommend: win-acme на RUVDS + HTTP-01 challenge — **возможно только после full DNS cutover** (HTTP-01 bounce'нется на windows source pre-cutover, LE не сможет verify owners).
|
||||
- Soft deadline: ~2026-07-15 (week of margin до cert expiry).
|
||||
3. ~~**LE renewal pipeline НЕ построен.**~~ → **DONE 2026-06-05** (win-acme HTTP-01 после full cutover, как и рекомендовалось). Новый 25-SAN LE cert до 2026-09-03 + SYSTEM auto-renew task. Recipe: [[../.wiki/concepts/winacme-iis-owin-catchall-http01]].
|
||||
|
||||
4. **Temp SSH key cleanup не сделан.** Оставлены (могут понадобиться для будущих push'ей на RUVDS):
|
||||
- `~/.ssh/ruvds-iis-migration` + `.pub` на source workstation
|
||||
|
||||
Reference in New Issue
Block a user