Commit Graph

1664 Commits

Author SHA1 Message Date
tremor021
2afbe78348 Add fetch_and_deploy_gl_release 2026-03-04 12:34:52 +01:00
CanbiZ (MickLesk)
fdc30949e3 feat(preflight): add enterprise repo subscription check
- New preflight_repo_access() warns if enterprise repos are active without subscription
- Scans /etc/apt/sources.list.d/ for enterprise.proxmox.com entries
- Tests HTTP access (detects 401/403 Unauthorized)
- Warning only — not a blocker (packages come from pve-no-subscription repo)
2026-03-03 14:42:59 +01:00
CanbiZ (MickLesk)
d242100531 refactor(preflight): move to install_script, clean UX flow
- Move run_preflight from build_container() into install_script() after header_info
- Shows: Header → preflight checks → 2s pause → clear (via next header_info call)
- On failure: show summary + exit cleanly (no ERR trap)
- Change all return 1 → return 0 in preflight functions (prevents ERR trap under set -Ee)
- Remove PREFLIGHT_DONE guard from build_container (no longer needed)
2026-03-03 14:10:03 +01:00
CanbiZ (MickLesk)
4254e15bba Update build.func 2026-03-03 14:06:26 +01:00
CanbiZ (MickLesk)
c35cfb59fb Update build.func 2026-03-03 13:51:20 +01:00
CanbiZ (MickLesk)
e29561e401 Update build.func 2026-03-03 13:40:40 +01:00
CanbiZ (MickLesk)
1ae3275248 Add template availability preflight check
Introduce preflight_template_available() in misc/build.func to verify a matching OS/version template exists locally or in the online pveam catalog, and to fail early with a helpful list of available versions when none is found (exit code 225). Integrate this check into run_preflight. Also move the run_preflight invocation inside install_script to run after header_info (so preflight output is visible) and remove the earlier preflight call.
2026-03-03 13:36:02 +01:00
CanbiZ (MickLesk)
ed0e6ed49c linting 2026-03-03 13:30:25 +01:00
CanbiZ (MickLesk)
cb648eec9c Track preflight aborts and add exit codes
Add preflight/validation exit codes and telemetry reporting for aborted preflight checks. Introduces new exit codes (103-110) and maps them to a new "preflight" error category. Adds post_preflight_to_api(), a fire-and-forget telemetry sender that posts an "aborted" status and detailed error summary (only when diagnostics/UUIDs are present), and extends post_update_to_api() to handle an "aborted" status. Changes are defensive (no blocking failures, short curl timeout) and aim to improve analytics for validation/preflight failures.
2026-03-03 13:28:41 +01:00
CanbiZ (MickLesk)
f0c4843784 preflight dev 2026-03-03 13:27:42 +01:00
CanbiZ (MickLesk)
80cc18f9e1 Revert "[Linting] misc/build.func (first pass)" 2026-03-02 15:32:35 +01:00
CanbiZ (MickLesk)
c29b00c97e Merge branch 'main' into lint-build-func 2026-03-02 15:02:31 +01:00
CanbiZ (MickLesk)
2171cfb09d merge from VE 2026-03-02 09:18:02 +01:00
CanbiZ (MickLesk)
d16008181d merge build.func 2026-02-24 09:47:12 +01:00
CanbiZ (MickLesk)
4e2b64524f merge vmcore 2026-02-24 09:41:40 +01:00
CanbiZ (MickLesk)
00fa5a0492 merge api.func 2026-02-24 09:39:37 +01:00
CanbiZ (MickLesk)
192452a3fd merge tools.func 2026-02-24 09:38:46 +01:00
CanbiZ (MickLesk)
81e39c0680 merge error_handler 2026-02-24 09:36:33 +01:00
CanbiZ (MickLesk)
2be37f5e00 merge core.func from VE 2026-02-24 09:35:08 +01:00
CanbiZ (MickLesk)
6881dc9de1 cleanup 2026-02-24 09:32:56 +01:00
MickLesk
155c0a00e4 feat: add Postiz app, fix silent() for || fallbacks 2026-02-22 17:46:38 +01:00
MickLesk
5ab302102b refactor: clean COMMUNITY_SCRIPTS_URL pattern (#1449)
- ct/vm scripts: split to 2-line pattern (variable + source)
- func files: remove redundant inline defaults
- Only entry points keep the default (ct/*.sh, vm/*.sh, build.func,
  install.func, alpine-install.func)
- Downstream sources use $COMMUNITY_SCRIPTS_URL without default
2026-02-22 14:43:08 +01:00
MickLesk
4b9121f41c feat: add configurable COMMUNITY_SCRIPTS_URL for dev sourcing (#1449)
- Replace all hardcoded source URLs with $COMMUNITY_SCRIPTS_URL variable
- Default: https://git.community-scripts.org/.../ProxmoxVED/raw/branch/main
- Override: export COMMUNITY_SCRIPTS_URL=https://.../your-fork/raw/branch/xyz
- Propagates into container via build.func exports
- Updated: 43 ct scripts, 14 deferred, 22 vm scripts, 5 func files
- Document in docs/DEV_MODE.md with usage examples
- Also normalizes legacy GitHub URLs to Gitea canonical URL
2026-02-22 14:36:31 +01:00
MickLesk
959a0cbeeb fix: quote PostgreSQL identifiers in setup_postgresql_db
- Rename Twenty DB from 'default' to 'twenty_db' (reserved keyword)
- Quote all identifiers in setup_postgresql_db with double quotes
  to prevent SQL syntax errors with reserved words
2026-02-22 14:23:29 +01:00
MickLesk
446751ed03 kima 2026-02-20 21:46:48 +01:00
CanbiZ (MickLesk)
d773b939f7 noHup /SIGHUP Tweak 2026-02-17 13:46:03 +01:00
CanbiZ (MickLesk)
792f03aeed update api from live 2026-02-17 11:26:06 +01:00
justin
a9188982ac Remove FUNCTIONS_FILE_PATH quotes 2026-02-14 12:30:27 -05:00
justin
bb4f7c17de $PCT_OPTIONS needs to be unquoted for now 2026-02-14 12:30:27 -05:00
justin
7ebfc41eab Co-Author 2026-02-14 12:30:27 -05:00
justin
c23e0086c4 Revert "Extract pct create cmd to var & call with command"
This reverts commit ec10ea87475e044183fd96635fa3734fba9d7a96.
2026-02-14 12:30:26 -05:00
justin
9b15034ddd Extract pct create cmd to var & call with command 2026-02-14 12:30:26 -05:00
justin
9a0a712dab Linting build.func first pass 2026-02-14 12:30:26 -05:00
CanbiZ (MickLesk)
ce81a5c479 Update api.func 2026-02-13 15:32:03 +01:00
Tobias
583b837161 Change version variable from APPLICATION_VERSION to var_appversion 2026-02-12 20:25:22 +01:00
CanbiZ (MickLesk)
0231b72d78 Add telemetry data service and dashboard revamp
Introduce a telemetry data microservice under misc/data: add Dockerfile, entrypoint, migration tools, README, LICENSE and a .gitignore. Increase Docker CACHE_TTL_SECONDS to 300s. Implement extensive dashboard and analytics updates in dashboard.go: add total_all_time and sample_size, return total item counts from fetchRecords (with page/limit handling and a maxRecords guard), raise top-N limits, add a minimum-installs threshold for failed-apps, and numerous UI/style/layout improvements in the embedded DashboardHTML. Minor formatting tweak to misc/api.func.
2026-02-12 13:10:06 +01:00
CanbiZ (MickLesk)
da03c76dd4 Refactor repo filter UI and relocate Export CSV
Update dashboard UI in misc/data/dashboard.go: move the repository <select> into the quickfilter group, apply inline styling for a compact themed dropdown, and shorten option labels (remove environment suffixes). Add a separator span between the select and quickfilter buttons. Move the Export CSV button from the top controls into the footer to simplify the header layout and avoid duplicate export buttons.
2026-02-11 15:58:34 +01:00
CanbiZ (MickLesk)
4def8258cc Require PB auth & target collection env vars
Remove implicit defaults for PocketBase collection names and make them required environment variables. Replace env(..., "_telemetry_service"/"_telemetry_data") with mustEnv("PB_AUTH_COLLECTION") and mustEnv("PB_TARGET_COLLECTION") so the service fails startup if those are not provided. Also update inline comments to clarify these fields come from the environment.
2026-02-11 15:57:36 +01:00
CanbiZ (MickLesk)
dc47c1c1c3 Unify telemetry storage and add repo filtering
Refactor telemetry backend to store all telemetry in a single collection and add repo_source-based filtering.

Key changes:
- Added detect_repo_source() in misc/api.func to auto-detect/export REPO_SOURCE (ProxmoxVE/ProxmoxVED/external) when scripts are sourced.
- Consolidated PocketBase collections into a single default collection (_telemetry_data) across service, migration, and scripts; updated defaults in migrate.go, migration.go, migrate.sh and migration shell scripts.
- Simplified PBClient to use one targetColl and removed collection resolution logic; updated create/update/find/fetch functions to use targetColl.
- Introduced repo_source field (values: "ProxmoxVE", "ProxmoxVED", "external") on telemetry records and telemetry payloads; updated validation and logging.
- Added repo filtering to dashboard endpoints, FetchDashboardData and FetchRecordsPaginated, plus a repo selector in the dashboard UI; default filter is ProxmoxVE (production), with an "all" option.
- Adjusted API handlers and callers to pass repo filters and include repo_source when upserting telemetry.
- Misc: updated comments, error messages, and logging to reflect the new model; added telemetry-service.exe binary.

Purpose: simplify data model (single collection), make telemetry attributable to repository sources, and enable dashboard filtering by repo/source.
2026-02-11 15:49:41 +01:00
CanbiZ (MickLesk)
d32b00ff31 Add weekly reports, cleanup, and dashboard UI
Introduce weekly summary reports and a cleanup job, enhance dashboard UI, and adjust telemetry/build settings.

- Add REPO_SOURCE to misc/api.func and include repo_source in telemetry payloads.
- Implement weekly report generation/scheduling in alerts.go: new data types, HTML/plain templates, scheduler, SendWeeklyReport/TestWeeklyReport, and email/HTML helpers.
- Add Cleaner (misc/data/cleanup.go) to detect and mark stuck installations as 'unknown' with scheduling and manual trigger APIs.
- Enhance dashboard backend/frontend (misc/data/dashboard.go): optional days filter (allow 'All'), increase fetch page size, simplify fetchRecords, add quick filter buttons, detail & health modals, improved styles and chart options, and client-side record detail view.
- Update Dockerfile (misc/data/Dockerfile): rename binaries to telemetry-service and build migrate from ./migration/migrate.go; copy adjusted in final image.
- Add migration tooling (misc/data/migration/migrate.sh and migration.go) and other small service changes.

These changes add operational reporting and cleanup capabilities, improve observability and UX of the dashboard, and align build and telemetry identifiers for the service.
2026-02-11 12:19:30 +01:00
CanbiZ (MickLesk)
54f59505d1 Gate telemetry debug via DEV_MODE
Replace unconditional debug echoes in misc/api.func with checks on DEV_MODE so telemetry debug output is only shown when DEV_MODE=true. Make curl fire-and-forget: verbose HTTP code and payload logging only in DEV_MODE, while production uses a silent curl invocation that never blocks or fails. Remove a stray trailing whitespace in detect_ram. Add misc/data/telemetry-ingest.exe binary to repo.
2026-02-11 07:55:02 +01:00
CanbiZ (MickLesk)
18fa3ec4e9 Add CPU/RAM and GPU model telemetry
Extend telemetry collection to include GPU model, CPU vendor/model, and RAM speed. misc/api.func: enhance detect_gpu to capture GPU_MODEL and default unknown values; add detect_cpu and detect_ram (dmidecode used for RAM speed), export new globals, and include cpu_*/gpu_model/ram_speed in post_to_api and post_update_to_api payloads. misc/data/service.go: add GPUModel/CPUVendor/CPUModel/RAMSpeed fields to TelemetryIn/Out/StatusUpdate, update PBClient mapping, expand allowed enum values to accept "unknown", sanitize and default empty vendor/passthrough fields to "unknown", and validate new cpu_vendor values. Changes maintain backward compatibility by using "unknown" where data is unavailable.
2026-02-10 16:38:03 +01:00
CanbiZ (MickLesk)
1dcd83abea Add sortable dashboard; extend telemetry data
Dashboard: add sortable table UI and client-side sorting support — CSS for sortable headers, data-sort attributes, default sort on Created (desc), timestamp formatting, header click handling, and inclusion of sort param in paginated fetches. Records now show a formatted Created column with full timestamp in the title. Initialize sortable headers on load.

Telemetry/client: switch to sending a full JSON payload (allows create if initial PATCH failed) and include extra fields (ct_type, disk_size, core_count, ram_size, os_type, os_version, pve_version, method). pve_version is detected when available.

Server: extend FetchRecordsPaginated to accept a sort field, validate allowed sort fields to prevent injection, use the sort when building the PB API request (default -created), and propagate the sort query param from the HTTP handler to the fetch call.

Overall this enables server-side sorted pagination from the dashboard and richer telemetry records.
2026-02-10 16:20:26 +01:00
CanbiZ (MickLesk)
f4ccccfb32 Update api.func 2026-02-10 16:16:35 +01:00
CanbiZ (MickLesk)
754b3d4b6b fix: add Debian codename matching for binary mode in fetch_and_deploy_gh_release 2026-02-10 14:42:13 +01:00
CanbiZ (MickLesk)
82de09f19f fix: remove debug output, add duration tracking, cleanup duplicate log messages 2026-02-10 14:29:28 +01:00
CanbiZ (MickLesk)
c60ff2ae75 Update build.func 2026-02-10 14:18:42 +01:00
CanbiZ (MickLesk)
2c0c72b0e5 unified logging 2026-02-10 13:59:35 +01:00
CanbiZ (MickLesk)
a0ba6fbbd1 - 2026-02-10 08:23:04 +01:00
CanbiZ (MickLesk)
53cf705799 Format misc/api.func: spacing and heredocs
Clean up formatting in misc/api.func for readability. Normalized spacing in the categorize_error case patterns, removed trailing blank-space lines, and standardized detect_gpu blank-line spacing. Converted heredoc assignments to use multiline $() style for JSON_PAYLOAD in post_tool_to_api, post_addon_to_api, and post_update_to_api_extended, and added a final newline at end of file. No functional changes intended; purely whitespace/formatting cleanup.
2026-02-10 08:17:50 +01:00