3 Commits

Author SHA1 Message Date
609422b5b9 fix: zero downtime deploy
Some checks failed
Build & Deploy / 🔍 Prepare Environment (push) Successful in 4s
Build & Deploy / 🧪 QA (push) Successful in 1m17s
Build & Deploy / 🏗️ Build (push) Successful in 6m10s
Build & Deploy / 🚀 Deploy (push) Failing after 1m22s
Build & Deploy / 🔔 Notifications (push) Successful in 2s
2026-02-09 12:02:33 +01:00
76cf6e7b62 fix: contact form
All checks were successful
Build & Deploy / 🔍 Prepare Environment (push) Successful in 5s
Build & Deploy / 🧪 QA (push) Successful in 1m53s
Build & Deploy / 🏗️ Build (push) Successful in 2m8s
Build & Deploy / 🚀 Deploy (push) Successful in 14s
Build & Deploy / 🔔 Notifications (push) Successful in 2s
2026-02-09 11:58:59 +01:00
cc04b71327 refactor: standardize mailer configuration by introducing a config module and renaming related environment variables.
All checks were successful
Build & Deploy / 🔍 Prepare Environment (push) Successful in 4s
Build & Deploy / 🧪 QA (push) Successful in 1m16s
Build & Deploy / 🏗️ Build (push) Successful in 5m31s
Build & Deploy / 🚀 Deploy (push) Successful in 9s
Build & Deploy / 🔔 Notifications (push) Successful in 1s
2026-02-08 11:33:17 +01:00
6 changed files with 52 additions and 2037 deletions

View File

@@ -251,14 +251,13 @@ jobs:
DIRECTUS_KEY=${{ secrets.DIRECTUS_KEY || vars.DIRECTUS_KEY }}
DIRECTUS_SECRET=${{ secrets.DIRECTUS_SECRET || vars.DIRECTUS_SECRET }}
# SMTP Config
SMTP_HOST=${{ secrets.SMTP_HOST || vars.SMTP_HOST }}
SMTP_PORT=${{ secrets.SMTP_PORT || vars.SMTP_PORT || '587' }}
SMTP_SECURE=${{ secrets.SMTP_SECURE || vars.SMTP_SECURE || 'false' }}
SMTP_USER=${{ secrets.SMTP_USER || vars.SMTP_USER }}
SMTP_PASS=${{ secrets.SMTP_PASS || vars.SMTP_PASS }}
SMTP_FROM=${{ secrets.SMTP_FROM || vars.SMTP_FROM }}
CONTACT_RECIPIENT=${{ secrets.CONTACT_RECIPIENT || vars.CONTACT_RECIPIENT }}
# Mail
MAIL_HOST=${{ secrets.SMTP_HOST || vars.SMTP_HOST }}
MAIL_PORT=${{ secrets.SMTP_PORT || vars.SMTP_PORT || '587' }}
MAIL_USERNAME=${{ secrets.SMTP_USER || vars.SMTP_USER }}
MAIL_PASSWORD=${{ secrets.SMTP_PASS || vars.SMTP_PASS }}
MAIL_FROM=${{ secrets.SMTP_FROM || vars.SMTP_FROM }}
MAIL_RECIPIENTS=${{ secrets.CONTACT_RECIPIENT || vars.CONTACT_RECIPIENT }}
# Authentication
GATEKEEPER_PASSWORD=${{ secrets.GATEKEEPER_PASSWORD || vars.GATEKEEPER_PASSWORD }}
@@ -289,7 +288,7 @@ jobs:
echo "${{ secrets.REGISTRY_PASS }}" | docker login registry.infra.mintel.me -u "${{ secrets.REGISTRY_USER }}" --password-stdin
docker compose -p "${{ needs.prepare.outputs.project_name }}" --env-file ${{ needs.prepare.outputs.env_file }} pull
docker compose -p "${{ needs.prepare.outputs.project_name }}" --env-file ${{ needs.prepare.outputs.env_file }} up -d --remove-orphans
docker compose -p "${{ needs.prepare.outputs.project_name }}" --env-file ${{ needs.prepare.outputs.env_file }} up -d --wait --remove-orphans
docker system prune -f --filter "until=24h"
EOF

View File

@@ -47,7 +47,14 @@ export async function POST(req: Request) {
logger.info("Contact submission saved to Directus");
directusSaved = true;
} catch (directusError) {
logger.error("Failed to save to Directus", { error: directusError });
const errorMessage =
directusError instanceof Error
? directusError.message
: String(directusError);
logger.error("Failed to save to Directus", {
error: errorMessage,
details: directusError,
});
services.errors.captureException(directusError, {
phase: "directus_save",
});
@@ -56,19 +63,20 @@ export async function POST(req: Request) {
// 2. Email sending
try {
const { config } = await import("@/lib/config");
const transporter = nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: parseInt(process.env.SMTP_PORT || "587"),
secure: process.env.SMTP_SECURE === "true",
host: config.mail.host,
port: config.mail.port,
secure: config.mail.port === 465,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS,
user: config.mail.user,
pass: config.mail.pass,
},
});
await transporter.sendMail({
from: process.env.SMTP_FROM,
to: process.env.CONTACT_RECIPIENT || "info@mb-grid-solutions.com",
from: config.mail.from,
to: config.mail.recipients.join(",") || "info@mb-grid-solutions.com",
replyTo: email,
subject: `Kontaktanfrage von ${name}`,
text: `

View File

@@ -27,6 +27,12 @@ services:
- "traefik.http.middlewares.${PROJECT_NAME}-auth.forwardauth.trustForwardHeader=true"
- "traefik.http.middlewares.${PROJECT_NAME}-auth.forwardauth.authResponseHeaders=X-Auth-User"
- "traefik.docker.network=infra"
healthcheck:
test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
gatekeeper:
image: registry.infra.mintel.me/mintel/gatekeeper:latest

2017
dump.sql

File diff suppressed because it is too large Load Diff

View File

@@ -23,15 +23,21 @@ export async function ensureAuthenticated() {
if (adminEmail && password) {
try {
await client.login({ email: adminEmail, password: password });
return;
} catch (e) {
if (typeof window === "undefined") {
getServerAppServices().errors.captureException(e, {
phase: "directus_auth",
phase: "directus_auth_fallback",
});
}
console.error("Failed to authenticate with Directus login fallback:", e);
throw e;
}
}
throw new Error(
"Missing Directus authentication credentials (token or admin email/password)",
);
}
export default client;

View File

@@ -25,7 +25,7 @@ REMOTE_DIR="/home/deploy/sites/${PRJ_ID}.com"
case $ENV in
testing) PROJECT_NAME="${PRJ_ID}-testing"; ENV_FILE=".env.testing" ;;
staging) PROJECT_NAME="${PRJ_ID}-staging"; ENV_FILE=".env.staging" ;;
production) PROJECT_NAME="${PRJ_ID}-prod"; ENV_FILE=".env.prod" ;;
production) PROJECT_NAME="${PRJ_ID}-production"; ENV_FILE=".env.prod" ;;
*) echo "❌ Invalid environment: $ENV"; exit 1 ;;
esac
@@ -35,8 +35,21 @@ DB_NAME="directus"
echo "🔍 Detecting local database..."
LOCAL_DB_CONTAINER=$(docker compose ps -q directus-db)
if [ -z "$LOCAL_DB_CONTAINER" ]; then
echo "❌ Local directus-db container not found. Is it running? (npm run dev)"
# Check if it exists but is stopped
LOCAL_DB_EXISTS=$(docker compose ps -a -q directus-db)
if [ -n "$LOCAL_DB_EXISTS" ]; then
echo "⏳ Local directus-db is stopped. Starting it..."
docker compose up -d directus-db
# Wait a few seconds for PG to be ready
sleep 2
LOCAL_DB_CONTAINER=$(docker compose ps -q directus-db)
fi
fi
if [ -z "$LOCAL_DB_CONTAINER" ]; then
echo "❌ Local directus-db container not found. Is it defined in docker-compose.yaml?"
exit 1
fi