docs(runtime-logs): implement runtime log management features

Добавлены новые возможности для работы с файловыми логами Docker-сервисов:
- Эндпоинты для получения списка логов и хвоста лог-файла.
- Очистка лог-файлов с возможностью выбора режима (truncate или delete) и запись в аудит очистки.
- Обновлена документация и конфигурация для поддержки новых функций.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-06-12 19:04:53 +07:00
co-authored by Cursor
parent 1c39c65fc5
commit 3f0dd6c234
25 changed files with 1235 additions and 66 deletions
+15 -16
View File
@@ -3,29 +3,28 @@
## Текущий фокус
**Task:** `settings-ui-and-runtime-logs`
**Complexity:** Level 4
**Phase:** **CREATIVE complete****`/build`**
**Phase:** **BUILD Phase 2 complete****Phase 3** (HTTP handlers)
## Creative decisions (кратко)
## Phase 2 deliverables
| CP | Решение |
|----|---------|
| CP-1 | `/tenant-settings` + Tabs; mainNav «Параметры»; `/settings` = frontend |
| CP-2 | Monitoring tab `runtime-logs`; sub-tabs `files` / `audit` |
| CP-3 | Cleanup default `truncate`; max 512 MiB; tail 200 lines (max 2000), 256 KiB cap |
| CP-4 | Regex `^[a-z0-9][a-z0-9_.-]*\.log$` + EvalSymlinks + root prefix |
- `internal/runtimelogs/` — Config, Service, safe path, List/Tail/Cleanup
- `EVOBGP_RUNTIME_LOGS_DIR` в `internal/config/config.go`
- `docs/access.md` — документация env
## Коммиты creative (local, no push)
## Ключевые константы
1. `ceb6f2f` — CP-1 tenant settings UI
2. `e27936c` — CP-2 runtime logs UI
3. `493575a` — CP-3 cleanup & tail
4. (pending) — CP-4 path safety
- Guard: `EVOBGP_SERVICE=evobgp-all` + non-empty absolute `EVOBGP_RUNTIME_LOGS_DIR`
- Cleanup max: 512 MiB; tail: 200 default, 2000 max, 256 KiB read cap
## Тесты
- `go test ./internal/runtimelogs/...` — pass
- `scripts/lint-go.ps1` — pass
## Следующий шаг
```
/build Phase 1
/build Phase 3
```
OpenAPI + migration `000026` + store (см. `tasks.md`).
HTTP handlers + routes для `/v1/runtime-logs/*`.