From cfc8a4241795dd607f893dae096530e2147707d4 Mon Sep 17 00:00:00 2001 From: duffyduck Date: Thu, 19 Feb 2026 07:10:59 +0100 Subject: [PATCH] readme changed --- README.md | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 109 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cc5da4e..e3edbc0 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,80 @@ Web-UI oeffnen: http://localhost:8080 ## Installation -### Voraussetzungen +### Go installieren + +#### Linux (Debian/Ubuntu) + +```bash +# Aktuelle Version herunterladen (go1.25.0 oder neuer) +wget https://go.dev/dl/go1.25.0.linux-amd64.tar.gz + +# Altes Go entfernen und neues installieren +sudo rm -rf /usr/local/go +sudo tar -C /usr/local -xzf go1.25.0.linux-amd64.tar.gz + +# PATH einrichten - ans Ende von ~/.bashrc oder ~/.profile anfuegen: +echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc +source ~/.bashrc + +# Pruefen +go version +``` + +#### Windows + +1. Installer herunterladen: https://go.dev/dl/ (Datei `go1.25.0.windows-amd64.msi`) +2. MSI-Installer ausfuehren - installiert Go nach `C:\Program Files\Go` +3. Der Installer richtet den PATH automatisch ein +4. Neue Eingabeaufforderung oeffnen und pruefen: + ```cmd + go version + ``` + +Falls der PATH nicht automatisch gesetzt wurde: +1. Windows-Taste > "Umgebungsvariablen" suchen > "Umgebungsvariablen fuer dieses Konto bearbeiten" +2. Variable `Path` bearbeiten > Neu > `C:\Program Files\Go\bin` hinzufuegen +3. Eingabeaufforderung neu oeffnen + +### Make installieren + +#### Linux (Debian/Ubuntu) + +```bash +sudo apt update +sudo apt install make +``` + +#### Linux (Fedora/RHEL) + +```bash +sudo dnf install make +``` + +#### Windows + +**Option A: Chocolatey** (empfohlen) +```powershell +# Chocolatey installieren (Admin-PowerShell): +Set-ExecutionPolicy Bypass -Scope Process -Force +[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 +iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + +# Make installieren: +choco install make +``` + +**Option B: MSYS2** +1. MSYS2 von https://www.msys2.org herunterladen und installieren +2. In der MSYS2-Shell: + ```bash + pacman -S make + ``` +3. `C:\msys64\usr\bin` zum Windows PATH hinzufuegen + +**Option C: Ohne Make** - Go-Befehle direkt ausfuehren (siehe unten) + +### Voraussetzungen (Laufzeit) **Linux (Share-Modus):** - Root-Rechte (fuer USB-Geraetezugriff) @@ -88,14 +161,47 @@ Web-UI oeffnen: http://localhost:8080 ### Bauen +#### Mit Make + ```bash -# Benoetigt Go 1.21+ +# Alles bauen (Relay + Client, Linux) make all -# Fuer Windows (Cross-Compilation): +# Nur Relay-Server +make relay + +# Nur Client (Linux) +make client + +# Client fuer Windows (Cross-Compilation von Linux) make client-windows ``` +#### Ohne Make (Go direkt) + +```bash +# Linux Relay-Server +CGO_ENABLED=0 go build -ldflags="-s -w" -o bin/usb-relay ./cmd/usb-relay/ + +# Linux Client +CGO_ENABLED=0 go build -ldflags="-s -w" -o bin/usb-client ./cmd/usb-client/ + +# Windows Client (Cross-Compilation von Linux) +CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o bin/usb-client.exe ./cmd/usb-client/ +``` + +Unter Windows (cmd.exe): +```cmd +set CGO_ENABLED=0 +go build -ldflags="-s -w" -o bin\usb-client.exe ./cmd/usb-client/ +``` + +Unter Windows (PowerShell): +```powershell +$env:CGO_ENABLED=0 +go build -ldflags="-s -w" -o bin\usb-client.exe ./cmd/usb-client/ +``` + ### Docker (Relay-Server) ```bash