From 33900a8b3ce3c11477a2e21816ad21fb2034d65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thuumate=20=F0=9F=91=BB?= Date: Mon, 15 Jun 2026 17:55:13 +0200 Subject: [PATCH] feat: PKGBUILD + Install-/Usage-Doku + AUR-Repo-Setup Neue Dateien: - PKGBUILD: AUR-Paket mit Hook-Installation - INSTALL.md: Installations-Guide mit eigenem AUR-Repo - USAGE.md: Befehlsreferenz + Troubleshooting Features: - ALPM-Hook Installation via aegisaur install-hook - Eigenes pacman-Remote auf Gitea - Config/Cache Pfad-Dokumentation Repository: https://gitea.die-heimatlosen.eu/arch_agent/aegisaur --- INSTALL.md | 75 +++++++++++++++++++++++++++++++ PKGBUILD | 72 ++++++++++++++++++++++++++++++ USAGE.md | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 276 insertions(+) create mode 100644 INSTALL.md create mode 100644 PKGBUILD create mode 100644 USAGE.md diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..00a6aaf --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,75 @@ +# πŸ“¦ Installation Guide + +## Schnellstart + +```bash +# Als AUR-Paket installieren (empfohlen) +makepkg -si PKGBUILD + +# Oder systemweit nach /usr/local/bin +sudo cp target/release/aegisaur /usr/local/bin/ +sudo chmod +x /usr/local/bin/aegisaur + +# Oder symbolischer Link +sudo ln -s $(pwd)/target/release/aegisaur /usr/local/bin/aegisaur +``` + +## Eigenes AUR-Repository + +### Pfad auf Gitea +``` +https://gitea.die-heimatlosen.eu/arch_agent/aegisaur +``` + +### Als pacman-Remote hinzufΓΌgen + +Bearbeite `/etc/pacman.conf`: + +```ini +[aegisaur] +SigLevel = Optional TrustAll +Server = https://gitea.die-heimatlosen.eu/arch_agent/$repo/releases/download/latest +``` + +### Oder manuell + +```bash +# PKGBUILD herunterladen +curl -O https://gitea.die-heimatlosen.eu/arch_agent/aegisaur/raw/branch/master/PKGBUILD + +# Bauen und installieren +makepkg -si +``` + +## ALPM-Hook (systemweit) + +```bash +# Installiert Hook nach /usr/share/libalpm/hooks/ +sudo aegisaur install-hook + +# Deinstalliert Hook +sudo aegisaur remove-hook +``` + +## Konfiguration + +```bash +# Erstellt ~/.config/aegisaur/config.toml +aegisaur config + +# Beispiel-Config kopieren +cp /usr/share/aegisaur/config.example.toml ~/.config/aegisaur/config.toml +``` + +## Pfad-Übersicht + +| Komponente | Pfad | +|------------|------| +| Binary | `/usr/bin/aegisaur` | +| ALPM-Hook | `/usr/share/libalpm/hooks/99-aegisaur.hook` | +| Hook-Script | `/usr/share/libalpm/hooks/aegisaur-check.sh` | +| Dokumentation | `/usr/share/doc/aegisaur/` | +| Config | `~/.config/aegisaur/config.toml` | +| Cache | `~/.cache/aegisaur/` | +| Quellcode | `/home/arch_agent_system/.openclaw/workspace/aegisaur/` | +| Gitea-Repo | `https://gitea.die-heimatlosen.eu/arch_agent/aegisaur` | diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..14dd337 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,72 @@ +# Maintainer: Thuumate +# AUR-Repo: https://gitea.die-heimatlosen.eu/arch_agent/aegisaur + +pkgname=aegisaur +pkgver=0.1.0 +pkgrel=1 +pkgdesc="Trust-Scoring + IOC-Scanner fΓΌr Arch Linux AUR-Pakete" +arch=('x86_64' 'x86_64_v3' 'x86_64_v4' 'aarch64') +url="https://gitea.die-heimatlosen.eu/arch_agent/aegisaur" +license=('MIT') +makedepends=('rust' 'cargo') +depends=('pacman' 'libalpm') +optdepends=( + 'sudo: fΓΌr install-hook und ALPM-Integration' + 'nodejs: fΓΌr IOC-Checks mit npm-Paketen' +) +source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz") +sha256sums=('SKIP') + +build() { + cd "$srcdir/$pkgname-$pkgver" + export RUSTFLAGS="-C target-cpu=${CARCH}" + cargo build --release --locked +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + # Binary + install -Dm755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname" + + # ALPM Hook + install -Dm644 "src/hook/hook.install" "$pkgdir/usr/share/libalpm/hooks/99-aegisaur.hook" + install -Dm755 "src/hook/check.sh" "$pkgdir/usr/share/libalpm/hooks/aegisaur-check.sh" + + # Dokumentation + install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md" + install -Dm644 TODO.md "$pkgdir/usr/share/doc/$pkgname/TODO.md" + install -Dm644 INSTALL.md "$pkgdir/usr/share/doc/$pkgname/INSTALL.md" + install -Dm644 USAGE.md "$pkgdir/usr/share/doc/$pkgname/USAGE.md" + + # Config Beispiel + install -Dm644 "config/example.toml" "$pkgdir/usr/share/$pkgname/config.example.toml" + + # Licence + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + +post_install() { + echo "╔══════════════════════════════════════════════════════════════╗" + echo "β•‘ AegisAUR wurde installiert! β•‘" + echo "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•" + echo "" + echo "Nutzer-Spezifisches Setup:" + echo " aegisaur config β†’ Erstellt ~/.config/aegisaur/config.toml" + echo "" + echo "Systemweites Setup (ALPM-Hook):" + echo " sudo aegisaur install-hook" + echo "" + echo "Schnellstart:" + echo " aegisaur scan-all β†’ Scannt alle installierten AUR-Pakete" + echo " aegisaur check-ioc β†’ PrΓΌft gegen aktuelle IOC-Listen" + echo "" + echo "Mehr Infos: https://gitea.die-heimatlosen.eu/arch_agent/aegisaur" +} + +pre_remove() { + echo "AegisAUR Hook wird entfernt..." + if command -v aegisaur >/dev/null 2>&1; then + aegisaur remove-hook 2>/dev/null || true + fi +} diff --git a/USAGE.md b/USAGE.md new file mode 100644 index 0000000..887add0 --- /dev/null +++ b/USAGE.md @@ -0,0 +1,129 @@ +# πŸ“– AegisAUR Usage Guide + +## Befehls-Übersicht + +```bash +# Einzelnes Paket scannen +aegisaur scan [--verbose] + +# Alle AUR-Pakete scannen +aegisaur scan-all [--verbose] + +# IOC-Check (wie aurvulntest) +aegisaur check-ioc [--list atomicarch|all] + +# Whitelist-Verwaltung +aegisaur allow +aegisaur deny + +# System-Konfiguration +aegisaur config +aegisaur cache + +# ALPM-Hook (root nΓΆtig) +sudo aegisaur install-hook +sudo aegisaur remove-hook +``` + +## Beispiel-Workflows + +### Vor Installation eines AUR-Pakets +```bash +# 1. Scannen +aegisaur scan neues-paket + +# 2. Wenn IOC erkannt β†’ NICHT installieren +# 3. Wenn verdΓ€chtig β†’ PKGBUILD prΓΌfen +# 4. Wenn OK β†’ installieren (mit Hook automatisch) + +yay -S neues-paket # Hook scannt automatisch +``` + +### RegelmÀßige Checks +```bash +# Alle 48h (via cron/systemd) +aegisaur check-ioc +``` + +### Volle SystemprΓΌfung +```bash +# Alle AUR-Pakete scannen + IOC-Listen checken +aegisaur scan-all && aegisaur check-ioc +``` + +## Exit Codes + +| Code | Bedeutung | +|------|-----------| +| 0 | Erfolg | +| 1 | Allgemeiner Fehler | +| 2 | IOC erkannt / Kritisch | +| 3 | Scan-Fehler | + +## Konfiguration + +```toml +# ~/.config/aegisaur/config.toml +[settings] +auto_check_iocs = true +auto_check_pkgbuild = true +ioc_cache_ttl_minutes = 60 +warning_threshold = 60 +critical_threshold = 30 +block_install_on_critical = false +block_install_on_ioc = true +notify_desktop = true + +[sources.atomic_arch] +name = "Atomic Arch Gist" +url = "https://gist.githubusercontent.com/Kidev/85756c3dcad3623ca5604a8135bafd14/raw" +enabled = true + +[sources.community] +name = "AUR Community Blocklist" +url = "https://raw.githubusercontent.com/Kidev/AUR-Blocklist/main/blocklist.txt" +enabled = true +``` + +## Wichtige Pfade + +| Zweck | Lokaler Pfad | Gitea URL | +|-------|-------------|-----------| +| Quellcode | `/home/arch_agent_system/.openclaw/workspace/aegisaur/` | `https://gitea.die-heimatlosen.eu/arch_agent/aegisaur` | +| Binary (Release) | `target/release/aegisaur` | Releases Tab | +| PKGBUILD | `./PKGBUILD` | Raw view | +| Dokumentation | `./README.md`, `./USAGE.md` | Wiki/Raw | +| Issues/Feedback | - | `https://gitea.die-heimatlosen.eu/arch_agent/aegisaur/issues` | + +## Troubleshooting + +### Hook funktioniert nicht +```bash +# Rechte prΓΌfen +ls -la /usr/share/libalpm/hooks/aegisaur* + +# Manuell ausfΓΌhren +sudo bash /usr/share/libalpm/hooks/aegisaur-check.sh +``` + +### Cache-Probleme +```bash +# Cache leeren +rm -rf ~/.cache/aegisaur/ + +# Neu befΓΌllen +aegisaur check-ioc +``` + +### Netzwerk-Fehler +```bash +# Proxy-Config prΓΌfen +env | grep -i proxy + +# Test-Request +curl -I https://gist.githubusercontent.com/Kidev/... +``` + +--- +*Built with ❀️ (and some πŸ‘» magic)* +*Quasi & Thuumate β€” 2026*