From b5ef239973607474ce5f4a9b35e27891e40e1113 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 6 Nov 2025 23:41:29 +0000 Subject: [PATCH] Add container detection warning to pulse-sensor-proxy startup (related to #628) When pulse-sensor-proxy runs inside a container (Docker/LXC), it cannot complete SSH workflows properly, leading to continuous [preauth] log floods on the Proxmox host. This happens because the proxy is meant to run on the host, not inside the container. Changes: - Import internal/system for InContainer() detection - Add startup warning when running in containerized environment - Point users to docs/TEMPERATURE_MONITORING.md for correct setup - Allow suppression via PULSE_SENSOR_PROXY_SUPPRESS_CONTAINER_WARNING=true This catches the misconfiguration early and directs users to supported installation methods, preventing the SSH spam reported in discussion #628. --- cmd/pulse-sensor-proxy/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/pulse-sensor-proxy/main.go b/cmd/pulse-sensor-proxy/main.go index 50ef479..c6e88c3 100644 --- a/cmd/pulse-sensor-proxy/main.go +++ b/cmd/pulse-sensor-proxy/main.go @@ -19,6 +19,7 @@ import ( "time" "github.com/rcourtman/pulse-go-rewrite/internal/ssh/knownhosts" + "github.com/rcourtman/pulse-go-rewrite/internal/system" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/spf13/cobra" @@ -370,6 +371,12 @@ func runProxy() { Str("version", Version). Msg("Starting pulse-sensor-proxy") + // Warn if running inside a container - this is an unsupported configuration + // Container environments cannot complete SSH workflows, causing [preauth] log floods + if system.InContainer() && os.Getenv("PULSE_SENSOR_PROXY_SUPPRESS_CONTAINER_WARNING") != "true" { + log.Warn().Msg("pulse-sensor-proxy is running inside a container - this is unsupported and will cause SSH [preauth] log floods. Install on the Proxmox host instead. See docs/TEMPERATURE_MONITORING.md for setup instructions. Set PULSE_SENSOR_PROXY_SUPPRESS_CONTAINER_WARNING=true to suppress this warning.") + } + knownHostsManager, err := knownhosts.NewManager(filepath.Join(sshKeyPath, "known_hosts")) if err != nil { log.Fatal().Err(err).Msg("Failed to initialize known hosts manager")