furt/furt-lua/scripts/start.sh

103 lines
3.6 KiB
Bash
Raw Normal View History

#!/bin/sh
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00
# furt-lua/scripts/start.sh
# Start script for Furt Lua HTTP-Server
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Script directory (POSIX-compatible)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")" # für src/, cd
REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")" # für .env
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00
echo -e "${GREEN}=== Furt Lua HTTP-Server Startup ===${NC}"
# Check required dependencies
echo -e "${YELLOW}Checking dependencies...${NC}"
# Load environment variables - Universal Config Detection
echo -e "${YELLOW}Loading environment variables...${NC}"
if [ -f "$REPO_ROOT/.env" ]; then
echo -e "${GREEN}[OK]${NC} Loading from $REPO_ROOT/.env"
export $(grep -v '^#' "$REPO_ROOT/.env" | grep -v '^$' | xargs)
elif [ -f "/usr/local/etc/furt/environment" ]; then
echo -e "${GREEN}[OK]${NC} Loading from /usr/local/etc/furt/environment"
export $(grep -v '^#' /usr/local/etc/furt/environment | grep -v '^$' | xargs)
elif [ -f "/etc/furt/environment" ]; then
echo -e "${GREEN}[OK]${NC} Loading from /etc/furt/environment"
export $(grep -v '^#' /etc/furt/environment | grep -v '^$' | xargs)
else
echo -e "${YELLOW}[WARN]${NC} No config file found in project root or system"
fi
# Setup Lua from config (after loading environment)
LUA_CMD="${LUA_COMMAND:-lua51}"
LUA_VER="${LUA_VERSION:-5.1}"
# Check if configured Lua is installed (POSIX-compatible)
if ! [ -x "$LUA_CMD" ]; then
echo -e "${RED}Error: $LUA_CMD is not installed${NC}"
echo "Install with: pkg_add lua51 (OpenBSD) or apt install lua5.1 (Ubuntu)"
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00
exit 1
fi
# Check Lua version
LUA_VERSION_OUTPUT=$($LUA_CMD -v 2>&1 | head -n1)
echo -e "${YELLOW}Lua command:${NC} $LUA_CMD ($LUA_VERSION_OUTPUT)"
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00
# Test lua-socket
$LUA_CMD -e "require('socket')" 2>/dev/null || {
echo -e "${RED}Error: lua-socket not found for $LUA_CMD${NC}"
echo "Install with: pkg_add lua51-socket (OpenBSD) or apt install lua-socket (Ubuntu)"
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00
exit 1
}
echo -e "${GREEN}${NC} lua-socket found"
# Test lua-cjson (system or luarocks)
LUA_PATH="$HOME/.luarocks/share/lua/$LUA_VER/?.lua;;" \
LUA_CPATH="$HOME/.luarocks/lib/lua/$LUA_VER/?.so;;" \
$LUA_CMD -e "require('cjson')" 2>/dev/null || {
echo -e "${RED}Error: lua-cjson not found for $LUA_CMD${NC}"
echo "Install with: pkg_add lua51-cjson (OpenBSD) or luarocks install lua-cjson"
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00
exit 1
}
echo -e "${GREEN}${NC} lua-cjson found"
# Test lua-ssl (optional for HTTPS)
LUA_PATH="$HOME/.luarocks/share/lua/$LUA_VER/?.lua;;" \
LUA_CPATH="$HOME/.luarocks/lib/lua/$LUA_VER/?.so;;" \
$LUA_CMD -e "require('ssl')" 2>/dev/null && {
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00
echo -e "${GREEN}${NC} lua-ssl found (HTTPS ready)"
} || {
echo -e "${YELLOW}${NC} lua-ssl not found (install with: luarocks install luaossl)"
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00
}
# Check SMTP configuration (korrekte Variable-Namen)
if [ -n "$SMTP_USERNAME" ] && [ -n "$SMTP_PASSWORD" ]; then
echo -e "${GREEN}[OK]${NC} SMTP configured: $SMTP_USERNAME"
else
echo -e "${YELLOW}[WARN]${NC} SMTP credentials missing in .env"
echo "Add SMTP_USERNAME and SMTP_PASSWORD to .env"
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00
fi
# Change to project directory
cd "$PROJECT_DIR"
# Add current directory and luarocks to Lua path for requires (dynamic version)
export LUA_PATH="$PROJECT_DIR/src/?.lua;$PROJECT_DIR/?.lua;$HOME/.luarocks/share/lua/$LUA_VER/?.lua;;"
export LUA_CPATH="$HOME/.luarocks/lib/lua/$LUA_VER/?.so;;"
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00
echo -e "${GREEN}Starting Furt HTTP-Server...${NC}"
echo -e "${YELLOW}Project directory:${NC} $PROJECT_DIR"
echo -e "${YELLOW}Lua paths configured for $LUA_CMD (version $LUA_VER)${NC}"
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00
echo ""
# Start server
$LUA_CMD src/main.lua
feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) - Add furt-lua/ directory with pure Lua implementation - Replace planned Go implementation with Corporate-free technology - Complete Week 1 Challenge: HTTP-Server to production-ready in 48min - HTTP-Server in pure Lua (185 lines, lua-socket based) - JSON API endpoints with request/response parsing - Modular architecture: each file < 200 lines - Error handling for 404, 400, validation scenarios - GET /health - Service health check with timestamp - POST /test - Development testing with request echo - POST /v1/mail/send - Mail service foundation with validation - Comprehensive error responses with structured JSON - Smart startup script with dependency auto-detection - Automated test suite with lua-socket HTTP client - Manual curl test suite for development workflow - Complete documentation and installation guide - FROM: Go (Google-controlled) → TO: Lua (PUC-Rio University) - Corporate-free dependency chain: lua-socket + lua-cjson + lua-ssl - Performance superior: < 1ms response time, minimal memory usage - Foundation for planned C+Lua hybrid architecture - furt-lua/src/main.lua - HTTP-Server implementation - furt-lua/config/server.lua - Lua-based configuration - furt-lua/scripts/start.sh - Startup with dependency checks - furt-lua/scripts/test_curl.sh - Manual testing suite - furt-lua/tests/test_http.lua - Automated test framework - furt-lua/README.md - Implementation documentation - README.md - Document Go→Lua migration strategy - .gitignore - Add Lua artifacts, luarocks, issue-scripts All endpoints tested and working: ✓ Health check returns proper JSON status ✓ Test endpoint processes POST requests with JSON ✓ Mail endpoint validates required fields (name, email, message) ✓ Error handling returns appropriate HTTP status codes Ready for Week 2: SMTP integration with mail.dragons-at-work.de Completes #63 Related #62
2025-06-17 20:40:40 +02:00