This commit is contained in:
2021-02-22 13:02:14 +01:00
parent 68a71d2266
commit b0223cff24
3 changed files with 10 additions and 8 deletions

View File

@ -4,7 +4,7 @@ LABEL Maintainer="Wolfgang Hottgenroth <woho@hottis.de>"
LABEL ImageName="registry.hottis.de/dockerized/cron-docker" LABEL ImageName="registry.hottis.de/dockerized/cron-docker"
ARG SMARTHOST="172.16.11.15" ARG SMARTHOST="172.16.11.15"
ARG ADMINUSER="wolfgang.hottgenroth@icloud.com" ARG MAILDOMAIN="hottis.de"
ARG APP_DIR="/opt/app" ARG APP_DIR="/opt/app"
RUN \ RUN \
@ -18,13 +18,11 @@ RUN \
sed -i \ sed -i \
-e "s/dc_eximconfig_configtype='local'/dc_eximconfig_configtype='satellite'/" \ -e "s/dc_eximconfig_configtype='local'/dc_eximconfig_configtype='satellite'/" \
-e "s/dc_smarthost=''/dc_smarthost='${SMARTHOST}'/" \ -e "s/dc_smarthost=''/dc_smarthost='${SMARTHOST}'/" \
-e "s/dc_readhost=''/dc_readhost='${MAILDOMAIN}'/" \
/etc/exim4/update-exim4.conf.conf && \ /etc/exim4/update-exim4.conf.conf && \
env DEBIAN_FRONTEND=noninteractive dpkg-reconfigure -f debconf exim4-config && \ env DEBIAN_FRONTEND=noninteractive dpkg-reconfigure -f debconf exim4-config && \
mkdir -p ${APP_DIR} && \ mkdir -p ${APP_DIR} && \
useradd -d ${APP_DIR} -u 1000 user && \ useradd -d ${APP_DIR} -u 1000 user
echo "root: ${ADMINUSER}" >> /etc/aliases && \
echo "user: ${ADMINUSER}" >> /etc/aliases && \
newaliases
COPY crontab /etc/ COPY crontab /etc/
COPY *.py ${APP_DIR}/ COPY *.py ${APP_DIR}/

View File

@ -33,7 +33,7 @@ try:
mietersToReport.append({ mietersToReport.append({
'vorname': mieter['vorname'], 'vorname': mieter['vorname'],
'nachname': mieter['nachname'], 'nachname': mieter['nachname'],
'saldo': "{10.2f}".format(saldoByMieter['saldo']) 'saldo': "{:.2f}".format(saldoByMieter['saldo'])
}) })
params = { 'mietersToReport': mietersToReport } params = { 'mietersToReport': mietersToReport }
report = Template(file=TEMPLATE_FILE, searchList=[ params ]) report = Template(file=TEMPLATE_FILE, searchList=[ params ])

View File

@ -1,11 +1,15 @@
<html> <html>
<head></head> <head>
<style type="text/css">
td.saldo { text-align: right }
</style>
</head>
<body> <body>
<table> <table>
#for $mieter in $mietersToReport #for $mieter in $mietersToReport
<tr> <tr>
<td>$mieter.vorname $mieter.nachname</td> <td>$mieter.vorname $mieter.nachname</td>
<td>$mieter.saldo €</td> <td class="saldo">$mieter.saldo €</td>
</tr> </tr>
#end for #end for
</table> </table>