From 4c405b9972a9a66e84ec4ada5a65f59d1956c839 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sat, 15 Nov 2025 18:00:49 +0000 Subject: [PATCH] Ensure installer resets config ownership --- install.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f9f3919..53547c6 100755 --- a/install.sh +++ b/install.sh @@ -2553,12 +2553,18 @@ setup_directories() { chmod 700 "$CONFIG_DIR" # Ensure critical config files retain proper permissions if they exist - for config_file in "$CONFIG_DIR"/alerts.json "$CONFIG_DIR"/system.json "$CONFIG_DIR"/*.enc; do + for config_file in "$CONFIG_DIR"/alerts.json "$CONFIG_DIR"/system.json "$CONFIG_DIR"/*.enc "$CONFIG_DIR"/*.json; do if [[ -f "$config_file" ]]; then chown pulse:pulse "$config_file" fi done + for config_dir in "$CONFIG_DIR"/alerts "$CONFIG_DIR"/notifications; do + if [[ -d "$config_dir" ]]; then + chown -R pulse:pulse "$config_dir" + fi + done + # Create .env file with mock mode explicitly disabled (unless it already exists) if [[ ! -f "$CONFIG_DIR/.env" ]]; then cat > "$CONFIG_DIR/.env" << 'EOF' @@ -2576,9 +2582,16 @@ PULSE_MOCK_MODE=false #PULSE_MOCK_RANDOM_METRICS=true #PULSE_MOCK_STOPPED_PERCENT=20 EOF + fi + if [[ -f "$CONFIG_DIR/.env" ]]; then chown pulse:pulse "$CONFIG_DIR/.env" chmod 600 "$CONFIG_DIR/.env" fi + + if [[ -f "$CONFIG_DIR/.encryption.key" ]]; then + chown pulse:pulse "$CONFIG_DIR/.encryption.key" + chmod 600 "$CONFIG_DIR/.encryption.key" + fi } setup_update_command() {