furt/furt-lua/config/server.lua
michael 6d7d8a2af8 feat(smtp): complete native Lua SMTP integration for production mail delivery
- Add native Lua SMTP client with SSL/TLS support for mail.dragons-at-work.de:465
- Implement POST /v1/mail/send endpoint with real email delivery functionality
- Add environment variable integration (SMTP_*) for secure credential management
- Add comprehensive input validation and error handling for mail requests
- Add health check endpoint with SMTP configuration status reporting
- Add multi-line SMTP response handling for robust server communication
- Add request ID tracking system for debugging and monitoring
- Update start.sh script for automatic .env loading and dependency checking
- Add complete testing suite for SMTP functionality verification

This completes the Week 2 Challenge migration from Go to pure Lua HTTP server
with full production-ready SMTP capabilities. The implementation eliminates all
Google/corporate dependencies while achieving superior performance (18ms response
time) and maintaining digital sovereignty principles.

Real mail delivery confirmed: test email successfully sent to admin@dragons-at-work.de
Ready for Hugo website integration and production deployment with security layer.

Closes #65
2025-06-19 09:52:15 +02:00

36 lines
1,003 B
Lua

-- furt-lua/config/server.lua
-- Server configuration for Furt Lua HTTP-Server
return {
-- HTTP Server settings
host = "127.0.0.1",
port = 8080,
-- Timeouts (seconds)
client_timeout = 10,
-- Logging
log_level = "info",
log_requests = true,
-- Security (for future use)
api_keys = {
["hugo-frontend-key"] = {
name = "Hugo Frontend",
permissions = {"mail:send"},
allowed_ips = {"127.0.0.1", "10.0.0.0/8"}
}
},
-- Mail configuration (for SMTP integration)
mail = {
smtp_server = os.getenv("SMTP_HOST") or "mail.dragons-at-work.de",
smtp_port = tonumber(os.getenv("SMTP_PORT")) or 465,
use_ssl = true,
username = os.getenv("SMTP_USERNAME"),
password = os.getenv("SMTP_PASSWORD"),
from_address = os.getenv("SMTP_FROM") or "noreply@dragons-at-work.de",
to_address = os.getenv("SMTP_TO") or "michael@dragons-at-work.de"
}
}