Fix linting

This commit is contained in:
yangdx
2025-03-24 05:39:50 +08:00
parent 071302d10f
commit 77ab26e5bf
4 changed files with 15 additions and 15 deletions

View File

@@ -13,9 +13,6 @@
# SSL_CERTFILE=/path/to/cert.pem
# SSL_KEYFILE=/path/to/key.pem
### Security (empty for no api-key is needed)
# LIGHTRAG_API_KEY=your-secure-api-key-here
### Directory Configuration
# WORKING_DIR=<absolute_path_for_working_dir>
# INPUT_DIR=<absolute_path_for_doc_input_dir>
@@ -158,4 +155,7 @@ AUTH_USERNAME=admin # login name
AUTH_PASSWORD=admin123 # password
TOKEN_SECRET=your-key-for-LightRAG-API-Server # JWT key
TOKEN_EXPIRE_HOURS=4 # expire duration
WHITELIST_PATHS=/login,/health # white list
### API-Key to access LightRAG Server API
# LIGHTRAG_API_KEY=your-secure-api-key-here
# WHITELIST_PATHS=/health,/api/*

View File

@@ -41,7 +41,6 @@ from lightrag.kg.shared_storage import (
get_namespace_data,
get_pipeline_status_lock,
initialize_pipeline_status,
get_all_update_flags_status,
)
from fastapi.security import OAuth2PasswordRequestForm
from .auth import auth_handler

View File

@@ -798,7 +798,10 @@ def create_document_routes(
HTTPException: If an error occurs while retrieving pipeline status (500)
"""
try:
from lightrag.kg.shared_storage import get_namespace_data, get_all_update_flags_status
from lightrag.kg.shared_storage import (
get_namespace_data,
get_all_update_flags_status,
)
pipeline_status = await get_namespace_data("pipeline_status")

View File

@@ -35,9 +35,7 @@ for path in whitelist_paths:
prefix = path[:-2]
whitelist_patterns.append((prefix, True)) # (prefix, is_prefix_match)
else:
whitelist_patterns.append(
(path, False)
) # (exact_path, is_prefix_match)
whitelist_patterns.append((path, False)) # (exact_path, is_prefix_match)
# Global authentication configuration
auth_username = os.getenv("AUTH_USERNAME")