File tree Expand file tree Collapse file tree 3 files changed +6
-29
lines changed Expand file tree Collapse file tree 3 files changed +6
-29
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,4 @@ ENTRYPOINT ["/bin/bash", "/docker_start.sh"]
49
49
50
50
FROM slim AS full
51
51
52
- # Due to the wizard using cp -n, we have to copy the config files directly from the source as -n does not exist in busybox cp
53
- # The files are here for reference, as users will need to mount a new version to be actually able to use notifications
54
- COPY --from=build \
55
- /go/src/crowdsec/cmd/notification-email/email.yaml \
56
- /go/src/crowdsec/cmd/notification-http/http.yaml \
57
- /go/src/crowdsec/cmd/notification-slack/slack.yaml \
58
- /go/src/crowdsec/cmd/notification-splunk/splunk.yaml \
59
- /go/src/crowdsec/cmd/notification-sentinel/sentinel.yaml \
60
- /staging/etc/crowdsec/notifications/
61
-
62
52
COPY --from=build /usr/local/lib/crowdsec/plugins /usr/local/lib/crowdsec/plugins
Original file line number Diff line number Diff line change @@ -65,16 +65,6 @@ ENTRYPOINT ["/bin/bash", "docker_start.sh"]
65
65
66
66
FROM slim AS plugins
67
67
68
- # Due to the wizard using cp -n, we have to copy the config files directly from the source as -n does not exist in busybox cp
69
- # The files are here for reference, as users will need to mount a new version to be actually able to use notifications
70
- COPY --from=build \
71
- /go/src/crowdsec/cmd/notification-email/email.yaml \
72
- /go/src/crowdsec/cmd/notification-http/http.yaml \
73
- /go/src/crowdsec/cmd/notification-slack/slack.yaml \
74
- /go/src/crowdsec/cmd/notification-splunk/splunk.yaml \
75
- /go/src/crowdsec/cmd/notification-sentinel/sentinel.yaml \
76
- /staging/etc/crowdsec/notifications/
77
-
78
68
COPY --from=build /usr/local/lib/crowdsec/plugins /usr/local/lib/crowdsec/plugins
79
69
80
70
FROM slim AS geoip
Original file line number Diff line number Diff line change @@ -497,7 +497,7 @@ delete_plugins() {
497
497
rm -rf ${CROWDSEC_PLUGIN_DIR}
498
498
}
499
499
500
- install_plugins (){
500
+ install_plugins () {
501
501
mkdir -p ${CROWDSEC_PLUGIN_DIR}
502
502
mkdir -p /etc/crowdsec/notifications
503
503
@@ -508,14 +508,11 @@ install_plugins(){
508
508
cp ${SENTINEL_PLUGIN_BINARY} ${CROWDSEC_PLUGIN_DIR}
509
509
cp ${FILE_PLUGIN_BINARY} ${CROWDSEC_PLUGIN_DIR}
510
510
511
- if [[ ${DOCKER_MODE} == " false" ]]; then
512
- cp -n ${SLACK_PLUGIN_CONFIG} /etc/crowdsec/notifications/
513
- cp -n ${SPLUNK_PLUGIN_CONFIG} /etc/crowdsec/notifications/
514
- cp -n ${HTTP_PLUGIN_CONFIG} /etc/crowdsec/notifications/
515
- cp -n ${EMAIL_PLUGIN_CONFIG} /etc/crowdsec/notifications/
516
- cp -n ${SENTINEL_PLUGIN_CONFIG} /etc/crowdsec/notifications/
517
- cp -n ${FILE_PLUGIN_CONFIG} /etc/crowdsec/notifications/
518
- fi
511
+ for yaml_conf in ${SLACK_PLUGIN_CONFIG} ${SPLUNK_PLUGIN_CONFIG} ${HTTP_PLUGIN_CONFIG} ${EMAIL_PLUGIN_CONFIG} ${SENTINEL_PLUGIN_CONFIG} ${FILE_PLUGIN_CONFIG} ; do
512
+ if [[ ! -e /etc/crowdsec/notifications/" $( basename " $yaml_conf " ) " ]]; then
513
+ cp " $yaml_conf " /etc/crowdsec/notifications/
514
+ fi
515
+ done
519
516
}
520
517
521
518
check_running_bouncers () {
You can’t perform that action at this time.
0 commit comments