From 245d6f5b478f9218e490e64f08dc31a886654b18 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Fri, 14 Nov 2025 21:57:16 +0000 Subject: [PATCH] Ensure base config exists before updating allowed_nodes The installer was only creating base config.yaml in standalone mode, but update_allowed_nodes() is also called in LXC mode. When the config didn't exist, update_allowed_nodes() would create an empty file and only add the allowed_nodes section, missing required fields like allowed_peer_uids, metrics_address, rate_limit, etc. This caused the proxy to fail when it tried to parse the incomplete config. Now creates a proper base config with all required fields if the file doesn't exist, before any mode-specific configuration is added. --- scripts/install-sensor-proxy.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/install-sensor-proxy.sh b/scripts/install-sensor-proxy.sh index 8ad9481..636c2c7 100755 --- a/scripts/install-sensor-proxy.sh +++ b/scripts/install-sensor-proxy.sh @@ -999,18 +999,23 @@ register_with_pulse() { echo "$token" } -# Create config file with ACL for Docker containers (standalone mode) -if [[ "$STANDALONE" == true ]]; then - print_info "Creating config file with Docker container ACL..." +# Create base config file if it doesn't exist +if [[ ! -f /etc/pulse-sensor-proxy/config.yaml ]]; then + print_info "Creating base configuration file..." cat > /etc/pulse-sensor-proxy/config.yaml << 'EOF' # Pulse Temperature Proxy Configuration -# Allow Docker containers (UID 1000) to connect allowed_peer_uids: [1000] # Allow ID-mapped root (LXC containers with sub-UID mapping) allow_idmapped_root: true allowed_idmap_users: - root + +metrics_address: "127.0.0.1:9127" + +rate_limit: + per_peer_interval_ms: 333 + per_peer_burst: 10 EOF chown pulse-sensor-proxy:pulse-sensor-proxy /etc/pulse-sensor-proxy/config.yaml chmod 0644 /etc/pulse-sensor-proxy/config.yaml