Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
658b8d4dd8
|
|||
|
df6381fd5e
|
|||
|
a11e5f2f3e
|
|||
|
7a8e484632
|
|||
|
1f771fb73f
|
|||
|
34c8f03571
|
|||
|
dfac4c0fe9
|
|||
|
9860014420
|
|||
|
bfce0c22c0
|
|||
|
828290d9ba
|
|||
|
96e3be543b
|
|||
|
c8781e3a3d
|
@@ -6,6 +6,8 @@ EMAIL_FROM="noreply@lauf-fuer-kaya.de"
|
||||
EMAIL_REPLYTO="info@lauf-fuer-kaya.de"
|
||||
REDIS_URL=redis://localhost:6379
|
||||
FRONTEND_URL="https://run.lauf-fuer-kaya.de"
|
||||
DOCUMENT_SERVER_URL="https://documents.run.lauf-fuer-kaya.de"
|
||||
AUTHKEY=""
|
||||
EVENT_DATE="23.05.2025"
|
||||
EVENT_NAME="Lauf für Kaya! 2025"
|
||||
NODE_ENV=production
|
||||
@@ -1,19 +1,4 @@
|
||||
steps:
|
||||
- name: build latest
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
repo: registry.odit.services/lfk/mailer
|
||||
tags:
|
||||
- latest
|
||||
registry: registry.odit.services
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache_from: registry.odit.services/lfk/mailer:dev
|
||||
username:
|
||||
from_secret: odit-registry-builder-username
|
||||
password:
|
||||
from_secret: odit-registry-builder-password
|
||||
when:
|
||||
branch: main
|
||||
- name: build dev
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
|
||||
16
Dockerfile
16
Dockerfile
@@ -1,21 +1,7 @@
|
||||
FROM oven/bun:1.1.36-slim
|
||||
# FROM oven/bun:1.0.25
|
||||
|
||||
FROM oven/bun:1.1.40-slim
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
|
||||
# Install dependencies
|
||||
COPY package.json .
|
||||
RUN bun i
|
||||
# COPY package.json bun.lockb ./
|
||||
# RUN bun install --frozen-lockfile
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Expose the application port
|
||||
EXPOSE 3000
|
||||
|
||||
# Start the application
|
||||
CMD ["bun", "run", "start"]
|
||||
11
package.json
11
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@odit/lfk-mailer",
|
||||
"version": "1.0.2",
|
||||
"version": "1.2.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -11,11 +11,10 @@
|
||||
"@hono/node-server": "1.13.7",
|
||||
"@hono/swagger-ui": "0.5.0",
|
||||
"@hono/zod-openapi": "0.18.3",
|
||||
"@hono/zod-validator": "0.4.1",
|
||||
"bullmq": "5.34.0",
|
||||
"bwip-js": "4.5.1",
|
||||
"@hono/zod-validator": "0.4.2",
|
||||
"bullmq": "5.34.3",
|
||||
"handlebars": "4.7.8",
|
||||
"hono": "4.6.13",
|
||||
"hono": "4.6.14",
|
||||
"ioredis": "5.4.1",
|
||||
"nodemailer": "6.9.16",
|
||||
"zod": "3.24.1"
|
||||
@@ -23,6 +22,6 @@
|
||||
"devDependencies": {
|
||||
"@types/node": "22.10.2",
|
||||
"@types/nodemailer": "6.4.17",
|
||||
"bun-types": "1.1.38"
|
||||
"bun-types": "1.1.40"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { z } from 'zod'
|
||||
import { EmailService } from '../services/email'
|
||||
import { getEmailTemplate } from '../templates'
|
||||
import { Language } from '../types'
|
||||
import { toBuffer } from 'bwip-js/node'
|
||||
|
||||
const emailRouter = new Hono()
|
||||
const emailService = new EmailService()
|
||||
@@ -18,20 +17,7 @@ const sendEmailSchema = z.object({
|
||||
})
|
||||
|
||||
async function generateBarcodeDataURL(data) {
|
||||
return `https://barcodeapi.org/api/128/${data}`
|
||||
const buffer = await toBuffer({
|
||||
bcid: 'code128',
|
||||
text: data,
|
||||
scale: 3,
|
||||
height: 10,
|
||||
includetext: true,
|
||||
textxalign: 'center',
|
||||
});
|
||||
|
||||
const base64Data = buffer.toString('base64');
|
||||
const dataURL = `data:image/png;base64,${base64Data}`;
|
||||
|
||||
return dataURL;
|
||||
return `${process.env.DOCUMENT_SERVER_URL}/v1/barcodes/code128/${data}`
|
||||
}
|
||||
|
||||
emailRouter.post('/', bearerAuth({ token: process.env.AUTHKEY }), zValidator('json', sendEmailSchema), async (c) => {
|
||||
|
||||
@@ -175,8 +175,10 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
"
|
||||
>
|
||||
Am Lauftag (<strong>{{event_date}}</strong>) musst du nur noch diesen
|
||||
Barcode vorzeigen, damit erhältst du deine Läuferkarte.
|
||||
Am Lauftag (<strong>{{event_date}}</strong>) musst du nur noch
|
||||
diesen Barcode vorzeigen, damit erhältst du deine Läuferkarte.<br />Der
|
||||
Bürger- & Firmenlauf findet von
|
||||
<strong>13:00 bis 18:00 Uhr</strong> statt.
|
||||
</p>
|
||||
<table
|
||||
align="center"
|
||||
@@ -223,20 +225,103 @@
|
||||
"
|
||||
>
|
||||
Deinen Registrierungs-Code, Rundenzeiten und weitere Infos kannst
|
||||
du jederzeit im
|
||||
du jederzeit im Lauf für Kaya! Selfservice einsehen.
|
||||
</p>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="max-width: 100%; text-align: center; margin-bottom: 20px"
|
||||
>
|
||||
<tbody>
|
||||
<tr style="width: 100%">
|
||||
<td>
|
||||
<a
|
||||
href="{{link}}"
|
||||
rel="noopener noreferrer nofollow"
|
||||
style="
|
||||
color: #111827;
|
||||
text-decoration: underline;
|
||||
line-height: 100%;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
mso-padding-alt: 0px;
|
||||
color: #ffffff;
|
||||
background-color: #3a4bdd;
|
||||
border-color: #3a4bdd;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 0px;
|
||||
padding: 12px 32px 12px 32px;
|
||||
"
|
||||
target="_blank"
|
||||
>Lauf für Kaya! Selfservice</a
|
||||
><span
|
||||
><!--[if mso
|
||||
]><i
|
||||
style="mso-font-width: 400%; mso-text-raise: 18"
|
||||
hidden
|
||||
>    </i
|
||||
><!
|
||||
[endif]--></span
|
||||
><span
|
||||
style="
|
||||
max-width: 100%;
|
||||
display: inline-block;
|
||||
line-height: 120%;
|
||||
mso-padding-alt: 0px;
|
||||
mso-text-raise: 9px;
|
||||
"
|
||||
>Zum Selfservice Portal</span
|
||||
><span
|
||||
><!--[if mso
|
||||
]><i style="mso-font-width: 400%" hidden
|
||||
>    ​</i
|
||||
><!
|
||||
[endif]--></span
|
||||
></a
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p
|
||||
style="
|
||||
font-size: 15px;
|
||||
line-height: 26.25px;
|
||||
margin: 0 0 20px 0;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
color: #374151;
|
||||
"
|
||||
>
|
||||
Wenn der Button nicht funktioniert, kannst du diesen Link in
|
||||
deinen Browser kopieren:
|
||||
<code
|
||||
style="
|
||||
background-color: #efefef;
|
||||
color: #111827;
|
||||
padding: 2px 4px;
|
||||
border-radius: 6px;
|
||||
font-family: SFMono-Regular, Menlo, Monaco, Consolas,
|
||||
'Liberation Mono', 'Courier New', monospace;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0;
|
||||
"
|
||||
>{{link}}</code
|
||||
>
|
||||
einsehen.
|
||||
</p>
|
||||
<hr
|
||||
style="
|
||||
width: 100%;
|
||||
border: none;
|
||||
border-top: 1px solid #eaeaea;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 32px;
|
||||
"
|
||||
/>
|
||||
<p
|
||||
style="
|
||||
font-size: 15px;
|
||||
|
||||
@@ -175,7 +175,10 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
"
|
||||
>
|
||||
On the day of the run (<strong>{{event_date}}</strong>) you only have to show your barcode to receive your runner's card.
|
||||
On the day of the run (<strong>{{event_date}}</strong>) you only
|
||||
have to show your barcode to receive your runner's card.<br />The
|
||||
Citizens' & Company Run will take place from
|
||||
<strong> 1:00 p.m. to 6:00 p.m.</strong>
|
||||
</p>
|
||||
<table
|
||||
align="center"
|
||||
@@ -221,19 +224,104 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
"
|
||||
>
|
||||
You can view your registration code, lap times and further information at any time from the
|
||||
You can view your registration code, lap times and further
|
||||
information at any time from the Lauf für Kaya! Selfservice
|
||||
</p>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="max-width: 100%; text-align: center; margin-bottom: 20px"
|
||||
>
|
||||
<tbody>
|
||||
<tr style="width: 100%">
|
||||
<td>
|
||||
<a
|
||||
href="{{link}}"
|
||||
rel="noopener noreferrer nofollow"
|
||||
style="
|
||||
color: #111827;
|
||||
text-decoration: underline;
|
||||
line-height: 100%;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
mso-padding-alt: 0px;
|
||||
color: #ffffff;
|
||||
background-color: #3a4bdd;
|
||||
border-color: #3a4bdd;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 0px;
|
||||
padding: 12px 32px 12px 32px;
|
||||
"
|
||||
target="_blank"
|
||||
>Lauf für Kaya! Selfservice</a
|
||||
><span
|
||||
><!--[if mso
|
||||
]><i
|
||||
style="mso-font-width: 400%; mso-text-raise: 18"
|
||||
hidden
|
||||
>    </i
|
||||
><!
|
||||
[endif]--></span
|
||||
><span
|
||||
style="
|
||||
max-width: 100%;
|
||||
display: inline-block;
|
||||
line-height: 120%;
|
||||
mso-padding-alt: 0px;
|
||||
mso-text-raise: 9px;
|
||||
"
|
||||
>To the self-service portal</span
|
||||
><span
|
||||
><!--[if mso
|
||||
]><i style="mso-font-width: 400%" hidden
|
||||
>    ​</i
|
||||
><!
|
||||
[endif]--></span
|
||||
></a
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p
|
||||
style="
|
||||
font-size: 15px;
|
||||
line-height: 26.25px;
|
||||
margin: 0 0 20px 0;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
color: #374151;
|
||||
"
|
||||
>
|
||||
If the button doesn't work, you can copy this link into your
|
||||
browser:
|
||||
<code
|
||||
style="
|
||||
background-color: #efefef;
|
||||
color: #111827;
|
||||
padding: 2px 4px;
|
||||
border-radius: 6px;
|
||||
font-family: SFMono-Regular, Menlo, Monaco, Consolas,
|
||||
'Liberation Mono', 'Courier New', monospace;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0;
|
||||
"
|
||||
>{{link}}</code
|
||||
>
|
||||
</p>
|
||||
<hr
|
||||
style="
|
||||
width: 100%;
|
||||
border: none;
|
||||
border-top: 1px solid #eaeaea;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 32px;
|
||||
"
|
||||
/>
|
||||
<p
|
||||
style="
|
||||
font-size: 15px;
|
||||
@@ -262,7 +350,8 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
"
|
||||
>
|
||||
If you have any questions, please reply to this e-mail at any time or write to
|
||||
If you have any questions, please reply to this e-mail at any time
|
||||
or write to
|
||||
<u
|
||||
><strong
|
||||
><a
|
||||
|
||||
Reference in New Issue
Block a user