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.
This commit is contained in:
parent
f7936cb540
commit
245d6f5b47
1 changed files with 9 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue