Ensure installer resets config ownership
This commit is contained in:
parent
5d504843ce
commit
4c405b9972
1 changed files with 14 additions and 1 deletions
15
install.sh
15
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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue