mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-10-28 11:02:54 +00:00
Compare commits
18 commits
49e6d62262
...
5a1dc17e4d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a1dc17e4d | ||
|
|
67cf6c6a8a | ||
|
|
b29cec6921 | ||
|
|
95906f1ede | ||
|
|
cbcf7871ec | ||
|
|
c38fab7670 | ||
|
|
444b181075 | ||
|
|
59c6672df7 | ||
|
|
87733c6b65 | ||
|
|
f609e20567 | ||
|
|
78acb5f5c0 | ||
|
|
99abefe98e | ||
|
|
82147ba4bd | ||
|
|
a7af16f69a | ||
|
|
5e333eba59 | ||
|
|
c2748f9904 | ||
|
|
d94207e56e | ||
|
|
cb8933cddb |
2 changed files with 64 additions and 9 deletions
21
.github/workflows/basic-support-info.yml
vendored
21
.github/workflows/basic-support-info.yml
vendored
|
|
@ -19,12 +19,24 @@ jobs:
|
||||||
- name: Install jq
|
- name: Install jq
|
||||||
run: sudo apt-get install jq -y
|
run: sudo apt-get install jq -y
|
||||||
|
|
||||||
|
- name: Check for "investigate" label
|
||||||
|
id: skip_investigate
|
||||||
|
run: |
|
||||||
|
LABELS=$(jq -r '.issue.labels[].name' "$GITHUB_EVENT_PATH")
|
||||||
|
for label in $LABELS; do
|
||||||
|
if [ "$label" = "investigate" ]; then
|
||||||
|
echo "skip=true" >> $GITHUB_ENV
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "skip=false" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Check issue for basic support info
|
- name: Check issue for basic support info
|
||||||
|
if: env.skip != 'true'
|
||||||
id: check_issue
|
id: check_issue
|
||||||
run: |
|
run: |
|
||||||
REQUIRED_INFO=("What OS are you T-Pot running on?" "What is the version of the OS" "What T-Pot version are you currently using" "What architecture are you running on" "Review the \`~/install_tpot.log\`" "How long has your installation been running?" "Did you install upgrades, packages or use the update script?" "Did you modify any scripts or configs?" "Please provide a screenshot of \`htop\` and \`docker stats\`." "How much free disk space is available" "What is the current container status" "What is the status of the T-Pot service" "What ports are being occupied?")
|
REQUIRED_INFO=("What OS are you T-Pot running on?" "What is the version of the OS" "What T-Pot version are you currently using" "What architecture are you running on" "Review the \`~/install_tpot.log\`" "How long has your installation been running?" "Did you install upgrades, packages or use the update script?" "Did you modify any scripts or configs?" "Please provide a screenshot of \`htop\` and \`docker stats\`." "How much free disk space is available" "What is the current container status" "What is the status of the T-Pot service" "What ports are being occupied?")
|
||||||
|
ISSUE_BODY=$(jq -r '.issue.body' "$GITHUB_EVENT_PATH")
|
||||||
ISSUE_BODY=$(cat $GITHUB_EVENT_PATH | jq -r '.issue.body')
|
|
||||||
MISSING_INFO=()
|
MISSING_INFO=()
|
||||||
|
|
||||||
for info in "${REQUIRED_INFO[@]}"; do
|
for info in "${REQUIRED_INFO[@]}"; do
|
||||||
|
|
@ -40,10 +52,9 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Add "no basic support info" label if necessary
|
- name: Add "no basic support info" label if necessary
|
||||||
if: env.missing == 'true'
|
if: env.missing == 'true' && env.skip != 'true'
|
||||||
run: gh issue edit "$NUMBER" --add-label "$LABELS"
|
run: gh issue edit "$NUMBER" --add-label "no basic support info"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GH_REPO: ${{ github.repository }}
|
GH_REPO: ${{ github.repository }}
|
||||||
NUMBER: ${{ github.event.issue.number }}
|
NUMBER: ${{ github.event.issue.number }}
|
||||||
LABELS: no basic support info
|
|
||||||
|
|
|
||||||
52
update.sh
52
update.sh
|
|
@ -53,6 +53,7 @@ function fuCHECKINET () {
|
||||||
function fuSELFUPDATE () {
|
function fuSELFUPDATE () {
|
||||||
echo
|
echo
|
||||||
echo "### Now checking for newer files in repository ..."
|
echo "### Now checking for newer files in repository ..."
|
||||||
|
echo "### T-Pot... TPOT_TYPE is set to: $myTPOT_TYPE"
|
||||||
git fetch --all
|
git fetch --all
|
||||||
myREMOTESTAT=$(git status | grep -c "up-to-date")
|
myREMOTESTAT=$(git status | grep -c "up-to-date")
|
||||||
if [ "$myREMOTESTAT" != "0" ];
|
if [ "$myREMOTESTAT" != "0" ];
|
||||||
|
|
@ -67,13 +68,31 @@ function fuSELFUPDATE () {
|
||||||
echo "###### $myBLUE""Found newer version, will be pulling updates and restart myself.""$myWHITE"
|
echo "###### $myBLUE""Found newer version, will be pulling updates and restart myself.""$myWHITE"
|
||||||
git reset --hard
|
git reset --hard
|
||||||
git pull --force
|
git pull --force
|
||||||
exec ./update.sh -y
|
# check if myTPOT_TYPE is set
|
||||||
exit 1
|
if [ -z "$myTPOT_TYPE" ]; then
|
||||||
else
|
exec ./update.sh
|
||||||
|
else
|
||||||
|
exec ./update.sh -y $myTPOT_TYPE
|
||||||
|
fi
|
||||||
|
else
|
||||||
echo "###### $myBLUE""Pulling updates from repository.""$myWHITE"
|
echo "###### $myBLUE""Pulling updates from repository.""$myWHITE"
|
||||||
git reset --hard
|
git reset --hard
|
||||||
git pull --force
|
git pull --force
|
||||||
fi
|
fi
|
||||||
|
if [ -z "$myTPOT_TYPE" ]; then
|
||||||
|
echo
|
||||||
|
else
|
||||||
|
grep -q "^TPOT_TYPE=" .env && sed -i "s/^TPOT_TYPE=.*/TPOT_TYPE=${myTPOT_TYPE}/" .env
|
||||||
|
echo "### T-Pot type set to: $myTPOT_TYPE in .env"
|
||||||
|
if [ "$myTPOT_TYPE" == "SENSOR" ]; then
|
||||||
|
echo "### Copying compose/sensor.yml to docker-compose.yml"
|
||||||
|
cp compose/sensor.yml docker-compose.yml
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
exit 1
|
||||||
|
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -194,6 +213,19 @@ function fuRESTORE () {
|
||||||
sed -i "s/^TPOT_VERSION=.*/TPOT_VERSION=${newVERSION}/" $HOME/tpotce/.env
|
sed -i "s/^TPOT_VERSION=.*/TPOT_VERSION=${newVERSION}/" $HOME/tpotce/.env
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fuREADTPOT_TYPE () {
|
||||||
|
if [ -f .env ]; then
|
||||||
|
# reads the TPOT_TYPE from the .env file
|
||||||
|
myTPOT_TYPE=$(grep -E '^TPOT_TYPE=' .env | cut -d '=' -f2)
|
||||||
|
# Verify if TPOT_TYPE is set
|
||||||
|
if [ -z "$myTPOT_TYPE" ]; then
|
||||||
|
myTPOT_TYPE="HIVE"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
myTPOT_TYPE="HIVE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
################
|
################
|
||||||
# Main section #
|
# Main section #
|
||||||
################
|
################
|
||||||
|
|
@ -211,11 +243,23 @@ if [ "$1" != "-y" ]; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# if exists second argument, use it as T-Pot type, only if SENSOR or HIVE
|
||||||
|
if [ -n "$2" ]; then
|
||||||
|
if [[ "$2" == "SENSOR" || "$2" == "HIVE" ]]; then
|
||||||
|
myTPOT_TYPE="$2"
|
||||||
|
else
|
||||||
|
myTPOT_TYPE="HIVE"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
myTPOT_TYPE="HIVE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fuREADTPOT_TYPE
|
||||||
fuCHECK_VERSION
|
fuCHECK_VERSION
|
||||||
fuCHECKINET "https://index.docker.io https://github.com"
|
fuCHECKINET "https://index.docker.io https://github.com"
|
||||||
fuSTOP_TPOT
|
fuSTOP_TPOT
|
||||||
fuBACKUP
|
fuBACKUP
|
||||||
fuSELFUPDATE "$0" "$@"
|
fuSELFUPDATE "$0" "$@" "$myTPOT_TYPE"
|
||||||
fuUPDATER
|
fuUPDATER
|
||||||
fuRESTORE
|
fuRESTORE
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue