From c474297cdcf374b8cdc6d2fdb45211276b72df4c Mon Sep 17 00:00:00 2001
From: Chad Redman <credman@unicon.net>
Date: Mon, 17 Jul 2023 23:59:48 -0400
Subject: [PATCH] Remove unused old beacon code; hardcode tbTIERRelease value

---
 Dockerfile                       |  5 +----
 containerfiles/sendtierbeacon.sh | 30 ------------------------------
 containerfiles/setupcron.sh      | 15 ---------------
 3 files changed, 1 insertion(+), 49 deletions(-)
 delete mode 100755 containerfiles/sendtierbeacon.sh
 delete mode 100755 containerfiles/setupcron.sh

diff --git a/Dockerfile b/Dockerfile
index f22a55b..8e8ebc6 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,10 +10,7 @@ RUN wget https://github.internet2.edu/TIER/shib-idp-ui/releases/download/v${vers
 FROM centos:7
 
 # beacon env
-ENV VERSION=1.18.0 \
-    TIERVERSION=PACKAGE_1.18.0 \
-    IMAGE=shibboleth_idp_ui \
-    MAINTAINER=InCommon
+ENV TIERVERSION=PACKAGE_1.18.0
 
 # Install Corretto Java JDK
 #Corretto download page: https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html
diff --git a/containerfiles/sendtierbeacon.sh b/containerfiles/sendtierbeacon.sh
deleted file mode 100755
index 069cd43..0000000
--- a/containerfiles/sendtierbeacon.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/bash
-LOGHOST="collector.testbed.tier.internet2.edu"
-LOGPORT="5001"
-if [ -s /opt/tier/env.bash ]; then
-  . /opt/tier/env.bash
-fi
-
-#below for syslog, F-TICKS style
-#LOGTEXT="TIERBEACON/TIER/1.0#IM=$IMAGENAME#PV=$VERSION#TR=$TIERVERSION#MT=$MAINTAINER#"
-
-#below for JSON/REST style
-LOGTEXT="{ \"msgType\" : \"TIERBEACON\", \"msgName\" : \"TIER\", \"msgVersion\" : \"1.0\", \"tbProduct\" : \"$IMAGENAME\", \"tbProductVersion\" : \"$VERSION\", \"tbTIERRelease\" : \"$TIERVERSION\", \"tbMaintainer\" : \"$MAINTAINER\" }"
-
-
-if [ -z "$TIER_BEACON_OPT_OUT" ]; then
-  #send JSON
-  echo $LOGTEXT > msgjson.txt
-  curl -s -XPOST "${LOGHOST}:${LOGPORT}/" -H 'Content-Type: application/json' -T msgjson.txt 1>/dev/null
-  if [ $? -eq 0 ]; then
-        echo "tier_beacon;none;$ENV;$USERTOKEN;"`date`"; TIER beacon sent"
-  else
-        echo "tier_beacon;none;$ENV;$USERTOKEN;"`date`"; Failed to send TIER beacon"
-  fi
-  
-  rm -f msgjson.txt
-  
-  #below is for syslog, F-TICKS style
-  #`logger -n $LOGHOST -P $LOGPORT -t TIERBEACON $LOGTEXT`
-
-fi
diff --git a/containerfiles/setupcron.sh b/containerfiles/setupcron.sh
deleted file mode 100755
index a0341a3..0000000
--- a/containerfiles/setupcron.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/bash
-
-CRONFILE=/opt/tier/tier-CRONFILE
-if [ ! -f /opt/tier/env.bash ]; then
-    printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^VERSION" > /opt/tier/env.bash
-    printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^TIERVERSION" >> /opt/tier/env.bash
-    printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^IMAGE" >> /opt/tier/env.bash
-    printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^MAINTAINER" >> /opt/tier/env.bash
-fi
-
-echo $(expr $RANDOM % 59) $(expr $RANDOM % 3) "* * * /usr/bin/sendtierbeacon.sh >> /proc/1/fd/1 2>&1" >> ${CRONFILE}
-chmod 644 ${CRONFILE}
-
-#install crontab
-crontab ${CRONFILE}
\ No newline at end of file