From 97c895dbb1dc12c365c691d0802ca82dd24afc86 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 19 Oct 2025 15:12:31 +0000 Subject: [PATCH] fix: build and install pulse-sensor-proxy when building from source When users install with --main, the install script now: - Builds pulse-sensor-proxy from source - Installs it to /opt/pulse/bin/pulse-sensor-proxy - Copies install-docker.sh and install-sensor-proxy.sh to scripts dir This ensures the turnkey Docker installer can download pulse-sensor-proxy from the Pulse server (/api/install/pulse-sensor-proxy) instead of failing. Previously, building from source would skip pulse-sensor-proxy entirely, causing the Docker installer to fail when trying to set up temperature monitoring. --- install.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/install.sh b/install.sh index 3495108..d90821c 100755 --- a/install.sh +++ b/install.sh @@ -1437,6 +1437,18 @@ download_pulse() { rm -f pulse-docker-agent + print_info "Building temperature proxy from source..." + if ! go build -o pulse-sensor-proxy ./cmd/pulse-sensor-proxy >/dev/null 2>&1; then + print_error "Failed to build temperature proxy binary" + exit 1 + fi + + cp -f pulse-sensor-proxy "$INSTALL_DIR/bin/pulse-sensor-proxy" + chmod +x "$INSTALL_DIR/bin/pulse-sensor-proxy" + chown pulse:pulse "$INSTALL_DIR/bin/pulse-sensor-proxy" + + rm -f pulse-sensor-proxy + build_agent_binaries_from_source "$agent_version" # Update VERSION file to show it's from source @@ -2207,6 +2219,20 @@ main() { chown pulse:pulse "$INSTALL_DIR/pulse-docker-agent" "$INSTALL_DIR/bin/pulse-docker-agent" ln -sf "$INSTALL_DIR/bin/pulse-docker-agent" /usr/local/bin/pulse-docker-agent rm -f pulse-docker-agent + + print_info "Building temperature proxy from source..." + if ! go build -o pulse-sensor-proxy ./cmd/pulse-sensor-proxy >/dev/null 2>&1; then + print_error "Failed to build temperature proxy binary" + cd / + rm -rf "$TEMP_BUILD_DIR" + exit 1 + fi + + cp -f pulse-sensor-proxy "$INSTALL_DIR/bin/pulse-sensor-proxy" + chmod +x "$INSTALL_DIR/bin/pulse-sensor-proxy" + chown pulse:pulse "$INSTALL_DIR/bin/pulse-sensor-proxy" + rm -f pulse-sensor-proxy + ln -sf "$INSTALL_DIR/bin/pulse" /usr/local/bin/pulse mkdir -p "$INSTALL_DIR/scripts" @@ -2218,6 +2244,18 @@ main() { print_warn "Docker agent install script missing from source checkout; skipping installation" fi + if [[ -f "scripts/install-docker.sh" ]]; then + cp "scripts/install-docker.sh" "$INSTALL_DIR/scripts/install-docker.sh" + chmod 755 "$INSTALL_DIR/scripts/install-docker.sh" + chown pulse:pulse "$INSTALL_DIR/scripts/install-docker.sh" + fi + + if [[ -f "scripts/install-sensor-proxy.sh" ]]; then + cp "scripts/install-sensor-proxy.sh" "$INSTALL_DIR/scripts/install-sensor-proxy.sh" + chmod 755 "$INSTALL_DIR/scripts/install-sensor-proxy.sh" + chown pulse:pulse "$INSTALL_DIR/scripts/install-sensor-proxy.sh" + fi + build_agent_binaries_from_source "$agent_version" # Setup update command and service