Commit a71abb9
feat: enhanced support export with anonymized preview modal and Protokoll tab (#95)
* feat: API key auto-generate on first start + anonymized support export
- Auto-generate 64-char hex API key on first start if not set via env or
DB; saved to config_entries so it survives restarts and is visible in
Settings → Security (like Sonarr/Radarr)
- Add GET /api/v1/auth/bootstrap (localhost-only) so the SPA can
self-configure its API key without manual copy-paste; stored in
localStorage, picked up by the existing axios interceptor
- bootstrapApiKey() called in main.tsx before first render — no key
already in localStorage = one silent preflight fetch, then normal flow
- Add GET /api/v1/logs/support-export: anonymized ZIP bundle for
developer debugging; strips API keys, passwords, IPs, email addresses,
and absolute paths before packaging log files + system-info.txt
* docs: support export design spec
* docs: finalize support export design spec; fix vite ws proxy changeOrigin
* docs: add support export implementation plan
* feat: add module-level _anonymize() with RFC1918 IP classification and dynamic hostname
Adds _classify_ip() and _anonymize() helpers to backend/routes/system.py
for redacting IPs (RFC1918 partial, public full), API keys, emails, Unix
home paths, and arbitrary file paths from log text. Hostname redaction is
resolved at call time via socket.gethostname() unless passed explicitly.
Creates backend/tests/test_support_export.py with 10 TDD unit tests
covering all anonymization rules (all green).
* fix: correct _UNIX_HOME_RE to handle /root/ paths; add test
- Change _UNIX_HOME_RE from `/(?:home|root)/[^/\s]+(/[^\s]*)` to
`/(?:home/[^/\s]+|root)(/[^\s]+)` so /root/.bashrc → ~/.bashrc
(previously /root was parsed as the home dir, requiring a second /
that never appeared, causing the pattern to not match)
- Add _IP_RE comment documenting the version-string over-redaction trade-off
- Add test_root_path_shortened to TestAnonymize
* feat: add _build_diagnostic(), _extract_top_errors(), _get_last_scan_minutes() helpers
* feat: add /logs/support-preview endpoint; enhance /logs/support-export with full ZIP contents
* feat: add i18n keys for ProtokollTab and support export modal (en + de)
* feat: add fetchSupportPreview and downloadSupportBundle to API client
* feat: add ProtokollTab with log settings, viewer prefs, and support export modal
* feat: add Protokoll tab to System settings group; remove log_level from General tab
* feat: remove rotation UI from Logs; apply log viewer category filter and display prefs
- Remove useLogRotation, useUpdateLogRotation hooks and rotation state
- Remove rotation collapsible JSX block (lines 227-304)
- Remove ChevronDown, ChevronUp, Save, Loader2, toast imports (no longer used)
- Add CATEGORY_PREFIXES module-level constant for log category filtering
- Add logViewPrefs (localStorage reader), isLineVisible, formatLine, visibleLogs
- Wire virtualizer and empty-state check to visibleLogs instead of filtered
- Apply formatLine() and wrapLines style to each rendered log entry
- Remove rotation i18n keys from en/logs.json and de/logs.json
* fix: correct i18n key for Protokoll tab in TAB_KEYS
protokoll_tab is defined at the root of settings.json, not under the
tabs namespace. TAB_KEYS was using 'tabs.protokoll_tab' which would
silently fall back to the raw key string in the UI.
---------
Co-authored-by: Abrechen2 <179815050+DennisSico@users.noreply.github.com>1 parent 58c256b commit a71abb9
File tree
17 files changed
+3197
-143
lines changed- backend
- routes
- tests
- docs/superpowers
- plans
- specs
- frontend
- src
- api
- i18n/locales
- de
- en
- lib
- pages
- Settings
17 files changed
+3197
-143
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
351 | 360 | | |
352 | 361 | | |
353 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
39 | 60 | | |
40 | 61 | | |
41 | 62 | | |
| |||
0 commit comments