Installation aktualisiert
parent
eff6fd083a
commit
3841afdeb4
1 changed files with 55 additions and 88 deletions
143
Installation.md
143
Installation.md
|
|
@ -2,44 +2,6 @@
|
||||||
|
|
||||||
**Lua API-Gateway für digitale Souveränität**
|
**Lua API-Gateway für digitale Souveränität**
|
||||||
|
|
||||||
## Source-Code beschaffen
|
|
||||||
|
|
||||||
### Git-Repository clonen
|
|
||||||
|
|
||||||
furt-Quellen aus dem Dragons@Work-Repository beschaffen:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Repository clonen
|
|
||||||
git clone https://smida.dragons-at-work.de/DAW/furt.git /tmp/furt-source
|
|
||||||
cd /tmp/furt-source
|
|
||||||
```
|
|
||||||
|
|
||||||
**Repository-Struktur validieren:**
|
|
||||||
```bash
|
|
||||||
# Erforderliche Verzeichnisse prüfen
|
|
||||||
ls -la src/main.lua config/furt.conf.example scripts/start.sh integrations/
|
|
||||||
|
|
||||||
# Erwartete Struktur:
|
|
||||||
# src/ - Lua-Quellcode
|
|
||||||
# config/ - Konfigurationsbeispiele
|
|
||||||
# scripts/ - Helper-Scripts (start.sh)
|
|
||||||
# integrations/ - merkwerk-Integration
|
|
||||||
# docs/ - Dokumentation
|
|
||||||
# VERSION - Versions-Information
|
|
||||||
```
|
|
||||||
|
|
||||||
**Git-Installation falls erforderlich:**
|
|
||||||
|
|
||||||
*OpenBSD:*
|
|
||||||
```bash
|
|
||||||
doas pkg_add git
|
|
||||||
```
|
|
||||||
|
|
||||||
*Debian/Ubuntu:*
|
|
||||||
```bash
|
|
||||||
apt install git
|
|
||||||
```
|
|
||||||
|
|
||||||
## Systemanforderungen verstehen
|
## Systemanforderungen verstehen
|
||||||
|
|
||||||
### Lua-Runtime Anforderungen
|
### Lua-Runtime Anforderungen
|
||||||
|
|
@ -113,32 +75,19 @@ Lua sucht Module über `LUA_PATH`-Environment-Variable. furt erweitert Standard-
|
||||||
|
|
||||||
### 1. Systemanforderungen prüfen
|
### 1. Systemanforderungen prüfen
|
||||||
|
|
||||||
**Lua-Installation validieren mit automatischer Command-Detection:**
|
**Lua-Installation validieren:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Lua-Command erkennen (plattformspezifisch)
|
# Lua 5.1 verfügbar?
|
||||||
if command -v lua5.1 >/dev/null 2>&1; then
|
lua5.1 -v
|
||||||
LUA_CMD="lua5.1"
|
|
||||||
elif command -v lua >/dev/null 2>&1; then
|
|
||||||
LUA_CMD="lua"
|
|
||||||
else
|
|
||||||
echo "Kein Lua gefunden"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Lua-Version prüfen
|
|
||||||
$LUA_CMD -v
|
|
||||||
|
|
||||||
# Erwartete Ausgabe:
|
# Erwartete Ausgabe:
|
||||||
# Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
|
# Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
|
||||||
|
|
||||||
# Required modules testen
|
# Required modules testen
|
||||||
$LUA_CMD -e "require('socket')"
|
lua5.1 -e "require('socket')"
|
||||||
$LUA_CMD -e "require('cjson')"
|
lua5.1 -e "require('cjson')"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Warum Command-Detection:** OpenBSD installiert Lua als `lua`, Linux-Distributionen oft als `lua5.1`.
|
|
||||||
|
|
||||||
**Fehlende Module installieren:**
|
**Fehlende Module installieren:**
|
||||||
|
|
||||||
*Arch Linux:*
|
*Arch Linux:*
|
||||||
|
|
@ -198,13 +147,9 @@ chown furt:furt /var/log/furt
|
||||||
|
|
||||||
**Source-Code kopieren:**
|
**Source-Code kopieren:**
|
||||||
```bash
|
```bash
|
||||||
# In furt-source-Verzeichnis (aus Schritt 0)
|
|
||||||
cd /tmp/furt-source
|
|
||||||
|
|
||||||
# Haupt-Bibliothek installieren
|
# Haupt-Bibliothek installieren
|
||||||
cp -r src/ /usr/local/share/furt/
|
cp -r src/ /usr/local/share/furt/
|
||||||
cp -r config/ /usr/local/share/furt/
|
cp -r config/ /usr/local/share/furt/
|
||||||
cp -r scripts/ /usr/local/share/furt/
|
|
||||||
cp -r integrations/ /usr/local/share/furt/
|
cp -r integrations/ /usr/local/share/furt/
|
||||||
|
|
||||||
# Versions-Dateien für merkwerk-Integration
|
# Versions-Dateien für merkwerk-Integration
|
||||||
|
|
@ -216,31 +161,47 @@ chown -R root:wheel /usr/local/share/furt # OpenBSD/FreeBSD
|
||||||
chown -R root:root /usr/local/share/furt # Linux
|
chown -R root:root /usr/local/share/furt # Linux
|
||||||
chmod -R 644 /usr/local/share/furt
|
chmod -R 644 /usr/local/share/furt
|
||||||
find /usr/local/share/furt -type d -exec chmod 755 {} \;
|
find /usr/local/share/furt -type d -exec chmod 755 {} \;
|
||||||
chmod +x /usr/local/share/furt/scripts/start.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Warum scripts/ inkludieren:** Das `start.sh`-Script löst Service-vs-Interactive-Detection und Lua-Command-Erkennung.
|
### 4. Startup-Script erstellen
|
||||||
|
|
||||||
### 4. Startup-Script konfigurieren
|
**Wrapper-Script für Lua-Pfad-Management:**
|
||||||
|
|
||||||
**furt nutzt das integrierte `start.sh`-Script für plattformspezifische Anpassungen:**
|
*OpenBSD/FreeBSD* - `/usr/local/bin/furt`:
|
||||||
|
```bash
|
||||||
|
#!/bin/sh
|
||||||
|
# furt HTTP API-Gateway
|
||||||
|
|
||||||
|
# Lua-Module-Pfad für furt erweitern
|
||||||
|
export LUA_PATH="/usr/local/share/furt/?.lua;;"
|
||||||
|
|
||||||
|
# Working Directory für relative Pfade
|
||||||
|
cd /usr/local/share/furt
|
||||||
|
|
||||||
|
# Lua-Interpreter mit main.lua starten
|
||||||
|
exec lua5.1 src/main.lua "$@"
|
||||||
|
```
|
||||||
|
|
||||||
|
*Linux* - `/usr/local/bin/furt`:
|
||||||
|
```bash
|
||||||
|
#!/bin/bash
|
||||||
|
# furt HTTP API-Gateway
|
||||||
|
|
||||||
|
# Lua-Module-Pfad für furt erweitern
|
||||||
|
export LUA_PATH="/usr/local/share/furt/?.lua;;"
|
||||||
|
|
||||||
|
# Working Directory für relative Pfade
|
||||||
|
cd /usr/local/share/furt
|
||||||
|
|
||||||
|
# Lua-Interpreter mit main.lua starten
|
||||||
|
exec lua5.1 src/main.lua "$@"
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# start.sh-Funktionalität testen
|
chmod +x /usr/local/bin/furt
|
||||||
cd /usr/local/share/furt
|
|
||||||
./scripts/start.sh
|
|
||||||
|
|
||||||
# Erwartete Ausgabe:
|
|
||||||
# Auto-detected lua command: lua
|
|
||||||
# Furt HTTP-Server started on 127.0.0.1:7811
|
|
||||||
# [...]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Warum start.sh statt direkter Lua-Aufruf:**
|
**Warum ein Wrapper-Script:** Lua benötigt explizite Pfad-Konfiguration für Module-Erkennung. Das Script setzt `LUA_PATH` ohne globale Environment-Änderungen.
|
||||||
- Automatische Lua-Command-Detection (lua vs lua5.1)
|
|
||||||
- Service-vs-Interactive-Mode-Erkennung
|
|
||||||
- Plattformspezifische Pfad-Anpassungen
|
|
||||||
- Robuste Daemon-Integration
|
|
||||||
|
|
||||||
### 5. Konfiguration verstehen
|
### 5. Konfiguration verstehen
|
||||||
|
|
||||||
|
|
@ -327,20 +288,26 @@ sudo -u furt /usr/local/share/furt/scripts/start.sh
|
||||||
|
|
||||||
### 6. Service-Integration
|
### 6. Service-Integration
|
||||||
|
|
||||||
**OpenBSD rc.d-Script aus Repository-Template:**
|
**OpenBSD rc.d-Script** - `/etc/rc.d/furt`:
|
||||||
|
```bash
|
||||||
|
#!/bin/ksh
|
||||||
|
|
||||||
|
daemon="/usr/local/bin/furt"
|
||||||
|
daemon_flags=""
|
||||||
|
daemon_user="_furt"
|
||||||
|
daemon_logger="daemon.info"
|
||||||
|
|
||||||
|
. /etc/rc.d/rc.subr
|
||||||
|
|
||||||
|
rc_cmd $1
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Template aus Repository verwenden
|
|
||||||
cp deployment/openbsd/rc.d-furt /etc/rc.d/furt
|
|
||||||
chmod +x /etc/rc.d/furt
|
chmod +x /etc/rc.d/furt
|
||||||
echo "furt_flags=" >> /etc/rc.conf.local
|
echo "furt_flags=" >> /etc/rc.conf.local
|
||||||
rcctl enable furt
|
rcctl enable furt
|
||||||
```
|
```
|
||||||
|
|
||||||
**Das Template `deployment/openbsd/rc.d-furt` enthält:**
|
|
||||||
- Service-vs-Interactive-Detection über `start.sh`
|
|
||||||
- Korrekte Daemon-Konfiguration für OpenBSD
|
|
||||||
- Prozess-Pattern für `rcctl`-Integration
|
|
||||||
|
|
||||||
**Linux systemd-Unit** - `/etc/systemd/system/furt.service`:
|
**Linux systemd-Unit** - `/etc/systemd/system/furt.service`:
|
||||||
```ini
|
```ini
|
||||||
[Unit]
|
[Unit]
|
||||||
|
|
@ -351,12 +318,12 @@ After=network.target
|
||||||
Type=simple
|
Type=simple
|
||||||
User=furt
|
User=furt
|
||||||
Group=furt
|
Group=furt
|
||||||
ExecStart=/usr/local/share/furt/scripts/start.sh start
|
ExecStart=/usr/local/bin/furt
|
||||||
WorkingDirectory=/usr/local/share/furt
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
StandardOutput=journal
|
StandardOutput=journal
|
||||||
StandardError=journal
|
StandardError=journal
|
||||||
|
WorkingDirectory=/usr/local/share/furt
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue