commit 2a44f9fbc72062a7ea37997d93a6dc92e92d0bf0 Author: jan Date: Tue Apr 28 15:57:36 2026 +0200 Add Fedora local Stirling PDF setup diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9fa88ac --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +*.log diff --git a/README.md b/README.md new file mode 100644 index 0000000..be93715 --- /dev/null +++ b/README.md @@ -0,0 +1,70 @@ +# Stirling PDF Fedora Local + +Lokale Stirling-PDF-Installation für Fedora mit Podman und Chromium-App-Fenster. + +## Ziel + +- vollständige lokale Stirling-PDF-Server-Version +- keine Cloud-Abhängigkeit +- nur lokal erreichbar unter http://127.0.0.1:8080 +- startet wie eine normale GNOME-App +- Container stoppt automatisch beim Schließen des App-Fensters +- keine dauerhafte Hintergrundlast im Leerlauf + +## Installation + + git clone https://gitea.diehanis.de/Jan/Stirling_PDF_Fedora_Local.git + cd Stirling_PDF_Fedora_Local + ./install.sh + +Danach starten: + + Super-Taste -> Stirling PDF + +Oder direkt: + + ~/.local/bin/stirling-pdf-app + +## Update + + ./update.sh + +## Deinstallation + + ./uninstall.sh + +## Status prüfen + + podman ps + podman ps -a | grep stirling + podman logs stirling-pdf + +## Lokale Daten + +Persistente Daten liegen unter: + + ~/.local/share/stirling-pdf/ + +## Manuelle Notfall-Deinstallation + + podman stop stirling-pdf 2>/dev/null || true + podman rm stirling-pdf 2>/dev/null || true + rm -f ~/.local/bin/stirling-pdf-app + rm -f ~/.local/share/applications/stirling-pdf.desktop + update-desktop-database ~/.local/share/applications 2>/dev/null || true + +Optional Daten löschen: + + rm -rf ~/.local/share/stirling-pdf + +Optional Image löschen: + + podman image rm docker.io/stirlingtools/stirling-pdf:latest + +Optional Chromium entfernen: + + sudo dnf remove -y chromium chromium-common + +## Warum diese Lösung? + +Die native Desktop-App ist komfortabel, aber bestimmte erweiterte Funktionen können einen Server oder Cloud-Zugang benötigen. Diese Podman-Lösung nutzt die vollständige lokale Stirling-PDF-Serverversion und bleibt lokal auf dem Laptop. diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..87b53dd --- /dev/null +++ b/install.sh @@ -0,0 +1,90 @@ +#!/usr/bin/env bash +set -euo pipefail + +CONTAINER_NAME="stirling-pdf" +URL="http://127.0.0.1:8080" +BASE_DIR="$HOME/.local/share/stirling-pdf" +BIN_DIR="$HOME/.local/bin" +APP_DIR="$HOME/.local/share/applications" + +sudo dnf install -y podman chromium curl libnotify + +mkdir -p "$BASE_DIR/configs" "$BASE_DIR/logs" "$BASE_DIR/pipeline" "$BASE_DIR/tessdata" "$BASE_DIR/chromium-profile" "$BIN_DIR" "$APP_DIR" + +podman stop "$CONTAINER_NAME" >/dev/null 2>&1 || true +podman rm "$CONTAINER_NAME" >/dev/null 2>&1 || true + +podman run -d \ + --name "$CONTAINER_NAME" \ + -p 127.0.0.1:8080:8080 \ + -v "$BASE_DIR/configs:/configs:Z" \ + -v "$BASE_DIR/logs:/logs:Z" \ + -v "$BASE_DIR/pipeline:/pipeline:Z" \ + -v "$BASE_DIR/tessdata:/usr/share/tessdata:Z" \ + -e SECURITY_ENABLELOGIN=false \ + docker.io/stirlingtools/stirling-pdf:latest + +podman stop "$CONTAINER_NAME" >/dev/null 2>&1 || true + +cat > "$BIN_DIR/stirling-pdf-app" <<'APP_EOF' +#!/usr/bin/env bash +set -euo pipefail + +CONTAINER_NAME="stirling-pdf" +URL="http://127.0.0.1:8080" +PROFILE_DIR="$HOME/.local/share/stirling-pdf/chromium-profile" + +BROWSER_BIN="$(command -v chromium-browser || command -v chromium || command -v google-chrome || true)" + +if [[ -z "$BROWSER_BIN" ]]; then + notify-send "Stirling PDF" "Kein Chromium/Chrome-Browser gefunden." + exit 1 +fi + +mkdir -p "$PROFILE_DIR" + +podman start "$CONTAINER_NAME" >/dev/null 2>&1 || true + +for i in {1..60}; do + if curl -fsS "$URL" >/dev/null 2>&1; then + "$BROWSER_BIN" \ + --app="$URL" \ + --user-data-dir="$PROFILE_DIR" \ + --disable-background-networking \ + --disable-sync \ + --disable-features=PushMessaging,MediaRouter,OptimizationHints,OnDeviceModel \ + --disable-component-update \ + --disable-gpu \ + --no-first-run \ + --no-default-browser-check \ + --password-store=basic \ + >/dev/null 2>&1 + + podman stop "$CONTAINER_NAME" >/dev/null 2>&1 || true + exit 0 + fi + sleep 1 +done + +notify-send "Stirling PDF" "Stirling PDF ist nicht rechtzeitig gestartet." +podman stop "$CONTAINER_NAME" >/dev/null 2>&1 || true +exit 1 +APP_EOF + +chmod +x "$BIN_DIR/stirling-pdf-app" + +cat > "$APP_DIR/stirling-pdf.desktop" </dev/null || true + +echo "Installation complete. Start with: Super -> Stirling PDF" diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..eb096f5 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euo pipefail + +CONTAINER_NAME="stirling-pdf" +BASE_DIR="$HOME/.local/share/stirling-pdf" +BIN_FILE="$HOME/.local/bin/stirling-pdf-app" +DESKTOP_FILE="$HOME/.local/share/applications/stirling-pdf.desktop" + +podman stop "$CONTAINER_NAME" >/dev/null 2>&1 || true +podman rm "$CONTAINER_NAME" >/dev/null 2>&1 || true + +rm -f "$BIN_FILE" +rm -f "$DESKTOP_FILE" +update-desktop-database "$HOME/.local/share/applications" 2>/dev/null || true + +read -r -p "Lokale Stirling-Daten löschen unter $BASE_DIR? [y/N] " DELETE_DATA +if [[ "$DELETE_DATA" =~ ^[Yy]$ ]]; then + rm -rf "$BASE_DIR" +fi + +read -r -p "Container-Image löschen? [y/N] " DELETE_IMAGE +if [[ "$DELETE_IMAGE" =~ ^[Yy]$ ]]; then + podman image rm docker.io/stirlingtools/stirling-pdf:latest >/dev/null 2>&1 || true +fi + +read -r -p "Chromium entfernen? Nur ja sagen, wenn Chromium nur dafür installiert wurde. [y/N] " DELETE_CHROMIUM +if [[ "$DELETE_CHROMIUM" =~ ^[Yy]$ ]]; then + sudo dnf remove -y chromium chromium-common +fi + +echo "Uninstall complete." diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..ba7282b --- /dev/null +++ b/update.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -euo pipefail + +CONTAINER_NAME="stirling-pdf" +BASE_DIR="$HOME/.local/share/stirling-pdf" + +podman stop "$CONTAINER_NAME" >/dev/null 2>&1 || true +podman rm "$CONTAINER_NAME" >/dev/null 2>&1 || true +podman pull docker.io/stirlingtools/stirling-pdf:latest + +podman run -d \ + --name "$CONTAINER_NAME" \ + -p 127.0.0.1:8080:8080 \ + -v "$BASE_DIR/configs:/configs:Z" \ + -v "$BASE_DIR/logs:/logs:Z" \ + -v "$BASE_DIR/pipeline:/pipeline:Z" \ + -v "$BASE_DIR/tessdata:/usr/share/tessdata:Z" \ + -e SECURITY_ENABLELOGIN=false \ + docker.io/stirlingtools/stirling-pdf:latest + +podman stop "$CONTAINER_NAME" >/dev/null 2>&1 || true + +echo "Update complete."