diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..57d3a20 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +*.sh text eol=lf +*.bash text eol=lf +*.ps1 text eol=crlf diff --git a/README.md b/README.md index ffc890b..8545813 100644 --- a/README.md +++ b/README.md @@ -28,68 +28,85 @@ Basisrouten nach dem Start: - `http://localhost:8080/hints.html` -> Hint Cheatsheet - `http://localhost:8080/solutions.html` -> Musterloesungen -## Voraussetzungen (Linux / macOS / Windows WSL) +## Voraussetzungen -1. Docker + Compose (`docker compose` oder `docker-compose`) -2. Optional fuer TLS-Challenges: `easy-rsa`, `openssl`, `wireshark` +### Windows (empfohlen) -Plattformhinweise: +Installiere die erforderlichen Tools mit winget: -- Linux: Docker Engine oder Docker Desktop -- macOS: Docker Desktop -- Windows: Docker Desktop + WSL Integration aktiv +```powershell +winget install --id Microsoft.VisualStudioCode -e +winget install --id Git.Git -e +winget install --id Docker.DockerDesktop -e +``` -## Schnellstart +Optional fuer TLS-Challenges: + +```powershell +winget install --id OpenSSL.OpenSSL -e +winget install --id WiresharkFoundation.Wireshark -e +``` + +Nach der Installation von Docker Desktop die WSL-Integration in den Einstellungen aktivieren. ### Linux / macOS -```bash -./scripts/bootstrap.sh -``` +Docker Engine oder Docker Desktop installieren. -### Windows (WSL) +Optional fuer TLS-Challenges: -Option A (im WSL-Terminal): +#### Ubuntu/Debian (apt) ```bash -./scripts/bootstrap.sh +sudo apt update +sudo apt install easy-rsa openssl wireshark ``` -Option B (PowerShell Wrapper): +#### Fedora/RHEL (dnf) + +```bash +sudo dnf install easy-rsa openssl wireshark +``` + +## Schnellstart + +### Windows ```powershell ./scripts/workshop.ps1 -Action bootstrap ``` -Der PowerShell-Wrapper ruft intern `./scripts/lab.sh` in WSL auf - die gleiche Steuer-Oberflaeche wie unter Linux/WSL. - Falls PowerShell das Script blockiert: ```powershell Set-ExecutionPolicy -Scope Process Bypass ``` -Weitere Aktionen in PowerShell: - -```powershell -./scripts/workshop.ps1 -Action redeploy -./scripts/workshop.ps1 -Action proxy-reload -./scripts/workshop.ps1 -Action reset -./scripts/workshop.ps1 -Action reset-hard -./scripts/workshop.ps1 -Action reset-origin -``` - -Wenn mehrere Distros installiert sind: +Wenn mehrere WSL-Distros installiert sind: ```powershell ./scripts/workshop.ps1 -Action bootstrap -Distro Ubuntu-24.04 ``` +Alternativ direkt im WSL-Terminal: + +```bash +./scripts/bootstrap.sh +``` + +### Linux / macOS + +```bash +./scripts/bootstrap.sh +``` + Das Skript: - prueft Docker + Compose - startet den Stack +Der PowerShell-Wrapper ruft intern `./scripts/lab.sh` in WSL auf - dieselbe Steuer-Oberflaeche wie unter Linux/WSL. + ## Neu deployen / resetten Alle Aktionen laufen ueber `./scripts/lab.sh ` (in WSL/Linux). Windows-PowerShell-Nutzer nehmen `./scripts/workshop.ps1 -Action ` - dahinter steckt dasselbe Skript. diff --git a/scripts/workshop.ps1 b/scripts/workshop.ps1 index 908318f..38fcd6a 100644 --- a/scripts/workshop.ps1 +++ b/scripts/workshop.ps1 @@ -10,7 +10,8 @@ if (-not (Get-Command wsl.exe -ErrorAction SilentlyContinue)) { } $repoWinPath = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path -$repoWslPath = (& wsl.exe wslpath -a "$repoWinPath").Trim() +$drive = $repoWinPath[0].ToString().ToLower() +$repoWslPath = "/mnt/$drive/" + $repoWinPath.Substring(3) -replace '\\', '/' if (-not $repoWslPath) { Write-Error "Konnte den WSL Pfad fuer das Repo nicht ermitteln."