mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
update docker image + documentation (#602)
Co-authored-by: erenJag <erenJag>
This commit is contained in:
parent
dae4458a6f
commit
18ff3a3a30
5 changed files with 21 additions and 21 deletions
|
@ -6,10 +6,12 @@ if [ $? == 1 ]; then
|
|||
cscli machines add --force --auto -f /etc/crowdsec/local_api_credentials.yaml
|
||||
fi
|
||||
|
||||
if [ "$REGISTER_TO_ONLINE_API" == "true" ] || [ "$REGISTER_TO_ONLINE_API" == "TRUE" ] && [ "$CONFIG_FILE" == "" ] ; then
|
||||
cat /etc/crowdsec/config.yaml | grep online_api_credentials.yaml
|
||||
if [ $? == 1 ]; then
|
||||
sed -ri 's/^(\s*)(#credentials_path\s*:\s*$)/\1credentials_path: \/etc\/crowdsec\/online_api_credentials.yaml/' /etc/crowdsec/config.yaml
|
||||
# registration to online API for signal push
|
||||
if [ "$DISABLE_ONLINE_API" == "" ] && [ "$CONFIG_FILE" == "" ] ; then
|
||||
CONFIG_EXIST=$(yq eval '.api.server.online_client | has("credentials_path")' /etc/crowdsec/config.yaml)
|
||||
if [ "$CONFIG_EXIST" != "true" ]; then
|
||||
yq eval '.api.server.online_client = {"credentials_path": "/etc/crowdsec/online_api_credentials.yaml"}' /etc/crowdsec/config.yaml > /etc/crowdsec/config2.yaml
|
||||
mv /etc/crowdsec/config2.yaml /etc/crowdsec/config.yaml
|
||||
cscli capi register > /etc/crowdsec/online_api_credentials.yaml
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue