mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-01 12:32:12 +00:00
Adjust genuser.sh
- add more logging - retrieve docker repo and version tag from .env - only use specified repo / version for download image - allow for user interrupt
This commit is contained in:
parent
cc9c1d95ce
commit
c180732af3
2 changed files with 15 additions and 1 deletions
3
docker/tpotinit/dist/bin/genuser.sh
vendored
3
docker/tpotinit/dist/bin/genuser.sh
vendored
|
@ -13,6 +13,9 @@ __ __ _ _ _ [ T-Pot ]
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Add trap to ensure SIGINT, SIGTERM works
|
||||||
|
trap 'echo; echo; echo "# User interrupt. Exiting."; exit 1' SIGINT
|
||||||
|
|
||||||
# Generate T-Pot WebUser
|
# Generate T-Pot WebUser
|
||||||
echo "$myPW"
|
echo "$myPW"
|
||||||
echo
|
echo
|
||||||
|
|
13
genuser.sh
13
genuser.sh
|
@ -1,2 +1,13 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
docker run -v $HOME/tpotce:/data --entrypoint bash -it -u $(id -u):$(id -g) dtagdevsec/tpotinit:24.04.1 "/opt/tpot/bin/genuser.sh"
|
TPOT_REPO=$(grep -E "^TPOT_REPO" .env | cut -d "=" -f2-)
|
||||||
|
TPOT_VERSION=$(grep -E "^TPOT_VERSION" .env | cut -d "=" -f2-)
|
||||||
|
USER=$(id -u)
|
||||||
|
USERNAME=$(id -un)
|
||||||
|
GROUP=$(id -g)
|
||||||
|
echo "### Repository: ${TPOT_REPO}"
|
||||||
|
echo "### Version Tag: ${TPOT_VERSION}"
|
||||||
|
echo "### Your User Name: ${USERNAME}"
|
||||||
|
echo "### Your User ID: ${USER}"
|
||||||
|
echo "### Your Group ID: ${GROUP}"
|
||||||
|
echo
|
||||||
|
docker run -v $HOME/tpotce:/data --entrypoint "bash" -it -u "${USER}":"${GROUP}" "${TPOT_REPO}"/tpotinit:"${TPOT_VERSION}" "/opt/tpot/bin/genuser.sh"
|
||||||
|
|
Loading…
Reference in a new issue