docs: simplify README and remove FreeBSD support
- Strip README to essentials with wiki references only - Remove non-existent API docs and troubleshooting links - Focus on quick start and actual integrations (merkwerk) - Remove FreeBSD support from all installation scripts - Clean up platform detection logic in scripts - Maintain OpenBSD and Linux support only Reduces maintenance burden and aligns with actual project scope.
This commit is contained in:
parent
6c60d88f62
commit
8b7806670c
10 changed files with 58 additions and 306 deletions
159
README.md
159
README.md
|
|
@ -1,160 +1,83 @@
|
|||
# Furt API Gateway
|
||||
|
||||
**HTTP-Server in Lua für Service-Integration**
|
||||
**Pure Lua HTTP-Server für digitale Souveränität**
|
||||
|
||||
## Überblick
|
||||
|
||||
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.
|
||||
Furt ist ein minimalistisches HTTP-Server in Lua 5.1 für Mail-Versendung über SMTP. Es bietet eine einfache JSON-API für Web-Integration und Multi-Tenant-Unterstützung über API-Keys.
|
||||
|
||||
## Features
|
||||
|
||||
- HTTP-Server mit JSON-APIs
|
||||
- Mail-Versendung über SMTP
|
||||
- Request-Routing und Authentication
|
||||
- Multi-Tenant Mail-Routing über SMTP
|
||||
- API-Key-basierte Authentifizierung
|
||||
- Health-Check-Endpoints
|
||||
- Konfigurierbare Rate-Limiting
|
||||
- Hugo/Website-Integration
|
||||
- Rate-Limiting pro API-Key
|
||||
- CORS-Support für Frontend-Integration
|
||||
|
||||
## Dependencies
|
||||
## Quick Start
|
||||
|
||||
**Erforderlich:**
|
||||
- `lua` 5.4+
|
||||
- `lua-socket` (HTTP-Server)
|
||||
- `lua-cjson` (JSON-Verarbeitung)
|
||||
**Dependencies installieren:**
|
||||
```bash
|
||||
# OpenBSD
|
||||
doas pkg_add lua lua-socket lua-cjson luasec
|
||||
|
||||
# Debian/Ubuntu
|
||||
sudo apt install lua5.1 lua-socket lua-cjson lua-sec
|
||||
|
||||
# Arch Linux
|
||||
sudo pacman -S lua51 lua51-socket lua51-dkjson lua51-sec
|
||||
```
|
||||
|
||||
**Installation:**
|
||||
```bash
|
||||
# Arch Linux
|
||||
pacman -S lua lua-socket lua-cjson
|
||||
|
||||
# Ubuntu/Debian
|
||||
apt install lua5.4 lua-socket lua-cjson
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# Repository klonen
|
||||
git clone <repository-url>
|
||||
git clone https://smida.dragons-at-work.de/DAW/furt.git
|
||||
cd furt
|
||||
|
||||
# Scripts ausführbar machen
|
||||
chmod +x scripts/*.sh
|
||||
|
||||
# Server starten
|
||||
./scripts/start.sh
|
||||
sudo ./install.sh
|
||||
```
|
||||
|
||||
**Server läuft auf:** http://127.0.0.1:8080
|
||||
**Server läuft auf:** http://127.0.0.1:7811
|
||||
|
||||
## API-Endpoints
|
||||
|
||||
### Health Check
|
||||
**Health Check:**
|
||||
```bash
|
||||
GET /health
|
||||
→ {"status":"healthy","service":"furt","version":"1.0.0"}
|
||||
curl http://127.0.0.1:7811/health
|
||||
```
|
||||
|
||||
### Mail senden
|
||||
**Mail senden:**
|
||||
```bash
|
||||
POST /v1/mail/send
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"name": "Name",
|
||||
"email": "sender@example.com",
|
||||
"message": "Nachricht"
|
||||
}
|
||||
|
||||
→ {"success":true,"message":"Mail sent"}
|
||||
```
|
||||
|
||||
## Konfiguration
|
||||
|
||||
**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
|
||||
```
|
||||
|
||||
**Server-Config (config/server.lua):**
|
||||
- Port und Host-Einstellungen
|
||||
- API-Key-Konfiguration
|
||||
- Rate-Limiting-Parameter
|
||||
|
||||
## Testing
|
||||
|
||||
**Automatische Tests:**
|
||||
```bash
|
||||
lua tests/test_http.lua
|
||||
```
|
||||
|
||||
**Manuelle Tests:**
|
||||
```bash
|
||||
./scripts/test_curl.sh
|
||||
|
||||
# Oder direkt:
|
||||
curl -X POST http://127.0.0.1:8080/v1/mail/send \
|
||||
curl -X POST http://127.0.0.1:7811/v1/mail/send \
|
||||
-H "X-API-Key: your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"Test","email":"test@example.com","message":"Test"}'
|
||||
-d '{"name":"Test","email":"test@example.com","subject":"Test","message":"Test-Nachricht"}'
|
||||
```
|
||||
|
||||
## Deployment
|
||||
## Dokumentation
|
||||
|
||||
**OpenBSD:**
|
||||
- rc.d-Script in `deployment/openbsd/`
|
||||
- Systemd-Integration über Scripts
|
||||
|
||||
**Production-Setup:**
|
||||
```bash
|
||||
# Environment-Config kopieren
|
||||
cp .env.example .env.production
|
||||
# → SMTP-Credentials anpassen
|
||||
|
||||
# Production-Mode starten
|
||||
export FURT_ENV=production
|
||||
./scripts/start.sh
|
||||
```
|
||||
**Installation & Konfiguration:** [Furt Wiki](https://smida.dragons-at-work.de/DAW/furt/wiki)
|
||||
|
||||
## 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
|
||||
├── config/ # Konfiguration
|
||||
├── scripts/ # Installation & Management
|
||||
└── deployment/ # System-Integration
|
||||
```
|
||||
|
||||
## Hugo-Integration
|
||||
## 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>
|
||||
```
|
||||
**merkwerk:** Versionierte Furt-Deployment über [merkwerk](https://smida.dragons-at-work.de/DAW/merkwerk)
|
||||
|
||||
## Development
|
||||
## License
|
||||
|
||||
**Code-Struktur:**
|
||||
- Module unter 200 Zeilen
|
||||
- Funktionen unter 50 Zeilen
|
||||
- Klare Fehlerbehandlung
|
||||
- Testbare Komponenten
|
||||
ISC - Siehe [LICENSE](LICENSE) für Details.
|
||||
|
||||
**Dependencies minimal halten:**
|
||||
- Nur lua-socket und lua-cjson
|
||||
- Keine externen HTTP-Libraries
|
||||
- Standard-Lua-Funktionen bevorzugen
|
||||
## Links
|
||||
|
||||
- **Repository:** [Forgejo](https://smida.dragons-at-work.de/DAW/furt)
|
||||
- **Dokumentation:** [Wiki](https://smida.dragons-at-work.de/DAW/furt/wiki)
|
||||
- **Projekt:** [Dragons@Work](https://dragons-at-work.de)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue