~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
Fix shellcheck warnings in all shell scripts
LearningCircuit309b2a619e75
diff --git a/.github/scripts/file-whitelist-check.sh b/.github/scripts/file-whitelist-check.shindex 526035f72e..af91aa61b9 100755--- a/.github/scripts/file-whitelist-check.sh+++ b/.github/scripts/file-whitelist-check.sh@@ -624,7 +624,7 @@ esacif [ -f "$FILE_PATH" ]; thenFILE_SIZE=$(stat -c%s "$FILE_PATH" 2>/dev/null || echo "unknown")if [ "$FILE_SIZE" != "unknown" ]; then-READABLE_SIZE=$(echo $FILE_SIZE | awk '{if($1>=1048576) printf "%.1fMB", $1/1048576; else if($1>=1024) printf "%.1fKB", $1/1024; else printf "%dB", $1}')+READABLE_SIZE=$(echo "$FILE_SIZE" | awk '{if($1>=1048576) printf "%.1fMB", $1/1048576; else if($1>=1024) printf "%.1fKB", $1/1024; else printf "%dB", $1}')echo " → File size: $READABLE_SIZE"fifidiff --git a/.pre-commit-hooks/file-whitelist-check.sh b/.pre-commit-hooks/file-whitelist-check.shindex f8a7d1a55f..54646dc16c 100755--- a/.pre-commit-hooks/file-whitelist-check.sh+++ b/.pre-commit-hooks/file-whitelist-check.sh@@ -79,7 +79,7 @@ for file in "$@"; do# 2. Large file check (>1MB)FILE_SIZE=$(stat -c%s "$file" 2>/dev/null || stat -f%z "$file" 2>/dev/null || echo 0)if [ "$FILE_SIZE" -gt 1048576 ]; then- LARGE_FILES+=("$file ($(echo $FILE_SIZE | awk '{printf "%.1fMB", $1/1024/1024}'))")+ LARGE_FILES+=("$file ($(echo "$FILE_SIZE" | awk '{printf "%.1fMB", $1/1024/1024}'))")fidonediff --git a/docs/security/analyze_sarif.sh b/docs/security/analyze_sarif.shindex a93a1a9793..3d2d652765 100644--- a/docs/security/analyze_sarif.sh+++ b/docs/security/analyze_sarif.sh@@ -95,7 +95,7 @@ if curl -s -X POST "$OLLAMA_ENDPOINT" \-H "Content-Type: application/json" \-d "$REQUEST_BODY" | \while IFS= read -r line; do- if [ ! -z "$line" ]; then+ if [ -n "$line" ]; thenecho "$line" | jq -r '.response // empty'fidone > "$OUTPUT_PATH"; thendiff --git a/examples/benchmarks/claude_grading/run_benchmark.sh b/examples/benchmarks/claude_grading/run_benchmark.shindex 8eb1d17245..6b8b1de372 100755--- a/examples/benchmarks/claude_grading/run_benchmark.sh+++ b/examples/benchmarks/claude_grading/run_benchmark.sh@@ -2,13 +2,14 @@# Run a benchmark with Claude API grading integration# Navigate to project root which is needed for proper imports-cd "$(dirname "$0")/../../.."+cd "$(dirname "$0")/../../.." || exit 1echo "Changed to project root: $(pwd)"# Activate virtual environment if it existsVENV_PATH=".venv/bin/activate"if [ -f "$VENV_PATH" ]; thenecho "Activating virtual environment..."+ # shellcheck source=/dev/nullsource "$VENV_PATH"elseecho "Warning: Virtual environment not found at $VENV_PATH"diff --git a/examples/elasticsearch/test_elasticsearch.sh b/examples/elasticsearch/test_elasticsearch.shindex acf9378540..f94900ffea 100755--- a/examples/elasticsearch/test_elasticsearch.sh+++ b/examples/elasticsearch/test_elasticsearch.sh@@ -25,7 +25,7 @@ if command -v docker &> /dev/null; thenecho "Waiting for Elasticsearch to be ready (this may take 30-60 seconds)..."# Wait for Elasticsearch to be ready- for i in {1..30}; do+ for _ in {1..30}; doif curl -s -o /dev/null -w "%{http_code}" http://localhost:9200 | grep -q "200"; thenecho -e "${GREEN}✓ Elasticsearch is ready!${NC}"breakdiff --git a/scripts/dev/restart_server.sh b/scripts/dev/restart_server.shindex fadbf13ca2..1a24d0d79d 100755--- a/scripts/dev/restart_server.sh+++ b/scripts/dev/restart_server.sh@@ -9,7 +9,7 @@ sleep 1echo "Starting LDR server..."# Change to the script's parent directory (project root)-cd "$(dirname "$0")/../.."+cd "$(dirname "$0")/../.." || exit 1# Start server in background and detach from terminal(nohup pdm run python -m local_deep_research.web.app > /tmp/ldr_server.log 2>&1 &) &diff --git a/scripts/dev/stop_server.sh b/scripts/dev/stop_server.shindex 14ef1c2e50..4e7609de3c 100755--- a/scripts/dev/stop_server.sh+++ b/scripts/dev/stop_server.sh@@ -27,7 +27,7 @@ pkill -f "flask run" 2>/dev/null# Check final statusif pgrep -f "python -m local_deep_research.web.app" > /dev/null; thenecho "Error: Server processes still running:"- ps aux | grep "python -m local_deep_research.web.app" | grep -v grep+ pgrep -af "python -m local_deep_research.web.app"exit 1elseecho "All server processes stopped"diff --git a/scripts/ollama_entrypoint.sh b/scripts/ollama_entrypoint.shindex 344dc4577b..2be1dadc7d 100755--- a/scripts/ollama_entrypoint.sh+++ b/scripts/ollama_entrypoint.sh@@ -27,9 +27,8 @@ echo "Ollama service is ready."# Pull the model using ollama pullecho "Pulling the $MODEL_NAME with ollama pull..."-ollama pull $MODEL_NAME# Check if the model was pulled successfully-if [ $? -eq 0 ]; then+if ollama pull "$MODEL_NAME"; thenecho "Model pulled successfully."elseecho "Failed to pull model."@@ -38,4 +37,3 @@ fi# Run ollama forever.sleep infinity-```diff --git a/tests/health_check/test_endpoints_health.sh b/tests/health_check/test_endpoints_health.shindex e21cf8b2fb..0bfa61bf30 100755--- a/tests/health_check/test_endpoints_health.sh+++ b/tests/health_check/test_endpoints_health.sh@@ -29,7 +29,7 @@ ENDPOINTS=(echo -e "${BLUE}🏥 Starting health check for ${#ENDPOINTS[@]} endpoints...${NC}"echo -e "${BLUE}🌐 Base URL: $BASE_URL${NC}"-echo "$(printf '=%.0s' {1..60})"+printf '=%.0s' {1..60}; echo# Test connectivity firstecho -e "${YELLOW}🔍 Testing connectivity...${NC}"@@ -42,7 +42,7 @@ elsefiecho ""-echo "$(printf '=%.0s' {1..60})"+printf '=%.0s' {1..60}; echo# Test each endpointsuccess_count=0@@ -75,7 +75,7 @@ for endpoint in "${ENDPOINTS[@]}"; dofidone-echo "$(printf '=%.0s' {1..60})"+printf '=%.0s' {1..60}; echo# Calculate success ratesuccess_rate=$((success_count * 100 / total_count))@@ -98,7 +98,7 @@ for endpoint in "${ENDPOINTS[@]}"; doif [[ "$endpoint" == *"/api/"* || "$endpoint" == "/api/"* ]]; then((api_count++))# Check if this endpoint was successful- if [[ ! " ${failed_endpoints[@]} " =~ " ${endpoint} " ]]; then+ if [[ ! " ${failed_endpoints[*]} " =~ \ ${endpoint}\ ]]; then((api_success++))fifi@@ -110,7 +110,7 @@ if [ $api_count -gt 0 ]; thenfiecho ""-if [ $success_count -eq $total_count ]; then+if [ "$success_count" -eq "$total_count" ]; thenecho -e "${GREEN}🎉 All endpoints are healthy!${NC}"exit 0elsediff --git a/tests/run_followup_tests.sh b/tests/run_followup_tests.shindex 28afb3fbbb..1045f8255d 100755--- a/tests/run_followup_tests.sh+++ b/tests/run_followup_tests.sh@@ -19,13 +19,11 @@ check_server() {# Start server if not runningif ! check_server; thenecho -e "${YELLOW}Starting local server...${NC}"- cd src- nohup python -m local_deep_research.web.app --port 5000 > ../server_test.log 2>&1 &+ (cd src && nohup python -m local_deep_research.web.app --port 5000 > ../server_test.log 2>&1 &)SERVER_PID=$!- cd ..# Wait for server to start- for i in {1..30}; do+ for _ in {1..30}; doif check_server; thenecho -e "${GREEN}Server started successfully${NC}"break@@ -64,7 +62,7 @@ fiecho ""echo "🖥️ Running UI Tests..."echo "---------------------"-cd tests/ui_tests+cd tests/ui_tests || exit 1# Install npm dependencies if neededif [ ! -d "node_modules" ]; then@@ -85,7 +83,7 @@ elsefi# Stop server if we started it-if [ ! -z "$SERVER_PID" ]; then+if [ -n "$SERVER_PID" ]; thenecho ""echo "Stopping test server..."kill $SERVER_PID 2>/dev/nulldiff --git a/tests/test_llm/run_llm_tests.sh b/tests/test_llm/run_llm_tests.shindex 22bc9b4fa3..67a0a9b9af 100755--- a/tests/test_llm/run_llm_tests.sh+++ b/tests/test_llm/run_llm_tests.sh@@ -5,7 +5,8 @@ echo "Running LLM Integration Tests"echo "============================="# Set up environment-export PYTHONPATH=$PYTHONPATH:$(pwd)+PYTHONPATH="${PYTHONPATH}:$(pwd)"+export PYTHONPATHexport LDR_USE_FALLBACK_LLM=true# Run registry testsdiff --git a/tests/ui_tests/run_api_key_test.sh b/tests/ui_tests/run_api_key_test.shindex 63311201ad..7f98b026ac 100755--- a/tests/ui_tests/run_api_key_test.sh+++ b/tests/ui_tests/run_api_key_test.sh@@ -40,10 +40,8 @@ echo ""echo -e "${BLUE}Starting comprehensive API key test...${NC}"echo "----------------------------------------"-node test_api_key_comprehensive.js--# Check exit code-if [ $? -eq 0 ]; then+# Check exit code directly+if node test_api_key_comprehensive.js; thenecho ""echo -e "${GREEN}✓ All tests passed!${NC}"echo -e "${BLUE}Check screenshots in /tmp/ for visual confirmation${NC}"