Skip to content

Commit

Permalink
fix the perms of SQLite DB for metabase (#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
buixor committed Feb 25, 2021
1 parent 5b7ac4a commit 6f8b6cd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docker/docker_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ if [ "$DISABLE_ONLINE_API" == "" ] && [ "$CONFIG_FILE" == "" ] ; then
fi
fi

# crowdsec sqlite database permissions
if [ "$GID" != "" ]; then
IS_SQLITE=$(yq eval '.db_config.type == "sqlite"' /etc/crowdsec/config.yaml)
DB_PATH=$(yq eval '.db_config.db_path' /etc/crowdsec/config.yaml)
if [ "$IS_SQLITE" == "true" ]; then
chown :$GID $DB_PATH
fi
fi

## Install collections, parsers & scenarios
cscli hub update
cscli collections upgrade crowdsecurity/linux
Expand Down Expand Up @@ -64,4 +73,4 @@ if [ "$LEVEL_INFO" == "true" ] || [ "$LEVEL_INFO" == "TRUE" ]; then
ARGS="$ARGS -info"
fi

exec crowdsec $ARGS
exec crowdsec $ARGS

0 comments on commit 6f8b6cd

Please sign in to comment.