Add SENSOR type to installer with info to deploy from HIVE.

This commit is contained in:
Marco Ochse 2024-02-21 16:20:18 +01:00
parent 4f41b84103
commit a4262e9aae

View file

@ -1,4 +1,4 @@
#!/bin/bash
#/usr/bin/env bash
myINSTALL_NOTIFICATION="### Now installing required packages ..."
myUSER=$(whoami)
@ -162,6 +162,32 @@ if [ ! $? -eq 0 ];
echo
fi
# Ask for T-Pot Installation Type
echo
echo "### Choose your T-Pot type:"
echo "### (H)ive - T-Pot Standard / HIVE installation."
echo "### Includes also everything you need for a distributed setup with sensors."
echo "### (S)ensor - T-Pot Sensor installation."
echo "### Optimized for a distributed installation, without WebUI, Elasticsearch and Kibana."
while true; do
read -p "### Install Type? (h/s) " myTPOT_TYPE
case "${myTPOT_TYPE}" in
h|H)
echo
echo "### Installing T-Pot Standard / HIVE installation."
myTPOT_TYPE="HIVE"
break ;;
s|S)
echo
echo "### Installing T-Pot Sensor installation."
myTPOT_TYPE="SENSOR"
break ;;
esac
done
if [ "${myTPOT_TYPE}" == "HIVE" ];
# Install T-Pot Type HIVE and ask for WebUI username and password
then
# Preparing web user for T-Pot
echo
echo "### T-Pot User Configuration ..."
@ -230,6 +256,20 @@ myWEB_USER_ENC=$(htpasswd -b -n "${myWEB_USER}" "${myWEB_PW}")
echo
sed -i "s|^WEB_USER=.*|WEB_USER='${myWEB_USER_ENC}'|" ${myTPOT_CONF_FILE}
# Install T-Pot Type HIVE and use standard.yml for installation
cp ${HOME}/tpotce/compose/standard.yml ${HOME}/tpotce/docker-compose.yml
myINFO=""
fi
if [ "${myTPOT_TYPE}" == "SENSOR" ];
# Install T-Pot Type SENSOR and use sensor.yml for installation
then
cp ${HOME}/tpotce/compose/sensor.yml ${HOME}/tpotce/docker-compose.yml
myINFO="### Make sure to deploy SSH keys to this sensor and disable SSH password authentication.
### On hive run the tpotce/tools/deploy.sh script to join this sensor to the hive."
fi
# Pull docker images
echo "### Now pulling images ..."
sudo docker compose -f /home/${myUSER}/tpotce/docker-compose.yml pull
@ -244,5 +284,6 @@ sudo grc netstat -tulpen
echo
# Done
echo "Done. Please reboot and re-connect via SSH on tcp/64295."
echo "### Done. Please reboot and re-connect via SSH on tcp/64295."
echo "${myINFO}"
echo