16 Commits
1.0.0 ... 1.2.1

Author SHA1 Message Date
658b8d4dd8 chore: 1.2.1 2025-03-18 23:38:08 +01:00
df6381fd5e feat: new email templates 2025-03-18 23:37:28 +01:00
a11e5f2f3e ci: drop main branch
All checks were successful
ci/woodpecker/push/build Pipeline was successful
2024-12-18 18:01:12 +01:00
7a8e484632 chore: 1.2.0
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/tag/release Pipeline was successful
2024-12-18 18:00:06 +01:00
1f771fb73f feat: NODE_ENV=production 2024-12-18 17:59:40 +01:00
34c8f03571 refactor: dockerfile 2024-12-18 17:59:30 +01:00
dfac4c0fe9 chore(deps): bun:1.1.40 2024-12-18 17:59:24 +01:00
9860014420 chore(deps): bump all
Some checks failed
ci/woodpecker/push/build Pipeline failed
2024-12-18 17:59:10 +01:00
bfce0c22c0 chore: 1.1.1
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/release Pipeline was successful
2024-12-12 18:55:05 +01:00
828290d9ba fix(env): no trailing slash for DOCUMENT_SERVER_URL 2024-12-12 18:54:53 +01:00
96e3be543b chore: 1.1.0
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/release Pipeline was successful
2024-12-12 18:37:43 +01:00
c8781e3a3d refactor: move barcode generation to document server 2024-12-12 18:37:25 +01:00
22ab25045c chore: 1.0.2
All checks were successful
ci/woodpecker/tag/release Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
2024-12-11 22:59:17 +01:00
2230259e4a Merge branch 'dev' of https://git.odit.services/lfk/mailer into dev
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/release Pipeline was successful
2024-12-11 22:55:42 +01:00
57f3a910f6 tmp-fix(templates): use barcode generation api 2024-12-11 22:55:30 +01:00
9076a9488e fix(templates): use logo from frontend 2024-12-11 22:55:15 +01:00
10 changed files with 216 additions and 83 deletions

View File

@@ -6,6 +6,8 @@ EMAIL_FROM="noreply@lauf-fuer-kaya.de"
EMAIL_REPLYTO="info@lauf-fuer-kaya.de" EMAIL_REPLYTO="info@lauf-fuer-kaya.de"
REDIS_URL=redis://localhost:6379 REDIS_URL=redis://localhost:6379
FRONTEND_URL="https://run.lauf-fuer-kaya.de" FRONTEND_URL="https://run.lauf-fuer-kaya.de"
DOCUMENT_SERVER_URL="https://documents.run.lauf-fuer-kaya.de"
AUTHKEY="" AUTHKEY=""
EVENT_DATE="23.05.2025" EVENT_DATE="23.05.2025"
EVENT_NAME="Lauf für Kaya! 2025" EVENT_NAME="Lauf für Kaya! 2025"
NODE_ENV=production

View File

@@ -1,19 +1,4 @@
steps: 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 - name: build dev
image: woodpeckerci/plugin-docker-buildx image: woodpeckerci/plugin-docker-buildx
settings: settings:

View File

@@ -1,21 +1,7 @@
FROM oven/bun:1.1.36-slim FROM oven/bun:1.1.40-slim
# FROM oven/bun:1.0.25
WORKDIR /app WORKDIR /app
# Copy package files
# Install dependencies
COPY package.json . COPY package.json .
RUN bun i RUN bun i
# COPY package.json bun.lockb ./
# RUN bun install --frozen-lockfile
# Copy source code
COPY . . COPY . .
# Expose the application port
EXPOSE 3000 EXPOSE 3000
# Start the application
CMD ["bun", "run", "start"] CMD ["bun", "run", "start"]

BIN
bun.lockb Normal file → Executable file

Binary file not shown.

View File

@@ -1,6 +1,6 @@
{ {
"name": "@odit/lfk-mailer", "name": "@odit/lfk-mailer",
"version": "1.0.0", "version": "1.2.1",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
@@ -11,11 +11,10 @@
"@hono/node-server": "1.13.7", "@hono/node-server": "1.13.7",
"@hono/swagger-ui": "0.5.0", "@hono/swagger-ui": "0.5.0",
"@hono/zod-openapi": "0.18.3", "@hono/zod-openapi": "0.18.3",
"@hono/zod-validator": "0.4.1", "@hono/zod-validator": "0.4.2",
"bullmq": "5.34.0", "bullmq": "5.34.3",
"bwip-js": "4.5.1",
"handlebars": "4.7.8", "handlebars": "4.7.8",
"hono": "4.6.13", "hono": "4.6.14",
"ioredis": "5.4.1", "ioredis": "5.4.1",
"nodemailer": "6.9.16", "nodemailer": "6.9.16",
"zod": "3.24.1" "zod": "3.24.1"
@@ -23,6 +22,6 @@
"devDependencies": { "devDependencies": {
"@types/node": "22.10.2", "@types/node": "22.10.2",
"@types/nodemailer": "6.4.17", "@types/nodemailer": "6.4.17",
"bun-types": "1.1.38" "bun-types": "1.1.40"
} }
} }

View File

@@ -5,7 +5,6 @@ import { z } from 'zod'
import { EmailService } from '../services/email' import { EmailService } from '../services/email'
import { getEmailTemplate } from '../templates' import { getEmailTemplate } from '../templates'
import { Language } from '../types' import { Language } from '../types'
import { toBuffer } from 'bwip-js/node'
const emailRouter = new Hono() const emailRouter = new Hono()
const emailService = new EmailService() const emailService = new EmailService()
@@ -18,19 +17,7 @@ const sendEmailSchema = z.object({
}) })
async function generateBarcodeDataURL(data) { async function generateBarcodeDataURL(data) {
const buffer = await toBuffer({ return `${process.env.DOCUMENT_SERVER_URL}/v1/barcodes/code128/${data}`
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;
} }
emailRouter.post('/', bearerAuth({ token: process.env.AUTHKEY }), zValidator('json', sendEmailSchema), async (c) => { emailRouter.post('/', bearerAuth({ token: process.env.AUTHKEY }), zValidator('json', sendEmailSchema), async (c) => {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long