13 Commits

Author SHA1 Message Date
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
DVNILXP
ea71c77af5 feat: Add comprehensive telemetry system with GDPR compliance and enhanced metrics
- Add GDPR-compliant telemetry with explicit opt-in/opt-out on first run
- Implement privacy-friendly instance ID using random UUID (no fingerprinting)
- Add verbose telemetry logging mode with --verbose-telemetry flag
- Implement HMAC-SHA256 signature for telemetry payload verification
- Add comprehensive system metrics collection:
  - CPU: model, vendor, cores, threads, sockets, SMT detection, virtualization support
  - Memory: total RAM, swap usage
  - GPU: count, vendor, model, VRAM (min/max/avg), passthrough detection, per-vendor counts
  - Storage: ZFS/Ceph detection and pool counts
  - Proxmox VE: version, kernel series, cluster status, VM/container counts
- Add local development mode with configurable host and port (-l, -p flags)
- Implement telemetry consent management via config file and environment variable
- Add support footer with instance ID for easier issue reporting
- Improve privilege detection (root vs sudo vs none)
- Fix Proxmox repository configuration for no-subscription installations
- Enhance dependency installation with multiple fallback methods for jq
- Add robust UI dependency handling (whiptail/dialog)
- Improve error handling and user feedback throughout
- Fix CPU core/socket/thread detection accuracy
- Add telemetry logging to ~/.config/pecu/telemetry.log
- Show instance ID in release selector for support purposes

Security:
- Telemetry payload signed with HMAC-SHA256
- No collection of hostnames, IPs, usernames, or sensitive data
- Configurable via PECU_TELEMETRY environment variable or config file

Fixes:
- #18: Handle execution without sudo when running as root
- #19: Improved jq installation with multiple fallback methods
- Fix: Local variable scope issues
- Fix: Duplicated dependency installation restart block
- Fix: mkdir -p for jq installation to ~/.local/bin
- Fix: Robust UI functions that don't abort on terminal command failures
2025-12-10 16:46:54 +01:00
DVNILXP
cd29c22d96 TELEMETRY NOTICE
# This script collects OPTIONAL anonymous usage statistics to improve PECU.
#  - Data collected: instance_id (random UUID), PECU version/channel, OS/distro,
#    architecture, kernel, init system, Proxmox version/cluster/VMs/containers,
#    CPU (model/vendor/cores/threads/sockets/virtualization), RAM/swap,
#    GPU (count/vendor/model/VRAM/passthrough), storage tech (ZFS/Ceph).
#  - NOT collected: hostnames, IPs, usernames, file paths, disk space/usage.
#  - Control: Set PECU_TELEMETRY=off to disable, or PECU_TELEMETRY=on to enable.
#  - Config file: ~/.config/pecu/telemetry.opt (enabled/disabled/auto)
#  - Interactive prompt: On first run (if TTY), you will be asked once.
#  - More info: https://pecu.tools/telemetry (or your configured SITE)
2025-12-10 10:09:41 +01:00
DVNILXP
b17b60b983 fix: resolve sudo dependency issues in Proxmox environments
Fixes #18, #19

- Add privilege detection system (root/sudo/none)
- Implement run_as_admin() helper for cross-privilege compatibility  
- Add multiple fallback methods for jq installation (direct binary, snap, static)
- Add user consent prompts before any package installation
- Improve repository configuration for Proxmox environments
- Add interface reload after dependency installations
- Enhance error handling and user feedback
- Modularize code structure for better maintainability
2025-08-11 10:32:36 +02:00
DVNILXP
ad7ce07bf2 feat: Add CI workflow for template validation and rendering
- Introduced a GitHub Actions workflow to lint, validate, and render templates on pull requests and pushes to the main branch.
- Added steps for installing necessary tools, running Yamllint, validating JSON schemas, and performing dry-run renders of templates.

chore: Configure pre-commit hooks for YAML and JSON validation

- Set up pre-commit hooks for yamllint, shellcheck, and JSON schema validation to ensure code quality and adherence to standards.

style: Add yamllint configuration

- Created a .yamllint.yaml file to customize yamllint rules, disabling line length checks and configuring truthy checks.

feat: Implement template rendering script (qm.sh)

- Developed a bash script (qm.sh) to translate YAML templates into Proxmox `qm` commands, supporting various VM configurations and storage options.

feat: Create template control script (templatectl.sh)

- Added a CLI script (templatectl.sh) for managing VM templates, including commands for listing, validating, rendering, and applying templates.

docs: Add README for templates directory

- Created a README.md file in the templates directory to provide an overview of the structure, requirements, and usage examples for VM templates.

feat: Add VM templates for Linux and Windows

- Introduced YAML templates for Linux Workstation and Media Server, as well as a Windows Gaming template, each with specific configurations and metadata.

feat: Define JSON schema for VM templates

- Created a JSON schema (template.schema.json) to validate the structure and required fields of VM templates, ensuring compliance with the defined specifications.
2025-08-06 12:39:37 +00:00
DVNILXP
b6c0122f0d Release-selector: solid CLI refactor
• Static ASCII header now shows author name + BuyMeACoffee link.  
• Added automatic installation prompt for optional UI helpers
  (whiptail / dialog) while keeping core deps unchanged.  
• Switched download strategy:
      – fetch script to a secure tmp file, execute and keep stdin
      – fallback to .tar.gz asset if raw scripts are missing / exit <3 s  
• Fixed “unbound variable” crashes:
      – replaced stray $path with local “rel” in run_raw()
      – pre-declare ui_missing=() when set -u is active.  
• Still hides Deprecated / Obsolete / Retired releases; no new PECU-Channel
  tags were added.  
• Preserved colour mapping for Stable / Beta / Preview / Experimental /
  Nightly / Legacy.
2025-06-19 12:13:06 +02:00
DVNILXP
fb5d59969f Update pecu_release_selector.sh 2025-06-17 16:30:16 +02:00
DVNILXP
f565cb02fc Updated the PECU version selector with an improved ASCII-based menu and removed the legacy script.
Comments have been added to facilitate version customization, and obsolete files like versions.conf and pecu_release_selector_old.sh have been deleted.
2025-06-17 13:10:32 +00:00
DVNILXP
5584efbf4f Old-release- selector 2025-05-14 19:28:33 +02:00
DVNILXP
8de1714493 Add fallback selector script and versions.conf 2025-05-14 14:55:41 +00:00
DVNILXP
015fe81dc3 whiptail --menu-release-selector 2025-05-14 14:46:06 +00:00
DVNILXP
f2c3a39c38 Update PECU ASCII
Update PECU ASCII
2025-04-15 11:40:49 +02:00
Danilop95
f72b4b4c01 Add PECU Release Selector and Proxmox Configurator scripts
- Introduced `pecu_release_selector.sh` to fetch and select PECU releases from GitHub.
- Implemented network connectivity checks and dependency installation for `curl` and `jq`.
- Created a user-friendly release selection menu with color-coded stable and pre-release versions.
- Added `proxmox-configurator.sh` for configuring GPU passthrough on Proxmox systems, including advanced kernel tweaks and driver management.
- Implemented logging functionality and state management for backup and restore operations.
- Enhanced user interaction with prompts for GPU detection and passthrough configuration methods.
2025-04-14 16:07:06 +02:00