Low-Tech API-Gateway für digitale Souveränität
Find a file
michael 445e751c16 feat(api): implement CORS support with environment-based configuration
- Add CORS headers to all API responses in main.lua
- Implement OPTIONS preflight request handling
- Add environment-variable based CORS origin configuration
- Create production.env.example for deployment documentation
- Update .env.example with CORS_ALLOWED_ORIGINS setting

Resolves cross-origin request blocking for Hugo dev server integration.
CORS origins now configurable via CORS_ALLOWED_ORIGINS environment variable
for production deployments while maintaining dev-friendly defaults.

Related to #49
2025-06-24 19:42:44 +02:00
.gitea/issue_template feat: Initiale Furt API-Gateway Projektstruktur 2025-06-03 16:39:17 +02:00
configs feat: functional monster script (anti-pattern warning) 2025-06-04 18:27:00 +02:00
devdocs refactor(architecture): migrate Furt concept from Go to C+Lua for digital sovereignty 2025-06-17 19:30:34 +02:00
furt-lua feat(api): implement CORS support with environment-based configuration 2025-06-24 19:42:44 +02:00
scripts fix(deploy): prevent environment config overwrite and fix SMTP_HOST variable 2025-06-24 11:04:19 +02:00
.env.example feat(api): implement CORS support with environment-based configuration 2025-06-24 19:42:44 +02:00
.gitignore fix(deployment): resolve OpenBSD rc.d service tracking and deployment workflow 2025-06-23 19:44:21 +02:00
go.mod feat: Initiale Furt API-Gateway Projektstruktur 2025-06-03 16:39:17 +02:00
LICENSE feat: Initiale Furt API-Gateway Projektstruktur 2025-06-03 16:39:17 +02:00
README.md feat(furt): implement complete Lua HTTP-Server for digital sovereignty (#63) 2025-06-17 20:40:40 +02:00

Furt API Gateway

Low-Tech API-Gateway für digitale Souveränität
Von Go zu C+Lua - Corporate-freie Technologie-Migration

Überblick

Furt ist ein minimalistischer API-Gateway, der verschiedene Services unter einer einheitlichen API vereint. Der Name "Furt" (germanisch für "Durchgang durch Wasser") symbolisiert die Gateway-Funktion: Alle Requests durchqueren die API-Furt um zu den dahinterliegenden Services zu gelangen.

Technologie-Migration

🔄 Strategische Neuausrichtung (Juni 2025):

  • Von: Go-basierte Implementation (Corporate-controlled)
  • Zu: C + Lua Implementation (maximale Souveränität)
  • Grund: Elimination von Google-Dependencies für echte digitale Unabhängigkeit

Aktuelle Implementierungen

🆕 furt-lua (Aktiv entwickelt)

Pure Lua HTTP-Server - Week 1

  • HTTP-Server mit lua-socket
  • JSON API-Endpoints
  • Basic Routing und Error-Handling
  • Mail-Service-Grundgerüst
  • 🔄 SMTP-Integration (Week 2)
cd furt-lua/
./scripts/start.sh
# Server: http://127.0.0.1:8080

📦 Go-Implementation (Parallel/Legacy)

  • Ursprüngliche Planung in cmd/, internal/
  • Wird durch Lua-Version ersetzt
  • Referenz für API-Kompatibilität

Philosophie

  • Technologie-Souveränität: Nur akademische/unabhängige Technologien
  • Low-Tech-Ansatz: C + Lua statt Corporate-Runtimes
  • Minimale Dependencies: < 5 externe Libraries
  • Modulare Architektur: < 200 Zeilen pro Modul
  • Vollständige Transparenz: Jede Zeile Code verstehbar
  • Langfristige Stabilität: 50+ Jahre bewährte Technologien

Tech-Stack (Final)

Souveräne Technologien:

  • C (GCC + musl) - Kern-Performance
  • Lua (PUC-Rio University) - Business-Logic
  • LMDB (Howard Chu/Symas) - Datenbank
  • OpenBSD httpd - Reverse-Proxy (langfristig)

Corporate-frei: Keine Google-, Microsoft-, oder VC-kontrollierten Dependencies

Services

  • formular2mail: Kontaktformulare zu E-Mail (Week 1 )
  • sagjan: Selbst-gehostetes Kommentarsystem
  • lengan: Projektverwaltung
  • budlam: Kontaktverwaltung
  • Weitere: Shop, Newsletter, Kalendar, etc.

Installation & Entwicklung

Quick Start (furt-lua)

# Dependencies (Arch Linux)
pacman -S lua lua-socket lua-cjson

# Start Development-Server
cd furt-lua/
chmod +x scripts/start.sh
./scripts/start.sh

# Test
curl -X POST http://127.0.0.1:8080/test \
     -H "Content-Type: application/json" \
     -d '{"test":"data"}'

Testing

# Automated Tests
cd furt-lua/
lua tests/test_http.lua

# Manual curl Tests  
./scripts/test_curl.sh

Roadmap

Phase 1: Lua-Foundation (4 Wochen)

  • Week 1: HTTP-Server + Mail-Service-Grundgerüst
  • Week 2: SMTP-Integration + API-Key-Auth
  • Week 3: Service-Expansion (Comments)
  • Week 4: Production-Ready (HTTPS, Systemd)

Phase 2: C-Integration (4-6 Wochen)

  • C-HTTP-Server für Performance
  • C ↔ Lua Bridge
  • Memory-Management + Security-Hardening

Phase 3: Infrastructure-Migration (6-12 Monate)

  • OpenBSD-Migration
  • ISPConfig → eigene Scripts
  • Apache → OpenBSD httpd

Dokumentation

Development:

API:

  • furt-lua/README.md - Lua-Implementation Details
  • docs/api/ - API-Dokumentation (in Entwicklung)

Technologie-Rationale

Warum Lua statt Go?

  • Go = Google-controlled (Module-Proxy, Telemetrie)
  • Lua = PUC-Rio University (echte Unabhängigkeit)
  • C + Lua = 50+ Jahre bewährt vs. Corporate-Runtime
  • Performance: 10x weniger Memory, 5x weniger CPU

Teil der Dragons@Work Digital-Sovereignty-Strategie

Status

🚀 Week 1 Complete: Lua HTTP-Server funktional
🔄 Week 2 Active: SMTP-Integration + Hugo-Integration
📋 Week 3+ Planned: Service-Expansion + C-Migration

Lizenz

Apache License 2.0 - Siehe LICENSE für Details.


Furt steht im Einklang mit den Prinzipien digitaler Souveränität und dem Low-Tech-Ansatz des Dragons@Work-Projekts.