diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml
deleted file mode 100644
index 2ac3fc0..0000000
--- a/.github/workflows/actions.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: GitHub Actions
-
-on:
- pull_request:
- branches:
- - main
- push:
- branches:
- - main
-
-jobs:
- build:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- node-version:
- - 18
- - 20
- - 22
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js v${{ matrix.node-version }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ matrix.node-version }}
- cache: npm
- - run: npm ci
- - run: npm run build
- # - run: npm test
-
- check:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js 22
- uses: actions/setup-node@v4
- with:
- node-version: 22
- cache: npm
- - run: npm ci
- - run: npm run check
diff --git a/check-email-delivery.cjs b/check-email-delivery.cjs
deleted file mode 100644
index fa86721..0000000
--- a/check-email-delivery.cjs
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- * Email Delivery Test Script
- *
- * This script tests email delivery by sending test emails to different addresses
- * and with different configurations to help diagnose delivery issues.
- */
-
-const nodemailer = require('nodemailer');
-require('dotenv').config();
-
-// Environment variables
-const {
- SMTP_HOST = 'smtp.protonmail.ch',
- SMTP_PORT = '587',
- SMTP_USER = '',
- SMTP_PASS = '',
- ADMIN_EMAIL = 'richard@bergsma.it',
- WEBSITE_NAME = 'bergsma.it',
- NODE_ENV = 'development'
-} = process.env;
-
-// Set to production mode for this test
-const isProduction = true;
-
-console.log('Email Delivery Test');
-console.log('------------------');
-console.log('Configuration:');
-console.log(`SMTP Host: ${SMTP_HOST}`);
-console.log(`SMTP Port: ${SMTP_PORT}`);
-console.log(`SMTP User: ${SMTP_USER}`);
-console.log(`Admin Email: ${ADMIN_EMAIL}`);
-console.log(`Website Name: ${WEBSITE_NAME}`);
-console.log(`Mode: ${isProduction ? 'production' : 'development'}`);
-console.log('------------------');
-
-// Create a transporter
-const transporter = nodemailer.createTransport({
- host: SMTP_HOST,
- port: parseInt(SMTP_PORT, 10),
- secure: parseInt(SMTP_PORT, 10) === 465,
- auth: {
- user: SMTP_USER,
- pass: SMTP_PASS,
- },
- tls: {
- rejectUnauthorized: false,
- ciphers: 'SSLv3'
- },
- debug: true
-});
-
-// Verify connection
-console.log('Testing SMTP connection...');
-transporter.verify(function(error, success) {
- if (error) {
- console.error('SMTP Connection Error:', error);
- process.exit(1);
- }
-
- console.log('SMTP Connection Successful!');
- runTests();
-});
-
-// Run a series of email delivery tests
-async function runTests() {
- try {
- // Test 1: Basic email to admin
- console.log('\nTest 1: Sending basic email to admin...');
- await sendTestEmail(
- ADMIN_EMAIL,
- 'Email Delivery Test 1 - Basic',
- 'This is a basic test email to the admin address.',
- `
This is a basic test email to the admin address.
Time: ${new Date().toISOString()}
`
- );
-
- // Test 2: Email with different From address
- console.log('\nTest 2: Sending email with different From address...');
- await sendTestEmail(
- ADMIN_EMAIL,
- 'Email Delivery Test 2 - Different From',
- 'This email uses a different From address.',
- `
This email uses a different From address.
Time: ${new Date().toISOString()}
`,
- `"Test Sender" <${SMTP_USER}>`
- );
-
- // Test 3: Email with contact form format
- console.log('\nTest 3: Sending email in contact form format...');
- const contactFormHtml = `
-
-
New Contact Form Submission
-
From: Test User (test@example.com)
-
Submitted on: ${new Date().toLocaleString()}
-
-
Message:
-
This is a test message simulating a contact form submission.
-
-
-
This is an automated email from your website contact form.
-
-
- `;
- await sendTestEmail(
- ADMIN_EMAIL,
- 'New Contact Form Submission (Test)',
- 'This is a test message simulating a contact form submission.',
- contactFormHtml
- );
-
- console.log('\nAll tests completed successfully!');
- console.log('\nPlease check your inbox (and spam folder) for the test emails.');
- console.log('If you received some emails but not others, this can help identify the issue.');
-
- } catch (error) {
- console.error('Error running tests:', error);
- }
-}
-
-// Helper function to send a test email
-async function sendTestEmail(to, subject, text, html, from = `"${WEBSITE_NAME}" <${ADMIN_EMAIL}>`) {
- try {
- const info = await transporter.sendMail({
- from,
- to,
- subject,
- text,
- html
- });
-
- console.log(`Email sent successfully!`);
- console.log(`Message ID: ${info.messageId}`);
- console.log(`Response: ${info.response}`);
- return info;
- } catch (error) {
- console.error('Error sending email:', error);
- throw error;
- }
-}
\ No newline at end of file
diff --git a/email-test.cjs b/email-test.cjs
deleted file mode 100644
index 8e04555..0000000
--- a/email-test.cjs
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * ProtonMail SMTP Test Script
- *
- * This script tests the SMTP configuration for sending emails through ProtonMail.
- * Run with: node email-test.cjs
- */
-
-const nodemailer = require('nodemailer');
-require('dotenv').config();
-
-// Get SMTP settings from environment variables
-const {
- SMTP_HOST = 'smtp.protonmail.ch',
- SMTP_PORT = '587',
- SMTP_USER,
- SMTP_PASS,
- ADMIN_EMAIL,
- WEBSITE_NAME = 'Website'
-} = process.env;
-
-console.log('Email Configuration Test');
-console.log('----------------------');
-console.log(`SMTP Host: ${SMTP_HOST}`);
-console.log(`SMTP Port: ${SMTP_PORT}`);
-console.log(`SMTP User: ${SMTP_USER}`);
-console.log(`Admin Email: ${ADMIN_EMAIL}`);
-console.log(`Environment: ${process.env.NODE_ENV || 'development'}`);
-console.log('----------------------');
-
-// Create a transporter with ProtonMail-specific settings
-const transporter = nodemailer.createTransport({
- host: SMTP_HOST,
- port: parseInt(SMTP_PORT, 10),
- secure: parseInt(SMTP_PORT, 10) === 465, // true for 465, false for other ports
- auth: {
- user: SMTP_USER,
- pass: SMTP_PASS,
- },
- tls: {
- // Do not fail on invalid certs
- rejectUnauthorized: false,
- // Specific ciphers for ProtonMail
- ciphers: 'SSLv3'
- },
- debug: true // Enable debug output
-});
-
-// Test the connection
-console.log('Testing SMTP connection...');
-transporter.verify((error, success) => {
- if (error) {
- console.error('SMTP Connection Error:', error);
- console.error('\nTroubleshooting Tips:');
- console.error('1. Check if your SMTP credentials are correct');
- console.error('2. For ProtonMail, ensure you\'re using an app-specific password');
- console.error('3. If using ProtonMail Bridge, make sure it\'s running');
- console.error('4. Verify your server allows outgoing connections on the SMTP port');
- process.exit(1);
- } else {
- console.log('SMTP Connection Successful!');
-
- // Send a test email
- console.log('\nSending a test email...');
- const mailOptions = {
- from: `"${WEBSITE_NAME}" <${SMTP_USER}>`,
- to: ADMIN_EMAIL,
- subject: 'Email Configuration Test',
- text: 'This is a test email to verify your website\'s email configuration is working correctly.',
- html: `
-
-
Email Configuration Test
-
This is a test email to verify your website's email configuration is working correctly.
-
Configuration Details:
-
-
SMTP Host: ${SMTP_HOST}
-
SMTP Port: ${SMTP_PORT}
-
From: ${SMTP_USER}
-
To: ${ADMIN_EMAIL}
-
Time: ${new Date().toISOString()}
-
-
- This is an automated test email. If you received this, your email configuration is working correctly.
-
-
- `
- };
-
- transporter.sendMail(mailOptions, (error, info) => {
- if (error) {
- console.error('Error sending test email:', error);
- process.exit(1);
- } else {
- console.log('Test email sent successfully!');
- console.log('Message ID:', info.messageId);
- console.log('Response:', info.response);
- console.log('\nIf you received the test email, your email configuration is working correctly.');
- process.exit(0);
- }
- });
- }
-});
\ No newline at end of file
diff --git a/production-email-test.cjs b/production-email-test.cjs
deleted file mode 100644
index 4b36cb0..0000000
--- a/production-email-test.cjs
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
- * Production Email Test Script
- *
- * This script tests email delivery in production mode by sending test emails
- * with various configurations to help diagnose delivery issues.
- *
- * Run with: NODE_ENV=production node production-email-test.cjs
- */
-
-const nodemailer = require('nodemailer');
-require('dotenv').config();
-
-// Environment variables
-const {
- SMTP_HOST = '',
- SMTP_PORT = '587',
- SMTP_USER = '',
- SMTP_PASS = '',
- ADMIN_EMAIL = '',
- WEBSITE_NAME = 'bergsma.it',
- NODE_ENV = 'production'
-} = process.env;
-
-// Force production mode
-const isProduction = true;
-
-console.log('Production Email Test');
-console.log('--------------------');
-console.log('Configuration:');
-console.log(`SMTP Host: ${SMTP_HOST}`);
-console.log(`SMTP Port: ${SMTP_PORT}`);
-console.log(`SMTP User: ${SMTP_USER}`);
-console.log(`Admin Email: ${ADMIN_EMAIL}`);
-console.log(`Website Name: ${WEBSITE_NAME}`);
-console.log(`Mode: ${isProduction ? 'production' : 'development'}`);
-console.log('--------------------');
-
-// Create a transporter
-function createTransporter(options = {}) {
- const isProtonMail = SMTP_HOST.includes('protonmail');
-
- return nodemailer.createTransport({
- host: SMTP_HOST,
- port: parseInt(SMTP_PORT, 10),
- secure: parseInt(SMTP_PORT, 10) === 465,
- auth: {
- user: SMTP_USER,
- pass: SMTP_PASS,
- },
- ...(isProtonMail && {
- tls: {
- rejectUnauthorized: false,
- ciphers: 'SSLv3'
- }
- }),
- debug: true,
- ...options
- });
-}
-
-// Test different transporter configurations
-async function runTests() {
- try {
- // Test 1: Basic configuration
- console.log('\nTest 1: Basic configuration');
- const transporter1 = createTransporter();
- await testTransporter(transporter1, 'Basic configuration');
-
- // Test 2: With secure=false explicitly set
- console.log('\nTest 2: With secure=false explicitly set');
- const transporter2 = createTransporter({ secure: false });
- await testTransporter(transporter2, 'secure=false configuration');
-
- // Test 3: With requireTLS=true
- console.log('\nTest 3: With requireTLS=true');
- const transporter3 = createTransporter({ requireTLS: true });
- await testTransporter(transporter3, 'requireTLS=true configuration');
-
- // Test 4: With different from address
- console.log('\nTest 4: With different from address');
- const transporter4 = createTransporter();
- await testTransporter(
- transporter4,
- 'Different from address',
- { from: `"Test" <${SMTP_USER}>` }
- );
-
- console.log('\nAll tests completed!');
-
- } catch (error) {
- console.error('Error running tests:', error);
- }
-}
-
-// Test a specific transporter configuration
-async function testTransporter(transporter, testName, options = {}) {
- console.log(`Testing ${testName}...`);
-
- try {
- // Verify connection
- await new Promise((resolve, reject) => {
- transporter.verify((error, success) => {
- if (error) {
- console.error(`Connection test failed for ${testName}:`, error);
- reject(error);
- } else {
- console.log(`Connection successful for ${testName}`);
- resolve(success);
- }
- });
- });
-
- // Send test email
- const fromAddress = options.from || `"${WEBSITE_NAME}" <${SMTP_USER}>`;
-
- const info = await transporter.sendMail({
- from: fromAddress,
- to: ADMIN_EMAIL,
- subject: `Production Email Test: ${testName}`,
- text: `This is a test email from the production-email-test.cjs script using ${testName}.\n\nTime: ${new Date().toISOString()}`,
- html: `
-
-
Production Email Test: ${testName}
-
This is a test email from the production-email-test.cjs script using ${testName}.
-
Time: ${new Date().toISOString()}
-
Configuration:
-
-
SMTP Host: ${SMTP_HOST}
-
SMTP Port: ${SMTP_PORT}
-
From: ${fromAddress}
-
To: ${ADMIN_EMAIL}
-
-
- `
- });
-
- console.log(`Email sent successfully for ${testName}!`);
- console.log(`Message ID: ${info.messageId}`);
- console.log(`Response: ${info.response}`);
-
- return info;
- } catch (error) {
- console.error(`Error in ${testName}:`, error);
- throw error;
- }
-}
-
-// Run the tests
-runTests().catch(error => {
- console.error('Unhandled error:', error);
- process.exit(1);
-});
\ No newline at end of file
diff --git a/protonmail-test.cjs b/protonmail-test.cjs
deleted file mode 100644
index beb9c35..0000000
--- a/protonmail-test.cjs
+++ /dev/null
@@ -1,69 +0,0 @@
-// Simple ProtonMail SMTP test
-const nodemailer = require('nodemailer');
-require('dotenv').config();
-
-// Get SMTP settings from environment variables
-const {
- SMTP_HOST = 'smtp.protonmail.ch',
- SMTP_PORT = '587',
- SMTP_USER,
- SMTP_PASS,
- ADMIN_EMAIL
-} = process.env;
-
-console.log('ProtonMail SMTP Test');
-console.log('-------------------');
-console.log(`SMTP Host: ${SMTP_HOST}`);
-console.log(`SMTP Port: ${SMTP_PORT}`);
-console.log(`SMTP User: ${SMTP_USER}`);
-console.log(`Admin Email: ${ADMIN_EMAIL}`);
-
-// ProtonMail specific configuration
-const transporter = nodemailer.createTransport({
- host: SMTP_HOST,
- port: parseInt(SMTP_PORT, 10),
- secure: false, // For ProtonMail, use false for port 587
- auth: {
- user: SMTP_USER,
- pass: SMTP_PASS,
- },
- tls: {
- // Do not fail on invalid certs
- rejectUnauthorized: false,
- // Specific ciphers for ProtonMail
- ciphers: 'SSLv3'
- },
- logger: true,
- debug: true // Include SMTP traffic in the logs
-});
-
-// Verify connection
-console.log('\nTesting connection to ProtonMail SMTP server...');
-transporter.verify(function(error, _success) {
- if (error) {
- console.error('Connection failed:', error);
- process.exit(1);
- } else {
- console.log('Server is ready to take our messages');
-
- // Send test email
- console.log('\nSending test email...');
- transporter.sendMail({
- from: SMTP_USER,
- to: ADMIN_EMAIL,
- subject: 'ProtonMail SMTP Test',
- text: 'This is a test email from your website contact form.',
- html: '
This is a test email from your website contact form.
'
- }, (err, info) => {
- if (err) {
- console.error('Error sending email:', err);
- process.exit(1);
- } else {
- console.log('Message sent successfully!');
- console.log('Message ID:', info.messageId);
- console.log('Response:', info.response);
- process.exit(0);
- }
- });
- }
-});
\ No newline at end of file
diff --git a/protonmail-test2.cjs b/protonmail-test2.cjs
deleted file mode 100644
index 026e51c..0000000
--- a/protonmail-test2.cjs
+++ /dev/null
@@ -1,97 +0,0 @@
-// ProtonMail SMTP test with alternative configuration
-const nodemailer = require('nodemailer');
-require('dotenv').config();
-
-// Get SMTP settings from environment variables
-const {
- SMTP_USER,
- SMTP_PASS,
- ADMIN_EMAIL
-} = process.env;
-
-console.log('ProtonMail SMTP Test (Alternative Configuration)');
-console.log('----------------------------------------------');
-console.log(`SMTP User: ${SMTP_USER}`);
-console.log(`Admin Email: ${ADMIN_EMAIL}`);
-
-// Try alternative ProtonMail configuration
-// ProtonMail Bridge typically uses localhost:1025 or localhost:1143
-const transporterOptions = {
- host: 'mail.protonmail.ch',
- port: 443,
- secure: true,
- auth: {
- user: SMTP_USER,
- pass: SMTP_PASS,
- },
- tls: {
- rejectUnauthorized: false
- },
- logger: true,
- debug: true
-};
-
-console.log('\nUsing configuration:');
-console.log(`Host: ${transporterOptions.host}`);
-console.log(`Port: ${transporterOptions.port}`);
-console.log(`Secure: ${transporterOptions.secure}`);
-
-const transporter = nodemailer.createTransport(transporterOptions);
-
-// Verify connection
-console.log('\nTesting connection to ProtonMail SMTP server...');
-transporter.verify(function(error, _success) {
- if (error) {
- console.error('Connection failed:', error);
- console.log('\nTrying alternative port (25)...');
-
- // Try port 25
- const transporter2 = nodemailer.createTransport({
- ...transporterOptions,
- port: 25,
- secure: false
- });
-
- transporter2.verify(function(error2, _success2) {
- if (error2) {
- console.error('Connection with port 25 also failed:', error2);
-
- console.log('\nImportant ProtonMail SMTP Notes:');
- console.log('1. ProtonMail requires the Bridge application for SMTP access from third-party apps');
- console.log('2. The Bridge runs locally and provides SMTP access via localhost:1025 or similar');
- console.log('3. You may need to install and configure ProtonMail Bridge on your server');
- console.log('4. Or use ProtonMail\'s API instead of SMTP for sending emails');
-
- process.exit(1);
- } else {
- console.log('Connection successful with port 25!');
- sendTestEmail(transporter2);
- }
- });
- } else {
- console.log('Server is ready to take our messages');
- sendTestEmail(transporter);
- }
-});
-
-function sendTestEmail(transport) {
- // Send test email
- console.log('\nSending test email...');
- transport.sendMail({
- from: SMTP_USER,
- to: ADMIN_EMAIL,
- subject: 'ProtonMail SMTP Test (Alternative Config)',
- text: 'This is a test email from your website contact form.',
- html: '
This is a test email from your website contact form.
'
- }, (err, info) => {
- if (err) {
- console.error('Error sending email:', err);
- process.exit(1);
- } else {
- console.log('Message sent successfully!');
- console.log('Message ID:', info.messageId);
- console.log('Response:', info.response);
- process.exit(0);
- }
- });
-}
\ No newline at end of file
diff --git a/public/test-contact-form.html b/public/test-contact-form.html
deleted file mode 100644
index a9faca2..0000000
--- a/public/test-contact-form.html
+++ /dev/null
@@ -1,252 +0,0 @@
-
-
-
-
-
- Contact Form Test
-
-
-
-
Contact Form Test
-
-
- Your message has been sent successfully!
-
-
-
- There was an error sending your message. Please try again.
-
-
-
-
-
-
Debug Log
-
-
-
-
-
-
\ No newline at end of file
diff --git a/public/test-language-persistence.html b/public/test-language-persistence.html
deleted file mode 100644
index 65baa0e..0000000
--- a/public/test-language-persistence.html
+++ /dev/null
@@ -1,183 +0,0 @@
-
-
-
-
-
- Language Persistence Test
-
-
-
-
Language Persistence Test
-
-
-
Current Language Status
-
-
URL Language:Checking...
-
LocalStorage Language:Checking...
-
Cookie Language:Checking...
-
-
-
-
-
Test Language Selection
-
Click on a language to test the language persistence:
-
-
-
-
-
-
-
-
-
-
Navigation Test
-
Use these links to test language persistence during navigation: