refactor: clean repository structure for v0.1.0 open source release
- Remove Go artifacts (cmd/, internal/, pkg/, go.mod) - Move furt-lua/* content to repository root - Restructure as clean src/, config/, scripts/, tests/ layout - Rewrite README.md as practical tool documentation - Remove timeline references and marketing language - Clean .gitignore from Go-era artifacts - Update config/server.lua with example.org defaults - Add .env.production to .gitignore for security Repository now ready for open source distribution with minimal, focused structure and generic configuration templates. close issue DAW/furt#86
This commit is contained in:
parent
87c935379b
commit
be3b9614d0
38 changed files with 280 additions and 5892 deletions
235
README.md
235
README.md
|
|
@ -1,145 +1,160 @@
|
|||
# Furt API Gateway
|
||||
|
||||
**Low-Tech API-Gateway für digitale Souveränität**
|
||||
*Von Go zu C+Lua - Corporate-freie Technologie-Migration*
|
||||
**HTTP-Server in Lua für Service-Integration**
|
||||
|
||||
## Ü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.
|
||||
Furt ist ein HTTP-Server der verschiedene Services unter einer API vereint. Aktuell unterstützt es Mail-Versendung über SMTP und bietet eine einfache JSON-API für Web-Integration.
|
||||
|
||||
## Technologie-Migration
|
||||
## Features
|
||||
|
||||
🔄 **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
|
||||
- HTTP-Server mit JSON-APIs
|
||||
- Mail-Versendung über SMTP
|
||||
- Request-Routing und Authentication
|
||||
- Health-Check-Endpoints
|
||||
- Konfigurierbare Rate-Limiting
|
||||
- Hugo/Website-Integration
|
||||
|
||||
## Aktuelle Implementierungen
|
||||
## Dependencies
|
||||
|
||||
### 🆕 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)
|
||||
**Erforderlich:**
|
||||
- `lua` 5.4+
|
||||
- `lua-socket` (HTTP-Server)
|
||||
- `lua-cjson` (JSON-Verarbeitung)
|
||||
|
||||
**Installation:**
|
||||
```bash
|
||||
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)
|
||||
```bash
|
||||
# Dependencies (Arch Linux)
|
||||
# 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"}'
|
||||
# Ubuntu/Debian
|
||||
apt install lua5.4 lua-socket lua-cjson
|
||||
```
|
||||
|
||||
### Testing
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# Automated Tests
|
||||
cd furt-lua/
|
||||
lua tests/test_http.lua
|
||||
# Repository klonen
|
||||
git clone <repository-url>
|
||||
cd furt
|
||||
|
||||
# Manual curl Tests
|
||||
./scripts/test_curl.sh
|
||||
# Scripts ausführbar machen
|
||||
chmod +x scripts/*.sh
|
||||
|
||||
# Server starten
|
||||
./scripts/start.sh
|
||||
```
|
||||
|
||||
## Roadmap
|
||||
**Server läuft auf:** http://127.0.0.1:8080
|
||||
|
||||
### Phase 1: Lua-Foundation (4 Wochen) ✅
|
||||
- [x] 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)
|
||||
## API-Endpoints
|
||||
|
||||
### Phase 2: C-Integration (4-6 Wochen)
|
||||
- [ ] C-HTTP-Server für Performance
|
||||
- [ ] C ↔ Lua Bridge
|
||||
- [ ] Memory-Management + Security-Hardening
|
||||
### Health Check
|
||||
```bash
|
||||
GET /health
|
||||
→ {"status":"healthy","service":"furt","version":"1.0.0"}
|
||||
```
|
||||
|
||||
### Phase 3: Infrastructure-Migration (6-12 Monate)
|
||||
- [ ] OpenBSD-Migration
|
||||
- [ ] ISPConfig → eigene Scripts
|
||||
- [ ] Apache → OpenBSD httpd
|
||||
### Mail senden
|
||||
```bash
|
||||
POST /v1/mail/send
|
||||
Content-Type: application/json
|
||||
|
||||
## Dokumentation
|
||||
{
|
||||
"name": "Name",
|
||||
"email": "sender@example.com",
|
||||
"message": "Nachricht"
|
||||
}
|
||||
|
||||
**Development:**
|
||||
- [`devdocs/furt_konzept.md`](devdocs/furt_konzept.md) - Technische Architektur
|
||||
- [`devdocs/furt_master_strategy.md`](devdocs/furt_master_strategy.md) - 18-24 Monate Roadmap
|
||||
- [`devdocs/furt_development_process.md`](devdocs/furt_development_process.md) - Development-Guidelines
|
||||
→ {"success":true,"message":"Mail sent"}
|
||||
```
|
||||
|
||||
**API:**
|
||||
- [`furt-lua/README.md`](furt-lua/README.md) - Lua-Implementation Details
|
||||
- `docs/api/` - API-Dokumentation (in Entwicklung)
|
||||
## Konfiguration
|
||||
|
||||
## Technologie-Rationale
|
||||
**Environment Variables (.env):**
|
||||
```bash
|
||||
FURT_MAIL_HOST=mail.example.com
|
||||
FURT_MAIL_PORT=587
|
||||
FURT_MAIL_USERNAME=user@example.com
|
||||
FURT_MAIL_PASSWORD=password
|
||||
FURT_MAIL_TO=empfaenger@example.com
|
||||
```
|
||||
|
||||
**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
|
||||
**Server-Config (config/server.lua):**
|
||||
- Port und Host-Einstellungen
|
||||
- API-Key-Konfiguration
|
||||
- Rate-Limiting-Parameter
|
||||
|
||||
**Teil der Dragons@Work Digital-Sovereignty-Strategie**
|
||||
## Testing
|
||||
|
||||
## Status
|
||||
**Automatische Tests:**
|
||||
```bash
|
||||
lua tests/test_http.lua
|
||||
```
|
||||
|
||||
🚀 **Week 1 Complete:** Lua HTTP-Server funktional
|
||||
🔄 **Week 2 Active:** SMTP-Integration + Hugo-Integration
|
||||
📋 **Week 3+ Planned:** Service-Expansion + C-Migration
|
||||
**Manuelle Tests:**
|
||||
```bash
|
||||
./scripts/test_curl.sh
|
||||
|
||||
## Lizenz
|
||||
# Oder direkt:
|
||||
curl -X POST http://127.0.0.1:8080/v1/mail/send \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"Test","email":"test@example.com","message":"Test"}'
|
||||
```
|
||||
|
||||
Apache License 2.0 - Siehe [LICENSE](LICENSE) für Details.
|
||||
## Deployment
|
||||
|
||||
---
|
||||
**OpenBSD:**
|
||||
- rc.d-Script in `deployment/openbsd/`
|
||||
- Systemd-Integration über Scripts
|
||||
|
||||
*Furt steht im Einklang mit den Prinzipien digitaler Souveränität und dem Low-Tech-Ansatz des Dragons@Work-Projekts.*
|
||||
**Production-Setup:**
|
||||
```bash
|
||||
# Environment-Config kopieren
|
||||
cp .env.example .env.production
|
||||
# → SMTP-Credentials anpassen
|
||||
|
||||
# Production-Mode starten
|
||||
export FURT_ENV=production
|
||||
./scripts/start.sh
|
||||
```
|
||||
|
||||
## Projektstruktur
|
||||
|
||||
```
|
||||
furt/
|
||||
├── src/ # Lua-Source-Code
|
||||
│ ├── main.lua # HTTP-Server
|
||||
│ ├── routes/ # API-Endpoints
|
||||
│ └── smtp.lua # Mail-Integration
|
||||
├── config/ # Konfiguration
|
||||
├── scripts/ # Start/Test-Scripts
|
||||
├── tests/ # Test-Suite
|
||||
└── deployment/ # System-Integration
|
||||
```
|
||||
|
||||
## Hugo-Integration
|
||||
|
||||
**Shortcode-Beispiel:**
|
||||
```html
|
||||
<form action="http://your-server:8080/v1/mail/send" method="POST">
|
||||
<input name="name" type="text" required>
|
||||
<input name="email" type="email" required>
|
||||
<textarea name="message" required></textarea>
|
||||
<button type="submit">Senden</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
**Code-Struktur:**
|
||||
- Module unter 200 Zeilen
|
||||
- Funktionen unter 50 Zeilen
|
||||
- Klare Fehlerbehandlung
|
||||
- Testbare Komponenten
|
||||
|
||||
**Dependencies minimal halten:**
|
||||
- Nur lua-socket und lua-cjson
|
||||
- Keine externen HTTP-Libraries
|
||||
- Standard-Lua-Funktionen bevorzugen
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue