refactor: clean up diagnostics/telemetry opt-in system

- diagnostics_check(): deduplicate heredoc (was 2x 22 lines), improve whiptail
  text with clear what/what-not collected, add telemetry + privacy links
- diagnostics_menu(): better UX with current status, clear enable/disable
  buttons, note about existing containers
- variables(): change DIAGNOSTICS default from 'yes' to 'no' (safe: no
  telemetry before user consents via diagnostics_check)
- install.func + alpine-install.func: persist BOTH yes AND no in container
  so opt-out is explicit (not just missing file = no)
- Fix typo 'menue' -> 'menu' in config file comments
This commit is contained in:
CanbiZ (MickLesk)
2026-02-17 17:02:34 +01:00
parent fac5c5ebf6
commit 476b50b4e2
3 changed files with 81 additions and 76 deletions

View File

@@ -11,11 +11,11 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
load_functions
catch_errors
# Persist diagnostics opt-in inside container (exported from build.func)
# so addon scripts running later can find it
if [[ "${DIAGNOSTICS:-no}" == "yes" ]] && [[ ! -f /usr/local/community-scripts/diagnostics ]]; then
# Persist diagnostics setting inside container (exported from build.func)
# so addon scripts running later can find the user's choice
if [[ ! -f /usr/local/community-scripts/diagnostics ]]; then
mkdir -p /usr/local/community-scripts
echo "DIAGNOSTICS=yes" >/usr/local/community-scripts/diagnostics
echo "DIAGNOSTICS=${DIAGNOSTICS:-no}" >/usr/local/community-scripts/diagnostics
fi
# Get LXC IP address (must be called INSIDE container, after network is up)