1614 Commits

Author SHA1 Message Date
CanbiZ (MickLesk)
ed3af96585 Add extended dashboard metrics and helpers
Extend FetchDashboardData to collect additional metrics: tool executions, addon installations, GPU usage (including passthrough), error categories, and install durations for averaging. Populate new Dashboard fields (GPUStats, ErrorCategories, TopTools, TopAddons, AvgInstallDuration) and add helper builders (buildGPUStats, buildErrorCategories, buildToolStats, buildAddonStats) that sort results and trim to top-N where appropriate. Keeps existing daily stats and recent records logic unchanged.
2026-02-10 08:16:39 +01:00
CanbiZ (MickLesk)
182bf36346 Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED 2026-02-10 08:15:15 +01:00
CanbiZ (MickLesk)
887a899f24 Extend telemetry reporting and ingestion
Add extended telemetry functions and server-side support: misc/api.func gains helpers (categorize_error, install timer, detect_gpu) and new reporters for tools, addons, and an extended post_update_to_api with duration, GPU and error_category. misc/data/service.go updated to accept and validate new fields (type: tool/addon, tool_name, parent_ct, gpu_vendor, gpu_passthrough, install_duration, error_category), expand allowed enums, include new fields in UpsertTelemetry and mapping, and add input sanitization. Also add telemetry-ingest.exe binary. These changes enable richer telemetry (tool/addon events, GPU info, durations and categorized errors) and server ingestion/validation for them.
2026-02-10 08:14:45 +01:00
Tobias
3e20781f88
Use APPLICATION_VERSION for version in fetch functions 2026-02-10 08:10:54 +01:00
CanbiZ (MickLesk)
6f747ed36d Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED 2026-02-10 08:09:33 +01:00
CanbiZ (MickLesk)
b034d5b05d Fix telemetry typo and simplify microcode script
Correct telemetry status spelling ("sucess" → "success") and map status values accordingly. Normalize EOF/newline handling in several misc/data files. Major refactor of tools/pve/microcode.sh: update copyright/author, remove the verbose CPU detection/display helpers, simplify current microcode detection, streamline package discovery and selection logic, switch wget to curl, clean up download/install flow (use basename and remove /tmp usage), simplify UI/messages and exit handling, and remove live microcode reload/version post-install checks.
2026-02-10 08:09:26 +01:00
Tobias
4cd72cc2ec
Add APPLICATION_VERSION export to build function 2026-02-10 08:08:24 +01:00
MickLesk
7915237622 fix(telemetry): fix typo 'sucess' -> 'success' everywhere
Some checks failed
Update GitHub Versions (New) / update-github-versions (push) Has been cancelled
Update Versions from GitHub / update-versions (push) Has been cancelled
2026-02-09 18:47:34 +01:00
MickLesk
b5960db4f9 fix(telemetry): fix migration - map 'done' to 'sucess', handle ct_type=0, detect duplicates 2026-02-09 18:46:26 +01:00
MickLesk
6a77427448 fix(telemetry): add PocketBase authentication to migration script 2026-02-09 18:41:55 +01:00
MickLesk
5b43016594 fix(telemetry): support PB_URL and PB_TARGET_COLLECTION env vars for Coolify 2026-02-09 18:38:59 +01:00
MickLesk
2ab7de60b2 chore(telemetry): remove docker-compose.yml (not needed for Coolify) 2026-02-09 18:36:35 +01:00
MickLesk
0226a043b8 feat(telemetry): add caching, alerts, migration & dashboard improvements
- Add Redis/in-memory caching layer (cache.go)
- Add SMTP alerting for high failure rates (alerts.go)
- Add data migration script from old API (migrate.go)
- Add docker-compose.yml for easy deployment
- Move dashboard to / with redirect from /dashboard
- Add dark/light mode toggle
- Add error analysis and failed apps statistics
- Add PVE version and LXC/VM type stats
- Add /metrics Prometheus endpoint
- Add /api/records pagination endpoint
- Add CSV export functionality
- Enhanced healthcheck with PB connection status

New ENV vars:
- Cache: ENABLE_CACHE, CACHE_TTL_SECONDS, ENABLE_REDIS, REDIS_URL
- Alerts: ALERT_ENABLED, SMTP_*, ALERT_FAILURE_THRESHOLD, etc.
- Migration: RUN_MIGRATION, MIGRATION_REQUIRED, MIGRATION_SOURCE_URL
2026-02-09 18:33:33 +01:00
CanbiZ (MickLesk)
897707645f add static go dashboard 2026-02-09 17:13:08 +01:00
CanbiZ (MickLesk)
88a540e457 Support PATCH updates for telemetry status
Send only changing fields for status updates and add server-side update flow.

- Trimmed telemetry JSON payload in misc/api.func to include only status, error, and exit_code (removed static fields and pve_version) so updates are minimal.
- Added TelemetryStatusUpdate type and new PBClient methods: FindRecordByRandomID, UpdateTelemetryStatus, and UpsertTelemetry in misc/data/service.go. UpsertTelemetry creates a record for status="installing", otherwise finds the record by random_id and PATCHes only status/error/exit_code (fallbacks to create if not found).
- Relaxed validation logic in validate(): detect updates (status != "installing") and skip certain strict numeric checks for update requests while keeping required fields and other validations.
- Main handler now calls UpsertTelemetry instead of CreateTelemetry and logs generic errors.

These changes allow idempotent, minimal updates to existing telemetry records and avoid repeatedly sending/storing unchanged metadata.
2026-02-09 17:07:30 +01:00
CanbiZ (MickLesk)
878672a8df Update api.func 2026-02-09 17:04:15 +01:00
CanbiZ (MickLesk)
5aa85ace6a Add telemetry debug/logging and failure report
Enhance post_update_to_api robustness and observability: add debug traces for entry, missing curl, duplicate submissions, DIAGNOSTICS/RANDOM_UUID checks, payload/URL output, and HTTP response code capture; make curl non-blocking and tolerant of failures. Also invoke post_update_to_api on installation failure so build/install errors are reported to telemetry. Includes a small comment glyph fix in build.func. Changes keep telemetry as a silent, best-effort path that won't break script execution.
2026-02-09 16:53:25 +01:00
CanbiZ (MickLesk)
ce375b02aa Refactor telemetry checks, relax method validation
Reformat telemetry pre-checks in misc/api.func for clearer multi-line condition handling and remove stray whitespace around the curl response logging. Tweak misc/build.func comment line (minor encoding/visual cleanup). In misc/data/service.go remove the strict allowedMethod map and its validation so the 'method' field is treated as optional/flexible; keep sanitization and numeric validations unchanged. These changes improve readability and allow custom method values without breaking behavior.
2026-02-09 16:51:51 +01:00
CanbiZ (MickLesk)
7c3688cd0a debug 2026-02-09 16:48:47 +01:00
CanbiZ (MickLesk)
bcc6bb9f5f Update build.func 2026-02-09 16:46:25 +01:00
CanbiZ (MickLesk)
4a8a4180d9 use https 2026-02-09 16:20:43 +01:00
CanbiZ (MickLesk)
fafdf88e6a Update build.func 2026-02-09 16:12:35 +01:00
CanbiZ (MickLesk)
313da7c00c Switch telemetry to ingest service
Replace direct PocketBase integration with a fire-and-forget telemetry ingest endpoint and tighten validation. misc/api.func: point to telemetry.community-scripts.org, add TELEMETRY_TIMEOUT, use DIAGNOSTICS=no opt-out, include random_id/NSAPP/status in payloads, unify LXC/VM POSTs, avoid blocking or failing scripts, remove PocketBase record lookup/patch logic. misc/data/service.go: update TelemetryIn/TelemetryOut schemas to match new payload, add stricter sanitization and enum/range validation, adjust hashing/deduplication usage, and update request logging to reflect nsapp/status. Overall: safer, non-blocking telemetry with improved schema validation and GDPR-friendly behavior.
2026-02-09 16:06:44 +01:00
CanbiZ (MickLesk)
7759b53297 Update Dockerfile 2026-02-09 15:53:43 +01:00
CanbiZ (MickLesk)
7bd2ba7b54 Add telemetry-ingest service and Docker updates
Introduce a new telemetry ingestion service (misc/data/service.go) that implements an HTTP server to accept telemetry payloads, validate and sanitize inputs, apply rate limiting, compute dedupe hashes, and forward records to PocketBase with token-based auth. Add module file (misc/data/go.mod) setting module telemetry-ingest and Go version 1.25.5. Update Dockerfile to use golang:1.25-alpine and remove baked-in environment defaults (so runtime envs are required), keeping the build stage and final CMD. These changes add the core ingestion logic, dependency module, and align the build image/version.
2026-02-09 15:53:11 +01:00
CanbiZ (MickLesk)
6fea133392 Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED 2026-02-09 15:43:22 +01:00
CanbiZ (MickLesk)
7f0ca0f9d0 Add Dockerfile and move ingest service
Containerize the telemetry ingest service and reorganize source layout. Added misc/data/Dockerfile with a multi-stage build (golang:1.23-alpine -> alpine:3.23) to produce /app/telemetry-ingest, run as a non-root user, expose :8080, and provide default env vars for configuration (LISTEN_ADDR, MAX_BODY_BYTES, RATE_LIMIT_RPM, RATE_BURST, RATE_KEY_MODE, ENABLE_REQUEST_LOGGING, UPSTREAM_TIMEOUT_MS). Renamed misc/ingest.go to misc/data/service.go to reflect the new directory structure.
2026-02-09 15:38:29 +01:00
CanbiZ (MickLesk)
0e16e3fd63 Update ingest.go 2026-02-09 15:34:22 +01:00
CanbiZ (MickLesk)
820d4551a1 Replace Go API with PocketBase; update docs
Remove the old Go/Mongo API (api/main.go, go.mod, go.sum, .env.example) and switch telemetry backend to PocketBase (http://db.community-scripts.org). Update documentation and flowcharts to reflect the PocketBase collection (_dev_telemetry_data), new REST endpoints (POST/PATCH/GET), field schema, and revised api.func integration (LXC/VM reporting and status updates). Misc scripts and helpers were adjusted (misc/api.func, misc/build.func, misc/error_handler.func) and a new misc/ingest.go was added. This consolidates telemetry to a hosted PocketBase instance and updates docs and integration points accordingly.
2026-02-09 15:34:17 +01:00
Finn Joshua Bartels
3232665b92 feat(core): dev mode configurator menu
- Implement interactive Whiptail checklist for dev_mode configuration
- Add logic to read and pre-populate menu from existing dev_mode enviorment var
2026-02-09 11:49:02 +01:00
CanbiZ (MickLesk)
0b20d464c5 port ssh keys from build.func into cloudinit 2026-02-04 11:21:33 +01:00
CanbiZ (MickLesk)
e7057f29d4 Add interactive SSH key selection for cloud-init
Make SSH key provisioning explicit and interactive for cloud-init VMs. Default CLOUDINIT_SSH_KEYS is now empty; new helper functions discover and extract public keys from common host files, count them, and present a whiptail menu (import all host keys, paste one key, specify a file, or none). configure_cloudinit_ssh_keys writes selected keys to a temp file and sets CLOUDINIT_SSH_KEYS accordingly (removing the temp file if empty). setup_cloud_init now only applies --sshkeys when CLOUDINIT_SSH_KEYS is explicitly provided and logs the source, and vm/docker-vm.sh invokes the key selection UI for cloud-init VMs.
2026-02-04 11:16:41 +01:00
CanbiZ (MickLesk)
cc10993edb Update vm-core.func 2026-02-03 14:27:09 +01:00
CanbiZ (MickLesk)
b9cbfef0ca Improve logging, error handling, and messages
Add new icons and message helpers; introduce get_active_logfile and enhance silent() to redirect output to a proper log file (BUILD_LOG or /tmp fallback), preserve/propagate exit codes, temporarily disable traps while running commands, source explain_exit_code for human-friendly error explanations, and show the last 10 log lines on failure. Also sanitize keys when unsetting MSG_INFO_SHOWN to avoid ANSI/control-char issues, add msg_warn and fatal helpers, and make msg_custom skip empty messages. These changes improve observability and robustness of VM creation scripts and error reporting.
2026-02-03 14:18:57 +01:00
CanbiZ (MickLesk)
49318cc629 remove ssh check 2026-02-03 14:11:38 +01:00
MickLesk
2e1ee2d853 feat(tools): add fetch_and_deploy_codeberg_release function
Some checks failed
Update GitHub Versions (New) / update-github-versions (push) Has been cancelled
Cleanup Branches (Merged or Closed) / cleanup (push) Has been cancelled
Update Versions from GitHub / update-versions (push) Has been cancelled
Add Codeberg equivalent of fetch_and_deploy_gh_release supporting:
- tarball/source mode for source code archives
- binary mode for .deb packages
- prebuild mode for prebuilt archives
- singlefile mode for standalone binaries
- tag mode for direct tag downloads

Uses Codeberg API and archive URL patterns:
- API: https://codeberg.org/api/v1/repos/{owner}/{repo}/releases
- Archive: https://codeberg.org/{owner}/{repo}/archive/{tag}.tar.gz
2026-02-01 20:35:40 +01:00
CanbiZ (MickLesk)
abb15a6ec8 devuan fixes 2026-01-30 10:21:55 +01:00
CanbiZ (MickLesk)
edac4a2293 Update install.func 2026-01-30 09:59:11 +01:00
CanbiZ (MickLesk)
dc5c1d3ef0 Improve locale setup and database user privileges
Add command to grant superuser, createrole, and createdb privileges to the postgres user during Databasus installation. Enhance LXC container customization by installing locales for Devuan templates and only configuring locale if locale.gen exists, improving compatibility with minimal templates.
2026-01-30 09:47:38 +01:00
Justin
62f68959c7 Remove inline comment in misc/tools.func
Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>
2026-01-29 10:24:13 +01:00
Justin
f2a847ac81 Remove inline comment in misc/alpine-tools.func
Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>
2026-01-29 10:24:13 +01:00
justin
75898f4986 Add tail -1 before tr to use only the last value 2026-01-29 10:24:13 +01:00
justin
622fda4b32 Fix download_with_progress() content_length calc 2026-01-29 10:24:13 +01:00
justin
54bbdc180a Remove inline comment in misc/alpine-tools.func 2026-01-29 10:23:17 +01:00
justin
f4495280cf AWK output needs to be sanitized 2026-01-29 10:23:17 +01:00
justin
16d0ffa19a $pattern doesn't need to be a parameter 2026-01-29 10:23:17 +01:00
justin
bf97037ba5 Remove bad quotes 2026-01-29 10:23:17 +01:00
justin
d7d16543e5 Fix url assignment in fetch_and_deploy_gh_release 2026-01-29 10:23:17 +01:00
justin
000a7a2701 Fix Error check and error message style 2026-01-29 10:21:41 +01:00
justin
8c4f1ce531 Make check_container_storage() POSIX compliant 2026-01-29 10:21:41 +01:00