Files
DVNILXP 3cdcd66b7d feat(telemetry): Add JSON preview mode, support info display, and enhanced metrics collection
Enhanced telemetry system with comprehensive privacy controls and debugging capabilities:

**New Features:**
- JSON preview mode (-j/--json-preview): Display telemetry payload without sending
  - Shows exact JSON structure sent to API for transparency
  - Saves preview to ~/.config/pecu/telemetry-preview.json
  - Opens in pager (less/more) for easy review and text selection
- Support mode (-s/--support-info): Generate support token for troubleshooting
  - Automatically enables telemetry and displays Instance ID
  - Shows formatted support token (PECU-XXXX-XXXX-XXXX format)
  - Includes system summary (version, channel, profile, Proxmox detection)
  - Handles both success and failure scenarios with retry instructions

**Enhanced Telemetry Metrics:**
- Proxmox subscription mode detection (enterprise/no-subscription/test)
- High Availability (HA) status detection from /etc/pve/ha/*.cfg
- Root filesystem type detection (ZFS/btrfs/ext4/xfs/LVM combinations)
- Storage types enumeration from /etc/pve/storage.cfg (anonymous, no IDs)
- Improved CPU topology detection:
  - Fixed physical CPU socket counting (unique physical IDs only)
  - Added cores per socket calculation
  - Added threads per core detection (SMT/Hyperthreading)
  - Enhanced validation with fallback logic
- Enhanced GPU VRAM metrics:
  - Total VRAM across all GPUs
  - Min/max/average VRAM calculations
  - VRAM known count for accurate statistics

**Improvements:**
- Better error handling for telemetry failures in support mode
- Verbose telemetry logging with detailed payload/response display
- Enhanced local development mode with full telemetry debugging
- Improved HMAC signature generation with multiple fallback methods (xxd/od/openssl)
- Support token generation from Instance ID for easier support correlation
- Date updated in header from 2025-11-25 to 2025-12-10

**Privacy & Compliance:**
- All new metrics maintain GDPR compliance (no personal data collected)
- Storage types collected without IDs, names, or paths
- Subscription mode detection doesn't expose license keys
- HA detection only confirms presence, no configuration details

**User Experience:**
- Clear visual feedback for support mode with bordered output
- Color-coded messages for better readability
- Helpful retry instructions on telemetry failures
- Support token display for easy copy-paste to support team
- JSON preview with syntax highlighting in terminal

**Technical Details:**
- HMAC signature validation enhanced (checks for 64-char hex format)
- JSON payload validation before sending
- Telemetry event logging for all operations
- Graceful degradation when optional tools (xxd/od) unavailable
- Support for both interactive and non-interactive modes

This update significantly improves transparency and debuggability while
maintaining strict privacy standards and providing better support workflows.
2025-12-11 10:54:07 +01:00
..