Compare commits

...

1 commit

Author SHA1 Message Date
he2ss 332b1d8772 starting work on update 2021-07-22 18:40:20 +02:00
2 changed files with 10 additions and 5 deletions

View file

@ -80,7 +80,7 @@ If you want to be able to restart/stop your container and keep the same DB `-v /
* `TEST_MODE` - Only test configs (default: `false`) : `-e TEST_MODE="<true|false>"`
* `TZ` - Set the [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to ensure logs have a local timestamp.
* `DISABLE_AGENT` - Only test configs (default: `false`) : `-e DISABLE_AGENT="<true|false>"`
* `DISABLE_LOCAL_API` - Disable local API (default: `false`) : `-e DISABLE_API="<true|false>"`
* `DISABLE_LOCAL_API` - Disable local API (default: `false`) : `-e DISABLE_LOCAL_API="<true|false>"`
* `DISABLE_ONLINE_API` - Disable Online API registration for signal sharing (default: `false`) : `-e DISABLE_ONLINE_API="<true|false>"`
* `LEVEL_TRACE` - Trace-level (VERY verbose) on stdout (default: `false`) : `-e LEVEL_TRACE="<true|false>"`
* `LEVEL_DEBUG` - Debug-level on stdout (default: `false`) : `-e LEVEL_DEBUG="<true|false>"`

View file

@ -1,9 +1,14 @@
#!/bin/sh
# Check if the container has already been started
cscli machines list | grep 127.0.0.1
if [ $? == 1 ]; then
cscli machines add --force --auto -f /etc/crowdsec/local_api_credentials.yaml
if [ "$DISABLE_AGENT" == "" ] ; then
if [ "$LOCAL_API_URL" != "" ] ; then
cscli lapi register --url $LOCAL_API_URL
fi
cscli machines list | grep localhost
if [ $? == 1 ]; then
cscli lapi register --machine localhost
fi
fi
# registration to online API for signal push
@ -58,7 +63,7 @@ fi
if [ "$DISABLE_AGENT" == "true" ] || [ "$DISABLE_AGENT" == "TRUE" ]; then
ARGS="$ARGS -no-cs"
fi
if [ "$DISABLE_API" == "true" ] || [ "$DISABLE_API" == "TRUE" ]; then
if [ "$DISABLE_LOCAL_API" == "true" ] || [ "$DISABLE_LOCAL_API" == "TRUE" ]; then
ARGS="$ARGS -no-api"
fi
if [ "$LEVEL_TRACE" == "true" ] || [ "$LEVEL_TRACE" == "TRUE" ]; then