docs(.wiki,.tasks): close cms-port-leak-fix — URL Rewrite serverVariables на host IIS
Port :8089/:4443 утечка в admin URLs закрыта. URL Rewrite 2.1 + apphost allowedServerVariables (HTTPS/SERVER_PORT/SERVER_PORT_SECURE) + Web.config rule на X-Forwarded-Proto=https → set SERVER_PORT=443/SERVER_PORT_SECURE=1/HTTPS=on ДО того как ASP.NET читает их в Url.SiteRoot(). Лечит все 11 cms (общий site snolla). Path B (traefik http entrypoint :80→:8090) abandoned — Docker Desktop WSL2 NAT quirk на host.docker.internal:80 возвращает 17-byte 301 plain text независимо от traefik internals. Quirk не reproducible на Linux Docker (synology). Side regression: pre-existing customErrors mode="off" lowercase в Web.config пробудился после ASP.NET full-reload (мой rewrite-block edit) — fixed (Off). Outside scope, open: emspb.snolla.com /admin/assets/<guid>/getList → 500 NullRef в AssetsJsonViewModelBuilder.cs:22 (model null от GetFolderByPath). User подтвердил «только этот site». Зафиксировано в snapshot open issue #8. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
15
STATUS.md
15
STATUS.md
@@ -1,6 +1,21 @@
|
||||
# Task Board
|
||||
_Updated: 2026-05-19_
|
||||
|
||||
## 🟢 [cms-port-leak-fix] — утечка `:8089`/`:4443` в admin URLs закрыта через URL Rewrite serverVariables
|
||||
**Status:** done (2026-05-19 вечер; verified user-side в браузере, остальные 10 cms работают). Detailed wiki concept — [[cms-server-port-leak-fix]].
|
||||
**Root cause:** `MoreThenCms.Admin\Mis\Web\Mvc\UrlHelpers\UrlHelpers.cs:14-37` `Url.SiteRoot()` читает `SERVER_PORT`/`SERVER_PORT_SECURE` из server vars, и в attempt2-host setup `SERVER_PORT=8089` → leak. Десятки .cshtml файлов (admin views + `_Layout`/`_LogInLayout`) рендерят это в `mis.siteRoot` и `<style background: url(...)>`. На VM работало просто потому что `SERVER_PORT=80` (см. SSH probe VM IIS bind = `*:80`).
|
||||
**Path tried (failed):** **B (traefik http entrypoint :80→:8090 + backend `host.docker.internal:80`)** — Docker Desktop's WSL2 NAT proxy на Windows перехватывает `host.docker.internal:80`/`gateway.docker.internal:80`/LAN IP :80 и возвращает 301 plain text **независимо** от того что traefik listening на :8090 inside. Quirk Windows Docker Desktop, не traefik. Не работает на этом стэке.
|
||||
**Path applied (working):** **C (URL Rewrite 2.1 + serverVariables в Web.config)**:
|
||||
1. URL Rewrite 2.1 MSI installed (rewrite_amd64_en-US.msi, 6 MB, version 7.1.1993.2351).
|
||||
2. `applicationHost.config` (admin): `<system.webServer>/rewrite/allowedServerVariables` += `HTTPS`, `SERVER_PORT`, `SERVER_PORT_SECURE` через `appcmd set config ... /commit:apphost`. Backup `.bak-pre-portleak-2026-05-19`.
|
||||
3. `C:\sites\snolla\Web.config` (per-site): `<system.webServer>/rewrite/rules` += rule "ForwardedProto-HTTPS" — match `.*`, condition `HTTP_X_FORWARDED_PROTO == "https"`, action None, serverVariables set `HTTPS=on`, `SERVER_PORT=443`, `SERVER_PORT_SECURE=1`. Backup `Web.config.bak-pre-portleak-2026-05-19` (size 19050 bytes). UTF-8 BOM сохранён.
|
||||
4. Smoke через `docker exec traefik wget https://127.0.0.1:443/admin/account/login --header='Host: emspb.snolla.com'` (через полный traefik HTTPS chain, traefik 2.x шлёт X-Forwarded-Proto: https автоматом) → `mis.siteRoot = 'https://emspb.snolla.com'` (БЕЗ `:8089`) ✅. То же для `labtools.snolla.com` ✅. **Затрагивает все 11 cms hosts** (общий site `snolla`).
|
||||
**Verified:** user-side public browser test confirmed — admin SPA loads без `:8089` в URL'ах для остальных 10 cms hosts. **Side regression** (pre-existing `customErrors mode="off"` lowercase — fatal config error после ASP.NET full-reload) — пойман и пофиксен (`mode="Off"`). **Outside scope (открыт):** `emspb.snolla.com /admin/assets/<guid>/getList` → 500 NullRef в `AssetsJsonViewModelBuilder.cs:22` (`model` null от `_assetsFoldersService.GetFolderByPath(ctx, ownerId, '')`) — user подтвердил «только этот site», CMS-side bug, не в scope. Зафиксировано в `recovery-architecture-snapshot` open issue #8.
|
||||
**Atomic revert:** `Copy-Item C:\sites\snolla\Web.config.bak-pre-portleak-2026-05-19 C:\sites\snolla\Web.config -Force` + ~3 сек app pool reload. apphost allowedServerVariables можно оставить (inert без rule). URL Rewrite MSI можно оставить (no rules = no behavior).
|
||||
**Branch:** master
|
||||
|
||||
---
|
||||
|
||||
## ⚪ [vds-kzntsv-bootstrap] — поднять облачный VDS под gitea/verdaccio/seafile/registry/hermes
|
||||
**Status:** ready (тариф **160 NVMe Rusonyx** заказан 2026-05-19; ждём выделение IP; OS Ubuntu 24.04)
|
||||
**Where I stopped:** заказ на Rusonyx размещён (6 vCPU / 8GB RAM / 160GB NVMe / Ubuntu 24.04, без ispmanager/Backup/CMS). zero-day bootstrap чек-лист готов. Detailed план в [vds-kzntsv-bootstrap.md](vds-kzntsv-bootstrap.md).
|
||||
|
||||
Reference in New Issue
Block a user