chore(workspace): add hardened startup/security workflows and skill suite
This commit is contained in:
21
skills/searxng-local-search/scripts/smoke.sh
Executable file
21
skills/searxng-local-search/scripts/smoke.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SEARXNG_URL="${SEARXNG_URL:-http://192.168.153.113:18803}"
|
||||
QUERY="${1:-test}"
|
||||
|
||||
echo "[smoke] endpoint: ${SEARXNG_URL}"
|
||||
echo "[smoke] query: ${QUERY}"
|
||||
|
||||
echo "[smoke] curl json API..."
|
||||
ENC_QUERY="$(python3 -c 'import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))' "${QUERY}")"
|
||||
curl -fsS --max-time 15 "${SEARXNG_URL%/}/search?q=${ENC_QUERY}&format=json" > /tmp/searx-smoke.json
|
||||
|
||||
echo "[smoke] validating response..."
|
||||
python3 - <<'PY'
|
||||
import json
|
||||
p='/tmp/searx-smoke.json'
|
||||
obj=json.load(open(p))
|
||||
print('[ok] query:', obj.get('query'))
|
||||
print('[ok] results:', len(obj.get('results', [])))
|
||||
PY
|
||||
Reference in New Issue
Block a user