mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-01 12:32:12 +00:00
add option to retrieve ENVs from file
This commit is contained in:
parent
e7963dbdaa
commit
35188ef28e
4 changed files with 24 additions and 3 deletions
|
@ -64,4 +64,4 @@ HEALTHCHECK --retries=10 CMD curl -s -XGET 'http://127.0.0.1:9600'
|
||||||
#
|
#
|
||||||
# Start logstash
|
# Start logstash
|
||||||
USER logstash:logstash
|
USER logstash:logstash
|
||||||
CMD entrypoint.sh && exec /usr/share/logstash/bin/logstash --config.reload.automatic
|
CMD entrypoint.sh
|
||||||
|
|
9
docker/elk/logstash/dist/entrypoint.sh
vendored
9
docker/elk/logstash/dist/entrypoint.sh
vendored
|
@ -6,6 +6,13 @@ function fuCLEANUP {
|
||||||
}
|
}
|
||||||
trap fuCLEANUP EXIT
|
trap fuCLEANUP EXIT
|
||||||
|
|
||||||
|
# Source ENVs from file ...
|
||||||
|
if [ -f "/data/tpot/etc/compose/elk_environment" ];
|
||||||
|
then
|
||||||
|
echo "Found .env, now exporting ..."
|
||||||
|
set -o allexport && source "/data/tpot/etc/compose/elk_environment" && set +o allexport
|
||||||
|
fi
|
||||||
|
|
||||||
# Check internet availability
|
# Check internet availability
|
||||||
function fuCHECKINET () {
|
function fuCHECKINET () {
|
||||||
mySITES=$1
|
mySITES=$1
|
||||||
|
@ -85,3 +92,5 @@ if [ "$myTPOTILM" == "1" ];
|
||||||
echo "T-Pot ILM already configured or ES not available."
|
echo "T-Pot ILM already configured or ES not available."
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
exec /usr/share/logstash/bin/logstash --config.reload.automatic
|
||||||
|
|
|
@ -34,8 +34,10 @@ RUN apk -U --no-cache add \
|
||||||
adduser -S -H -u 2000 -D -g 2000 ews && \
|
adduser -S -H -u 2000 -D -g 2000 ews && \
|
||||||
chown -R ews:ews /opt/ewsposter && \
|
chown -R ews:ews /opt/ewsposter && \
|
||||||
#
|
#
|
||||||
# Supply configs
|
# Supply config and entrypoint.sh
|
||||||
mv /root/dist/ews.cfg /opt/ewsposter/ && \
|
mv /root/dist/ews.cfg /opt/ewsposter/ && \
|
||||||
|
mv /root/dist/entrypoint.sh /usr/bin/ && \
|
||||||
|
chmod 755 /usr/bin/entrypoint.sh && \
|
||||||
#
|
#
|
||||||
# Clean up
|
# Clean up
|
||||||
apk del build-base \
|
apk del build-base \
|
||||||
|
@ -48,4 +50,4 @@ RUN apk -U --no-cache add \
|
||||||
# Run ewsposter
|
# Run ewsposter
|
||||||
STOPSIGNAL SIGINT
|
STOPSIGNAL SIGINT
|
||||||
USER ews:ews
|
USER ews:ews
|
||||||
CMD sleep 10 && exec /usr/bin/python3 -u /opt/ewsposter/ews.py -l $(shuf -i 10-60 -n 1)
|
CMD /usr/bin/entrypoint.sh
|
||||||
|
|
10
docker/ewsposter/dist/entrypoint.sh
vendored
Normal file
10
docker/ewsposter/dist/entrypoint.sh
vendored
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/ash
|
||||||
|
|
||||||
|
# Source ENVs from file ...
|
||||||
|
if [ -f "/data/tpot/etc/compose/elk_environment" ];
|
||||||
|
then
|
||||||
|
echo "Found .env, now exporting ..."
|
||||||
|
set -o allexport && source "/data/tpot/etc/compose/elk_environment" && set +o allexport
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec /usr/bin/python3 -u /opt/ewsposter/ews.py -l $(shuf -i 10-60 -n 1)
|
Loading…
Reference in a new issue