Skip to content

~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.

fix: Address remaining PR review comments from djpetti

LearningCircuit31aa55d1ee13
diff --git a/.pre-commit-hooks/check-env-vars.py b/.pre-commit-hooks/check-env-vars.py
index f329745b5f..d27dc1d682 100755
--- a/.pre-commit-hooks/check-env-vars.py
+++ b/.pre-commit-hooks/check-env-vars.py
@@ -6,6 +6,10 @@ Ensures environment variables are accessed through SettingsManager where appropr
import ast
import sys
+import os
+
+# Set environment variable for pre-commit hooks to allow unencrypted databases
+os.environ["LDR_ALLOW_UNENCRYPTED"] = "true"
# Allowed patterns - these can use os.environ directly
@@ -23,6 +27,7 @@ ALLOWED_PATTERNS = {
"scripts/",
"utils/",
"cli.py",
+ ".pre-commit-hooks/",
# Example scripts demonstrating usage
"examples/",
# Specific modules that need direct access
diff --git a/.pre-commit-hooks/check-research-id-type.py b/.pre-commit-hooks/check-research-id-type.py
index 19a75b8faf..aba28d2947 100755
--- a/.pre-commit-hooks/check-research-id-type.py
+++ b/.pre-commit-hooks/check-research-id-type.py
@@ -6,6 +6,10 @@ Research IDs are UUIDs and should always be treated as strings, never as integer
import sys
import re
+import os
+
+# Set environment variable for pre-commit hooks to allow unencrypted databases
+os.environ["LDR_ALLOW_UNENCRYPTED"] = "true"
def check_file(filepath):
diff --git a/.pre-commit-hooks/custom-checks.py b/.pre-commit-hooks/custom-checks.py
index 06b47022b3..b8f362419e 100755
--- a/.pre-commit-hooks/custom-checks.py
+++ b/.pre-commit-hooks/custom-checks.py
@@ -11,8 +11,12 @@ Checks for:
import ast
import sys
import re
+import os
from typing import List, Tuple
+# Set environment variable for pre-commit hooks to allow unencrypted databases
+os.environ["LDR_ALLOW_UNENCRYPTED"] = "true"
+
class CustomCodeChecker(ast.NodeVisitor):
def __init__(self, filename: str):
diff --git a/src/local_deep_research/config/paths.py b/src/local_deep_research/config/paths.py
index e9a35459c5..699b57cd53 100644
--- a/src/local_deep_research/config/paths.py
+++ b/src/local_deep_research/config/paths.py
@@ -107,15 +107,13 @@ def get_database_path() -> Path:
data_dir = get_data_directory()
data_dir.mkdir(parents=True, exist_ok=True)
- # Return path to database file
+ # Raise exception instead of returning path
db_path = data_dir / "deprecated_shared.db"
- logger.warning(f"DEPRECATED: Shared database path requested: {db_path}")
- logger.warning(
+ raise DeprecationWarning(
+ f"DEPRECATED: Shared database path requested: {db_path}. "
"This function should not be used - use per-user encrypted databases instead"
)
- return db_path
-
def get_user_database_filename(username: str) -> str:
"""Get the database filename for a specific user.
diff --git a/src/local_deep_research/database/encrypted_db.py b/src/local_deep_research/database/encrypted_db.py
index 63c6994331..164f6c26f1 100644
--- a/src/local_deep_research/database/encrypted_db.py
+++ b/src/local_deep_research/database/encrypted_db.py
@@ -4,7 +4,6 @@ Handles per-user encrypted databases with browser-friendly authentication.
"""
import os
-import sys
from pathlib import Path
from typing import Any, Dict, Optional
@@ -101,16 +100,6 @@ class DatabaseManager:
os.environ.get("LDR_ALLOW_UNENCRYPTED", "").lower() == "true"
)
- # Check if we're in a pre-commit hook context
- if not allow_unencrypted and (
- "pre-commit" in sys.argv[0]
- or ".pre-commit-hooks" in sys.argv[0]
- ):
- logger.debug(
- "Running in pre-commit context, allowing unencrypted for checks"
- )
- allow_unencrypted = True
-
if not allow_unencrypted:
logger.exception(
"SECURITY ERROR: SQLCipher is not installed!\n"
diff --git a/src/local_deep_research/defaults/default_settings.json b/src/local_deep_research/defaults/default_settings.json
index 9da1a77e5f..53570457f3 100644
--- a/src/local_deep_research/defaults/default_settings.json
+++ b/src/local_deep_research/defaults/default_settings.json
@@ -4793,20 +4793,6 @@
"value": 24,
"visible": true
},
- "news.inactive.threshold_hours": {
- "category": "news",
- "description": "Hours before considering a user inactive (3 days default)",
- "editable": true,
- "max_value": 336,
- "min_value": 24,
- "name": "Inactive Threshold Hours",
- "options": null,
- "step": 24,
- "type": "APP",
- "ui_element": "number",
- "value": 72,
- "visible": true
- },
"news.progress.generating_searches": {
"category": "news",
"description": "Progress percentage when generating searches",
diff --git a/src/local_deep_research/news/core/base_card.py b/src/local_deep_research/news/core/base_card.py
index baed5ee9ea..90518b1088 100644
--- a/src/local_deep_research/news/core/base_card.py
+++ b/src/local_deep_research/news/core/base_card.py
@@ -37,42 +37,46 @@ class CardVersion:
self.version_id = generate_card_id()
+@dataclass
class BaseCard(ABC):
"""
Abstract base class for all card types.
Following LDR's pattern of base classes with common functionality.
"""
- def __init__(
- self,
- topic: str,
- source: CardSource,
- user_id: str,
- card_id: Optional[str] = None,
- ):
- """Initialize the base card with common attributes."""
- self.id = card_id or generate_card_id()
- self.topic = topic
- self.source = source
- self.user_id = user_id
+ # Required fields
+ topic: str
+ source: CardSource
+ user_id: str
+
+ # Optional fields with defaults
+ card_id: Optional[str] = None
+ parent_card_id: Optional[str] = None
+ metadata: Dict[str, Any] = field(default_factory=dict)
+
+ # Automatically generated fields
+ id: str = field(init=False)
+ created_at: datetime = field(init=False)
+ updated_at: datetime = field(init=False)
+ versions: List[CardVersion] = field(default_factory=list, init=False)
+ interaction: Dict[str, Any] = field(init=False)
+
+ # Storage and callback fields
+ storage: Optional[Any] = field(default=None, init=False)
+ progress_callback: Optional[Any] = field(default=None, init=False)
+
+ def __post_init__(self):
+ """Initialize generated fields after dataclass initialization."""
+ self.id = self.card_id or generate_card_id()
self.created_at = utc_now()
self.updated_at = utc_now()
- self.versions: List[CardVersion] = []
- self.parent_card_id: Optional[str] = None
- self.metadata: Dict[str, Any] = {}
- self.interaction: Dict[str, Any] = {
+ self.interaction = {
"votes_up": 0,
"votes_down": 0,
"views": 0,
"shares": 0,
}
- # Storage interface (initialized when needed)
- self.storage = None
-
- # For progress tracking (following LDR pattern)
- self.progress_callback = None
-
def set_progress_callback(self, callback) -> None:
"""Set a callback function to receive progress updates."""
self.progress_callback = callback
@@ -223,31 +227,34 @@ class BaseCard(ABC):
)
+@dataclass
class NewsCard(BaseCard):
"""Card representing a news item with potential for research."""
- def __init__(
- self,
- topic: str,
- source: CardSource,
- user_id: str,
- card_id: Optional[str] = None,
- **kwargs,
- ):
- super().__init__(topic, source, user_id, card_id)
- self.headline = kwargs.get("headline", topic)
- self.summary = kwargs.get("summary", "")
- self.category = kwargs.get("category", "General")
- self.impact_score = kwargs.get("impact_score", 5)
- self.entities = kwargs.get(
- "entities", {"people": [], "places": [], "organizations": []}
- )
- self.topics_extracted = kwargs.get("topics", [])
- self.is_developing = kwargs.get("is_developing", False)
- self.time_ago = kwargs.get("time_ago", "recent")
- self.source_url = kwargs.get("source_url", "")
- self.analysis = kwargs.get("analysis", "")
- self.surprising_element = kwargs.get("surprising_element")
+ # News-specific fields with defaults
+ headline: str = ""
+ summary: str = ""
+ category: str = "General"
+ impact_score: int = 5
+ entities: Dict[str, List[str]] = field(
+ default_factory=lambda: {
+ "people": [],
+ "places": [],
+ "organizations": [],
+ }
+ )
+ topics_extracted: List[str] = field(default_factory=list)
+ is_developing: bool = False
+ time_ago: str = "recent"
+ source_url: str = ""
+ analysis: str = ""
+ surprising_element: Optional[str] = None
+
+ def __post_init__(self):
+ """Initialize parent and set headline default."""
+ super().__post_init__()
+ if not self.headline:
+ self.headline = self.topic
def get_card_type(self) -> str:
"""Return the card type"""
@@ -270,20 +277,14 @@ class NewsCard(BaseCard):
return data
+@dataclass
class ResearchCard(BaseCard):
"""Card representing deeper research on a topic."""
- def __init__(
- self,
- topic: str,
- source: CardSource,
- user_id: str,
- research_depth: str = "quick",
- ):
- super().__init__(topic, source, user_id)
- self.research_depth = research_depth # "quick", "detailed", "report"
- self.key_findings = []
- self.sources_count = 0
+ # Research-specific fields
+ research_depth: str = "quick" # "quick", "detailed", "report"
+ key_findings: List[str] = field(default_factory=list)
+ sources_count: int = 0
def get_card_type(self) -> str:
"""Return the card type"""
@@ -301,16 +302,19 @@ class ResearchCard(BaseCard):
return data
+@dataclass
class UpdateCard(BaseCard):
"""Card representing updates or notifications."""
- def __init__(
- self, topic: str, source: CardSource, user_id: str, update_type: str
- ):
- super().__init__(topic, source, user_id)
- self.update_type = update_type # "new_stories", "breaking", "follow_up"
- self.count = 0
- self.preview_items = []
+ # Update-specific fields
+ update_type: str = "new_stories" # "new_stories", "breaking", "follow_up"
+ count: int = 0
+ preview_items: List[Any] = field(default_factory=list)
+ since: datetime = field(init=False)
+
+ def __post_init__(self):
+ """Initialize parent and set since timestamp."""
+ super().__post_init__()
self.since = utc_now()
def get_card_type(self) -> str:
@@ -330,20 +334,25 @@ class UpdateCard(BaseCard):
return data
+@dataclass
class OverviewCard(BaseCard):
"""Special card type for dashboard/overview display."""
- def __init__(self, source: CardSource, user_id: str):
- super().__init__("News Overview", source, user_id)
- self.stats = {
+ # Override topic default for overview cards
+ topic: str = field(default="News Overview", init=False)
+
+ # Overview-specific fields
+ stats: Dict[str, Any] = field(
+ default_factory=lambda: {
"total_new": 0,
"breaking": 0,
"relevant": 0,
"categories": {},
}
- self.summary = ""
- self.top_stories = []
- self.trend_analysis = ""
+ )
+ summary: str = ""
+ top_stories: List[Any] = field(default_factory=list)
+ trend_analysis: str = ""
def get_card_type(self) -> str:
"""Return the card type"""
diff --git a/src/local_deep_research/news/core/storage_manager.py b/src/local_deep_research/news/core/storage_manager.py
index 5daa911b64..573bc95094 100644
--- a/src/local_deep_research/news/core/storage_manager.py
+++ b/src/local_deep_research/news/core/storage_manager.py
@@ -3,6 +3,7 @@ Centralized storage manager for all news system data.
Provides unified access to cards, subscriptions, ratings, and preferences.
"""
+from enum import Enum
from typing import List, Dict, Any, Optional
from datetime import datetime, timedelta, timezone
from loguru import logger
@@ -17,6 +18,16 @@ from ..rating_system.storage import SQLRatingStorage
from ..preference_manager.storage import SQLPreferenceStorage
+class InteractionType(Enum):
+ """Enum for card interaction types."""
+
+ VIEW = "view"
+ VOTE_UP = "vote_up"
+ VOTE_DOWN = "vote_down"
+ RESEARCH = "research"
+ SHARE = "share"
+
+
class StorageManager:
"""
Unified storage interface for the news system.
@@ -198,7 +209,7 @@ class StorageManager:
self,
user_id: str,
card_id: str,
- interaction_type: str,
+ interaction_type: InteractionType,
metadata: Optional[Dict] = None,
) -> bool:
"""
@@ -220,12 +231,12 @@ class StorageManager:
return False
# Update interaction data
- if interaction_type == "view":
+ if interaction_type == InteractionType.VIEW:
card.interaction["viewed"] = True
card.interaction["last_viewed"] = datetime.now(timezone.utc)
card.interaction["views"] = card.interaction.get("views", 0) + 1
- elif interaction_type == "vote_up":
+ elif interaction_type == InteractionType.VOTE_UP:
card.interaction["voted"] = "up"
card.interaction["votes_up"] = (
card.interaction.get("votes_up", 0) + 1
@@ -240,7 +251,7 @@ class StorageManager:
}
)
- elif interaction_type == "vote_down":
+ elif interaction_type == InteractionType.VOTE_DOWN:
card.interaction["voted"] = "down"
card.interaction["votes_down"] = (
card.interaction.get("votes_down", 0) + 1
@@ -255,7 +266,7 @@ class StorageManager:
}
)
- elif interaction_type == "research":
+ elif interaction_type == InteractionType.RESEARCH:
card.interaction["researched"] = True
card.interaction["research_count"] = (
card.interaction.get("research_count", 0) + 1
diff --git a/src/local_deep_research/news/rating_system/base_rater.py b/src/local_deep_research/news/rating_system/base_rater.py
index 0dd58ec996..d5383af6be 100644
--- a/src/local_deep_research/news/rating_system/base_rater.py
+++ b/src/local_deep_research/news/rating_system/base_rater.py
@@ -4,12 +4,30 @@ Following LDR's pattern from BaseSearchStrategy.
"""
from abc import ABC, abstractmethod
+from enum import Enum
from typing import List, Dict, Any, Optional
from loguru import logger
from ..core.utils import utc_now
+class RelevanceRating(Enum):
+ """Enum for relevance rating values."""
+
+ UP = "up"
+ DOWN = "down"
+
+
+class QualityRating(Enum):
+ """Enum for quality rating values."""
+
+ ONE_STAR = 1
+ TWO_STARS = 2
+ THREE_STARS = 3
+ FOUR_STARS = 4
+ FIVE_STARS = 5
+
+
class BaseRatingSystem(ABC):
"""Abstract base class for all rating systems."""
@@ -170,14 +188,14 @@ class QualityRatingSystem(BaseRatingSystem):
self,
user_id: str,
card_id: str,
- rating_value: int,
+ rating_value: QualityRating,
metadata: Optional[Dict[str, Any]] = None,
) -> Dict[str, Any]:
"""
Rate the quality of an article.
Args:
- rating_value: Integer from 1-5 stars
+ rating_value: QualityRating enum value (ONE_STAR through FIVE_STARS)
"""
self._validate_rating_value(rating_value)
@@ -191,24 +209,23 @@ class QualityRatingSystem(BaseRatingSystem):
pass
logger.info(
- f"User {user_id} rated card {card_id} quality: {rating_value} stars"
+ f"User {user_id} rated card {card_id} quality: {rating_value.value} stars"
)
return {
"success": True,
"rating": record,
- "message": f"Quality rating of {rating_value} stars recorded",
+ "message": f"Quality rating of {rating_value.value} stars recorded",
}
def _validate_rating_value(self, rating_value: Any) -> None:
- """Validate that rating is between 1-5."""
+ """Validate that rating is a valid QualityRating enum value."""
super()._validate_rating_value(rating_value)
- if not isinstance(rating_value, int):
- raise ValueError("Quality rating must be an integer")
-
- if rating_value < 1 or rating_value > 5:
- raise ValueError("Quality rating must be between 1 and 5 stars")
+ if not isinstance(rating_value, QualityRating):
+ raise ValueError(
+ "Quality rating must be a QualityRating enum value (ONE_STAR through FIVE_STARS)"
+ )
def get_rating(
self, user_id: str, card_id: str
@@ -231,14 +248,14 @@ class RelevanceRatingSystem(BaseRatingSystem):
self,
user_id: str,
card_id: str,
- rating_value: str,
+ rating_value: RelevanceRating,
metadata: Optional[Dict[str, Any]] = None,
) -> Dict[str, Any]:
"""
Rate the relevance of an article.
Args:
- rating_value: "up" or "down"
+ rating_value: RelevanceRating.UP or RelevanceRating.DOWN
"""
self._validate_rating_value(rating_value)
@@ -252,21 +269,23 @@ class RelevanceRatingSystem(BaseRatingSystem):
pass
logger.info(
- f"User {user_id} rated card {card_id} relevance: thumbs {rating_value}"
+ f"User {user_id} rated card {card_id} relevance: thumbs {rating_value.value}"
)
return {
"success": True,
"rating": record,
- "message": f"Relevance rating of thumbs {rating_value} recorded",
+ "message": f"Relevance rating of thumbs {rating_value.value} recorded",
}
def _validate_rating_value(self, rating_value: Any) -> None:
- """Validate that rating is up or down."""
+ """Validate that rating is a valid RelevanceRating enum value."""
super()._validate_rating_value(rating_value)
- if rating_value not in ["up", "down"]:
- raise ValueError("Relevance rating must be 'up' or 'down'")
+ if not isinstance(rating_value, RelevanceRating):
+ raise ValueError(
+ "Relevance rating must be RelevanceRating.UP or RelevanceRating.DOWN"
+ )
def get_rating(
self, user_id: str, card_id: str
diff --git a/src/local_deep_research/utilities/db_utils.py b/src/local_deep_research/utilities/db_utils.py
index 80f4ae3f20..2780ba485e 100644
--- a/src/local_deep_research/utilities/db_utils.py
+++ b/src/local_deep_research/utilities/db_utils.py
@@ -7,13 +7,13 @@ from flask import g, has_app_context, session as flask_session
from loguru import logger
from sqlalchemy.orm import Session
-from ..config.paths import get_data_directory, get_database_path
+from ..config.paths import get_data_directory
from ..database.encrypted_db import db_manager
from .threading_utils import thread_specific_cache
# Database paths using new centralized configuration
DATA_DIR = get_data_directory()
-DB_PATH = get_database_path()
+# DB_PATH removed - use per-user encrypted databases instead
@thread_specific_cache(cache=LRUCache(maxsize=10))
diff --git a/src/local_deep_research/web/models/database.py b/src/local_deep_research/web/models/database.py
index 0044f418c1..3c810ba11d 100644
--- a/src/local_deep_research/web/models/database.py
+++ b/src/local_deep_research/web/models/database.py
@@ -3,7 +3,7 @@ from datetime import datetime, UTC
from loguru import logger
-from ...config.paths import get_data_directory, get_database_path
+from ...config.paths import get_data_directory
from ...database.models import ResearchLog
from ...database.session_context import get_user_db_session
@@ -13,9 +13,7 @@ if DATA_DIR:
DATA_DIR = str(DATA_DIR)
os.makedirs(DATA_DIR, exist_ok=True)
-DB_PATH = get_database_path()
-if DB_PATH:
- DB_PATH = str(DB_PATH)
+# DB_PATH removed - use per-user encrypted databases instead
def get_db_connection():
diff --git a/src/local_deep_research/web/templates/pages/history.html b/src/local_deep_research/web/templates/pages/history.html
index b9cb6fded3..af979d90ba 100644
--- a/src/local_deep_research/web/templates/pages/history.html
+++ b/src/local_deep_research/web/templates/pages/history.html
@@ -7,7 +7,7 @@
{% block styles %}
{{ super() }}
<link rel="stylesheet" href="{{ url_for('research.serve_static', path='css/components/history.css') }}">
-<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
+<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
{% endblock %}
{% block content %}
@@ -50,5 +50,5 @@
<!-- Then load the component -->
<script src="{{ url_for('research.serve_static', path='js/components/history.js') }}"></script>
<!-- Add Bootstrap JavaScript -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
+<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
{% endblock %}
diff --git a/src/local_deep_research/web/templates/pages/news-subscription-form.html b/src/local_deep_research/web/templates/pages/news-subscription-form.html
index 42719a632a..1dfd756fc8 100644
--- a/src/local_deep_research/web/templates/pages/news-subscription-form.html
+++ b/src/local_deep_research/web/templates/pages/news-subscription-form.html
@@ -4,8 +4,8 @@
{% block title %}{{ 'Edit' if subscription else 'Create' }} News Subscription - LDR{% endblock %}
{% block extra_head %}
-<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.7.2/font/bootstrap-icons.min.css">
+<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" integrity="sha384-EvBWSlnoFgZlXJvpzS+MAUEjvN7+gcCwH+qh7GRFOGgZO0PuwOFro7qPOJnLfe7l" crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('research.serve_static', path='css/custom_dropdown.css') }}">
<link rel="stylesheet" href="{{ url_for('research.serve_static', path='css/news.css') }}">
<style>
@@ -241,7 +241,7 @@
</form>
</div>
-<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
+<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<script src="{{ url_for('research.serve_static', path='js/components/custom_dropdown.js') }}"></script>
<script>
// Global variables
diff --git a/src/local_deep_research/web/templates/pages/news.html b/src/local_deep_research/web/templates/pages/news.html
index e24af19c4c..c10766b222 100644
--- a/src/local_deep_research/web/templates/pages/news.html
+++ b/src/local_deep_research/web/templates/pages/news.html
@@ -4,8 +4,8 @@
{% block title %}LDR News - AI-Powered Research Feed{% endblock %}
{% block extra_head %}
-<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.7.2/font/bootstrap-icons.min.css">
+<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" integrity="sha384-EvBWSlnoFgZlXJvpzS+MAUEjvN7+gcCwH+qh7GRFOGgZO0PuwOFro7qPOJnLfe7l" crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('research.serve_static', path='css/custom_dropdown.css') }}">
<link rel="stylesheet" href="{{ url_for('research.serve_static', path='css/news.css') }}">
<link rel="stylesheet" href="{{ url_for('research.serve_static', path='css/news-enhanced.css') }}">
@@ -395,7 +395,7 @@
</div>
<!-- Add marked.js for markdown rendering -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/4.0.2/marked.min.js"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/4.0.2/marked.min.js" integrity="sha384-pF+2qz7eFoUyrCTPr8gVboYJ7fNpmJKJzl0vPX6w3XDML+Of8bMSyd6fZIRJdwo7" crossorigin="anonymous"></script>
<!-- Add UI services for markdown rendering -->
<script src="{{ url_for('research.serve_static', path='js/services/ui.js') }}"></script>
@@ -410,7 +410,7 @@
<script src="{{ url_for('research.serve_static', path='js/components/subscription-manager.js') }}"></script>
<!-- Add Bootstrap JavaScript -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
+<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<!-- Add design enhancements -->
<script src="{{ url_for('research.serve_static', path='js/news-enhancements.js') }}"></script>
diff --git a/src/local_deep_research/web/templates/pages/news_cleaned.html b/src/local_deep_research/web/templates/pages/news_cleaned.html
index 91ab139cec..75674b7575 100644
--- a/src/local_deep_research/web/templates/pages/news_cleaned.html
+++ b/src/local_deep_research/web/templates/pages/news_cleaned.html
@@ -3,8 +3,8 @@
{% block title %}LDR News - AI-Powered Research Feed{% endblock %}
{% block extra_head %}
-<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.7.2/font/bootstrap-icons.min.css">
+<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" integrity="sha384-EvBWSlnoFgZlXJvpzS+MAUEjvN7+gcCwH+qh7GRFOGgZO0PuwOFro7qPOJnLfe7l" crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('research.serve_static', path='css/news.css') }}">
{% endblock %}
@@ -211,7 +211,7 @@
</div>
<!-- Add marked.js for markdown rendering -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/4.0.2/marked.min.js"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/4.0.2/marked.min.js" integrity="sha384-pF+2qz7eFoUyrCTPr8gVboYJ7fNpmJKJzl0vPX6w3XDML+Of8bMSyd6fZIRJdwo7" crossorigin="anonymous"></script>
<!-- Add UI services for markdown rendering -->
<script src="{{ url_for('research.serve_static', path='js/services/ui.js') }}"></script>
@@ -220,5 +220,5 @@
<script src="{{ url_for('research.serve_static', path='js/pages/news.js') }}"></script>
<!-- Add Bootstrap JavaScript -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
+<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
{% endblock %}
diff --git a/src/local_deep_research/web/templates/pages/subscriptions.html b/src/local_deep_research/web/templates/pages/subscriptions.html
index c6af0107ed..1a518fc6d7 100644
--- a/src/local_deep_research/web/templates/pages/subscriptions.html
+++ b/src/local_deep_research/web/templates/pages/subscriptions.html
@@ -4,8 +4,8 @@
{% block title %}Manage News Subscriptions - LDR{% endblock %}
{% block extra_head %}
-<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.7.2/font/bootstrap-icons.min.css">
+<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" integrity="sha384-EvBWSlnoFgZlXJvpzS+MAUEjvN7+gcCwH+qh7GRFOGgZO0PuwOFro7qPOJnLfe7l" crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('research.serve_static', path='css/subscriptions.css') }}">
<style>
/* Override Bootstrap defaults to ensure dark theme */
@@ -167,6 +167,6 @@
{% endblock %}
{% block page_scripts %}
-<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
+<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<script src="{{ url_for('research.serve_static', path='js/pages/subscriptions.js') }}"></script>
{% endblock %}