Skip to content

Commit 2fb715a

Browse files
committed
fix Docker container
working currently sending with display name "root"
1 parent bc3e8a9 commit 2fb715a

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

grades-docker/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
FROM ghcr.io/jm-lemmi/anyconnect-simple
33

44
# install python and package
5-
RUN apk --upgrade add git python
6-
RUN pip install git+https://github.com/TINF21CS1/python-campusnet
5+
RUN apk --update add git python3
6+
RUN python3 -m ensurepip
7+
RUN pip3 install --no-cache --upgrade pip setuptools
8+
RUN pip install git+https://github.com/TINF21CS1/python-campusnet@dev
79

810
# Add crontab
911
COPY grades.sh /app/grades.sh
@@ -23,4 +25,4 @@ ENV HOST drogon.dhbw-mannheim.de
2325
RUN apk add ssmtp
2426

2527
COPY entrypoint.sh /app/entrypoint.sh
26-
CMD /bin/bash /app/entrypoint.sh
28+
CMD /bin/sh /app/entrypoint.sh

grades-docker/Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker run --privileged -e "USERNAME=s212689@student.dhbw-mannheim.de" -e "VPNUSERNAME=s212689" -e "PASSWORD=xxxxxxxxxxxxxxxx" 9cccf8dd9ca9

grades-docker/entrypoint.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ if [[ -z "${NOTIFY_RECIPIENT}" ]]; then
66
NOTIFY_RECIPIENT="${USERNAME}"
77
fi
88

9-
crond
10-
echo "$(date +"%b %d %H:%M:%S") $HOSTNAME entrypoint.sh[$$]: Started crond."
11-
echo $PASSWORD | openconnect -b --user=$USERNAME --authgroup=$AUTHGROUP --passwd-on-stdin $HOST
9+
echo $PASSWORD | openconnect -b --user=$VPNUSERNAME --authgroup=$AUTHGROUP --passwd-on-stdin $HOST
1210
echo "$(date +"%b %d %H:%M:%S") $HOSTNAME entrypoint.sh[$$]: Started openconnect."
13-
echo -e "root=${USERNAME}\nmailhub=studgate.dhbw-mannheim.de:25\nrewriteDomain=student.dhbw-mannheim.de\nhostname=${hostname}\nAuthUser=${USERNAME}\nAuthPass=${PASSWORD}\nAuthMethod=LOGIN\nFromLineOverride=no" > /etc/ssmtp/ssmtp.conf
14-
echo -e "root:${USERNAME}:studgate.dhbw-mannheim.de:25"
15-
chfn -f 'Campusnet Grades' root
16-
echo "$(date +"%b %d %H:%M:%S") $HOSTNAME entrypoint.sh[$$]: Updates ssmtp configuration."
11+
echo -e "root=${USERNAME}\nmailhub=studgate.dhbw-mannheim.de:25\nrewriteDomain=student.dhbw-mannheim.de\nhostname=campusnet.docker.local\nAuthUser=${USERNAME}\nAuthPass=${PASSWORD}\nAuthMethod=LOGIN\nFromLineOverride=no" > /etc/ssmtp/ssmtp.conf
12+
echo -e "root:${USERNAME}:studgate.dhbw-mannheim.de:25" > /etc/ssmtp/revaliases
13+
echo "$(date +"%b %d %H:%M:%S") $HOSTNAME entrypoint.sh[$$]: Updated ssmtp configuration."
1714

18-
echo "$(date +"%b %d %H:%M:%S") $HOSTNAME start.sh[$$]: ➔ Switching to log output from 'grep CRON /var/log/syslog'"
19-
tail -f grep CRON /var/log/syslog
15+
echo "$(date +"%b %d %H:%M:%S") $HOSTNAME entrypoint.sh[$$]: Starting crond..."
16+
crond -f

0 commit comments

Comments
 (0)