Skip to content

Commit d38678c

Browse files
fix: config file permissions on upgrade to 0.2.0 (#108)
* Fix config file permissions on upgrade to 0.2.0 When upgrading from a previous version, the config file may have incorrect permissions that prevent the bouncer from reading it, causing: 'permission denied' errors.
1 parent aa4d984 commit d38678c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

debian/postinst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ if ! getent passwd crowdsec-spoa >/dev/null; then
2222
adduser crowdsec-spoa --system --group --comment "crowdsec haproxy spoa bouncer"
2323
fi
2424

25-
# Set config file group ownership
25+
# Set config file group ownership and permissions
26+
# Always set permissions to ensure file is readable by crowdsec-spoa group
27+
# This is especially important on upgrades where old packages may have had incorrect permissions
2628
if [ -f "$CONFIG" ]; then
29+
chmod 640 "$CONFIG" 2>/dev/null || true
2730
chgrp crowdsec-spoa "$CONFIG" 2>/dev/null || true
2831
fi
2932

0 commit comments

Comments
 (0)