- Fix OpenBSD service file pexp pattern to match actual running process
- Set pexp after sourcing rc.subr to prevent automatic override
- Update deployment script process detection from broken furt-lua pattern
- Add TTY-based daemon detection in start.sh for service vs development mode
- Implement comprehensive deployment workflow with backup and health checks
- Enable proper rcctl start/stop/check functionality on OpenBSD
Root cause: OpenBSD rc.subr automatically generates pexp from daemon+flags,
but actual process (/usr/local/bin/lua src/main.lua) differs from wrapper
(start.sh). Solution: Override pexp after rc.subr with correct Lua pattern.
Deployment script also had incorrect process detection pattern looking for
'furt-lua' string that doesn't exist in process name.
Technical details:
- Service file: pexp="/usr/local/bin/lua src/main.lua.*" after rc.subr
- Process detection: pgrep -u _furt -f 'src/main.lua'
- TTY detection: [ ! -t 0 ] for daemon vs interactive mode
- Complete deployment workflow with stop/sync/start/health-check cycle
Fixes#77 - OpenBSD rc.d service file problem resolved
Related: Deployment automation now fully functional karl→walter
- Split REPO_ROOT and PROJECT_DIR for different purposes
- REPO_ROOT: Repository-wide configs (.env, system configs)
- PROJECT_DIR: Lua-specific working directory (src/, cd)
- Fix config detection across development and production environments
Changes:
- REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")" # 2 levels up for .env
- PROJECT_DIR="$(dirname "$SCRIPT_DIR")" # 1 level up for src/
- Config loading uses REPO_ROOT (.env location)
- Working directory and Lua paths use PROJECT_DIR (furt-lua/)
Tested on:
- karl (Linux/Development): .env loading + lua51 execution ✅
- walter (OpenBSD/Production): system config + lua execution ✅
Cross-platform SMTP functionality verified:
- karl: Full E2E test with successful mail delivery
- walter: HTTP server + config detection working
Fixes#68 (Universal Config Detection)
Fixes#70 (karl start.sh regression after universal script update)
- Add multi-distribution config path detection
- Support /usr/local/etc/furt/environment (OpenBSD)
- Support /etc/furt/environment (Debian/Ubuntu/RHEL)
- Maintain .env support for development
- Add configurable Lua command via LUA_COMMAND environment variable
POSIX compatibility improvements:
- Replace command -v with [ -x ] for service user compatibility
- Change shebang from #!/bin/bash to #!/bin/sh for OpenBSD
- Replace ${BASH_SOURCE[0]} with $0 for POSIX shell compatibility
walter deployment changes:
- Migrate directory structure to /usr/local/furt/furt-lua/
- Set up _furt user permissions
- Configure system config in /usr/local/etc/furt/environment
Known issues:
- karl development environment regression (lua51 detection failed)
- walter SSL missing for SMTP (luasec vs luaossl compatibility)
- Config strategy needs comprehensive redesign for multi-implementation
Related: #68
Files modified:
- furt-lua/scripts/start.sh (POSIX compatibility + universal config)
- .env.example (added LUA_COMMAND and LUA_VERSION)
- walter: /usr/local/etc/furt/environment (system config setup)
- 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
- 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