docker: allow GID with no persistent sqlite db (#2381)

This commit is contained in:
mmetc 2023-07-28 16:01:50 +02:00 committed by GitHub
parent 9dfc66ef04
commit 643445b7cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -273,8 +273,10 @@ fi
# crowdsec sqlite database permissions
if [ "$GID" != "" ]; then
if istrue "$(conf_get '.db_config.type == "sqlite"')"; then
chown ":$GID" "$(conf_get '.db_config.db_path')"
echo "sqlite database permissions updated"
# don't fail if the db is not there yet
chown -f ":$GID" "$(conf_get '.db_config.db_path')" 2>/dev/null \
&& echo "sqlite database permissions updated" \
|| true
fi
fi