turnstone/harvester/harvester.sh
pyr0ball 16fe5f70a5 feat: Alpha milestone — corpus management, upload ingest, harvester agent
Closes #1 (incident tagging — already implemented), #2, #3, #5.

- feat(api): DELETE /api/sources/{id} — purge entries + FTS rows for a source
- feat(api): POST /api/sources/{id}/ingest — re-ingest from sources.yaml
- feat(api): POST /api/ingest/upload — multipart log file upload with auto-detect
- feat(ui): SourcesView reingest + delete buttons and upload file input (#2)
- feat(harvester): harvester.py push + incident subcommands (#5)
- feat(harvester): Dockerfile, docker-compose.yml, harvester.sh (containerless)
- feat(config): GPU_SERVER_URL → CF_ORCH_URL resolution + write-back (#20)
- docs: .env.example, README Configuration table, version bump to 0.5.0
2026-05-19 07:45:58 -07:00

26 lines
857 B
Bash
Executable file

#!/usr/bin/env bash
# Turnstone Harvester — containerless wrapper
# Requires: python3, pip install pyyaml
#
# Usage:
# ./harvester.sh push
# ./harvester.sh incident "jellyseerr went down" --started "2026-05-19 10:00" --type crash
#
# Environment variables:
# TURNSTONE_URL Base URL of the Turnstone instance (default: http://localhost:8534)
# TURNSTONE_SOURCES Path to sources.yaml (default: /etc/turnstone/sources.yaml)
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export TURNSTONE_URL="${TURNSTONE_URL:-http://localhost:8534}"
export TURNSTONE_SOURCES="${TURNSTONE_SOURCES:-/etc/turnstone/sources.yaml}"
# Install dependencies if not present
if ! python3 -c "import yaml" 2>/dev/null; then
echo "Installing pyyaml..."
pip3 install --quiet pyyaml
fi
exec python3 "$SCRIPT_DIR/harvester.py" "$@"