~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: Implement targeted CSRF exemptions for API endpoints (#420)
LearningCircuitc5a33146a55a
diff --git a/src/local_deep_research/web/api.py b/src/local_deep_research/web/api.pyindex bf417355ca..b3d36c78f3 100644--- a/src/local_deep_research/web/api.py+++ b/src/local_deep_research/web/api.py@@ -8,7 +8,6 @@ import timefrom functools import wrapsfrom flask import Blueprint, jsonify, request-from flask_wtf.csrf import csrf_exemptfrom ..api.research_functions import analyze_documentsfrom .services.settings_service import get_setting@@ -72,7 +71,6 @@ def api_access_control(f):@api_blueprint.route("/", methods=["GET"])-@csrf_exempt@api_access_controldef api_documentation():"""@@ -124,7 +122,6 @@ def api_documentation():@api_blueprint.route("/health", methods=["GET"])-@csrf_exemptdef health_check():"""Simple health check endpoint."""return jsonify(diff --git a/src/local_deep_research/web/app_factory.py b/src/local_deep_research/web/app_factory.pyindex 74594ece7e..44f29e8e23 100644--- a/src/local_deep_research/web/app_factory.py+++ b/src/local_deep_research/web/app_factory.py@@ -51,11 +51,10 @@ def create_app():# App configurationapp.config["SECRET_KEY"] = "deep-research-secret-key"- # Temporarily disable CSRF for API testing- app.config["WTF_CSRF_ENABLED"] = False-- # Initialize CSRF protection (disabled)- CSRFProtect(app)+ # Initialize CSRF protection+ csrf = CSRFProtect(app)+ # Exempt Socket.IO from CSRF protection+ csrf.exempt("research.socket_io")# Database configuration - Use unified ldr.db from the database moduledb_path = DB_PATH@@ -188,8 +187,11 @@ def register_blueprints(app):csrf = app.extensions["csrf"]# Exempt the API blueprint routes by actual endpointscsrf.exempt("api_v1")+ csrf.exempt("api")for rule in app.url_map.iter_rules():- if rule.endpoint.startswith("api_v1."):+ if rule.endpoint and (+ rule.endpoint.startswith("api_v1.") or rule.endpoint.startswith("api.")+ ):csrf.exempt(rule.endpoint)# Add favicon route