From 7a005f7b060bad9c707953876dae9376a513e402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Sun, 12 Jul 2026 08:34:40 +0400 Subject: [PATCH] =?UTF-8?q?History:=20=D1=80=D0=B5=D0=B7=D1=83=D0=BB=D1=8C?= =?UTF-8?q?=D1=82=D0=B0=D1=82=D1=8B=20=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D0=BD=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- History/2026-07-12-audit-and-plan.md | 52 +++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/History/2026-07-12-audit-and-plan.md b/History/2026-07-12-audit-and-plan.md index 343a9e0..4c04502 100644 --- a/History/2026-07-12-audit-and-plan.md +++ b/History/2026-07-12-audit-and-plan.md @@ -86,7 +86,57 @@ site/ # Flask-приложение --- -## Переменные окружения (для Штурвала) +## Результат рефакторинга (2026-07-12) + +### Итоговая структура + +``` +drhider/ # Пакет ядра обфускации +├── __init__.py # re-export: obfuscate_files, LLMClient, TwoPassObfuscator +├── config.py # Константы: ENTITY_PATTERNS, словари имён/городов/улиц +├── checksum.py # Контрольные суммы: ИНН10, ИНН12, ОГРН +├── random_utils.py # Утилиты: random_digits, random_letters +├── llm_client.py # LLMClient — HTTP-клиент к LLM API +├── extractor.py # Извлечение текста + expand_zips + convert_pdfs_to_docx +├── scanner.py # Проход 1: scan_regex, scan_llm_ner +├── replacer.py # Проход 2: apply_replacements, replace_in_docx, replace_in_text +├── builder.py # Сборка: build_zip, build_mapping_csv +├── obfuscator.py # TwoPassObfuscator — оркестратор +└── generators/ # Генераторы фиктивных значений + ├── __init__.py # ENTITY_GENERATORS маппинг + ├── phone.py, email.py # Телефон, email + ├── inn.py, ogrn.py, kpp.py # ИНН, ОГРН, КПП + ├── bik.py, accounts.py # БИК, счета (р/с, к/с) + ├── passport.py # Паспорт + ├── company.py, person.py # Компания, ФИО + └── address.py # Адрес + +site/ # Flask-приложение +├── app.py # create_app() + VERSION (20 строк) +├── routes/ +│ ├── __init__.py # register_routes() +│ ├── main_bp.py # GET / +│ ├── health_bp.py # GET /health +│ └── api_bp.py # POST /api/drhider +├── templates/index.html +└── static/favicon.svg +``` + +### Что изменилось + +| Было | Стало | +|---|---| +| `drhider.py` — 560 строк монолит | Пакет `drhider/` — 22 модуля по 20–100 строк | +| `site/app.py` — 100 строк (всё в одном файле) | `app.py` 33 строки + 3 blueprint'а по 20–50 строк | +| `Dockerfile` | Удалён (Штурвал сам) | +| `drhider_server.py` | Удалён (Flask заменяет) | + +### Коммиты + +- `a2f754a` — Фаза 1: удалён Dockerfile, drhider_server.py, gunicorn +- `37581eb` — Фаза 2: config.py, checksum.py, random_utils.py, generators/ +- `2cf4e08` — Фаза 2: llm_client.py, extractor.py, scanner.py, replacer.py, builder.py, obfuscator.py +- `51bc1a7` — Фаза 2: site/app.py → blueprint'ы, старый drhider.py удалён | Переменная | Значение | |---|---|