285 Commits

Author SHA1 Message Date
yangdx
4d57370c94 Refactor: Move get_env_value from api.config to utils
Relocates the `get_env_value` utility function
from `lightrag.api.config` to `lightrag.utils` to decouple
LightRAG core from API Server
2025-05-10 08:58:18 +08:00
yangdx
c8ecfa2d68 feat: Centralize configuration and update defaults
This commit introduces `lightrag/constants.py` to centralize default values for various configurations across the API and core components.

Key changes:
- Added `constants.py` to centralize default values
- Improved the `get_env_value` function in `api/config.py` to correctly handle string "None" as a None value and to catch `TypeError` during value conversion.
- Updated the default `SUMMARY_LANGUAGE` to "English"
- Set default `WORKERS` to 2
2025-05-06 22:00:43 +08:00
yangdx
e7063b5f1e Remove embedding_cache_config 2025-04-22 00:28:17 +08:00
yangdx
37007244c2 Add ENABLE_LLM_CACHE env support 2025-04-09 12:42:17 +08:00
yangdx
8675e4dc6f Remove api tag from swagger 2025-04-09 11:52:11 +08:00
yangdx
299c508f27 Fix webtitle display problem 2025-04-05 02:24:23 +08:00
yangdx
d5da79892f Add webui title to api server 2025-04-04 21:43:52 +08:00
yangdx
caac0479d3 Fix linting 2025-04-04 21:34:13 +08:00
yangdx
95630aa669 Centralize env reading 2025-04-04 21:06:21 +08:00
yangdx
bd2c528dba Merge branch 'optimize-config-management' into clear-doc 2025-04-04 19:46:45 +08:00
Milin
4dbd5e3899 Merge branch 'main' into optimize-config-management
# Conflicts:
#	env.example
#	lightrag/api/utils_api.py
2025-03-31 11:29:29 +08:00
Milin
088fc19318 feat(config): Refactor configuration management
- Optimize JWT Auth module to load configuration via `global_args`.
- Decouple configuration-related code from `utils_api.py`, and add a new `config.py` file for unified configuration management.
- Adjust configuration import in `lightrag_server.py`, `auth.py`, and `document_routes.py` to be introduced through `global_args`.
2025-03-31 11:19:47 +08:00
yangdx
6a51f38cae Remove namespace_prefix from PostgreSQL, maintain consistency with other storage implementation 2025-03-31 02:59:44 +08:00
yangdx
c590d5878c refactor: standardize .env loading behavior across modules
- Use .env from current folder for each lightrag instance
- Allow different .env files for different instances
- Make OS env vars take precedence over .env file
2025-03-29 03:37:23 +08:00
yangdx
affc313a88 Fix linting 2025-03-27 13:26:18 +08:00
yangdx
987cb585e7 fix: auth_mode error in health check end point
- Change AUTH_USERNAME/PASSWORD to AUTH_ACCOUNTS format
- Update docs for new auth configuration
2025-03-27 13:24:14 +08:00
yangdx
d83ae39541 feat: add .env file check on startup
- Show warning if .env is missing
- For CLI startup: prompt for user confirmation
- For service startup: display warning only
2025-03-26 21:08:24 +08:00
yangdx
46f5c5b47f Fix linting 2025-03-26 17:30:06 +08:00
yangdx
1030068459 feat(health-check): add pipeline busy status to health endpoint 2025-03-26 12:41:49 +08:00
Saifeddine ALOUI
2333958a6b upgraded to use current folder's .env if present 2025-03-25 13:45:51 +01:00
Milin
23004546dc Merge branch 'main' 2025-03-25 15:57:14 +08:00
Milin
4dfdb9032c feat(auth): Implement multi-user login support
- Add an `accounts` dictionary in `AuthHandler` to store multiple user account information.
- Modify login logic to support multiple user account verification.
- Update environment variable example, add description for `AUTH_ACCOUNTS` variable.
- Adjust authentication status check logic, use `auth_handler.accounts` to determine if authentication is configured.
2025-03-24 14:34:31 +08:00
yangdx
d05cf286f4 Fix linting 2025-03-24 14:30:17 +08:00
yangdx
9e3994419e Refactor authentication logic and Swagger UI config
- Consolidate authentication dependencies
- Improve Swagger UI security parameters
2025-03-24 14:29:36 +08:00
yangdx
77ab26e5bf Fix linting 2025-03-24 05:39:50 +08:00
yangdx
071302d10f Moved update status logic to document routes.
- Removed update status from health check endpoint
- Added update_status field to PipelineStatusResponse
2025-03-24 05:37:03 +08:00
yangdx
90ef55960d Refactor authentication and whitelist handling
- Combined auth and API key dependencies
- Optimized whitelist path matching
- Added optional API key to OllamaAPI
2025-03-24 05:23:40 +08:00
yangdx
8301f0a523 Move temperature parameter into kwargs for LLM calls
- Applied changes to both OpenAI and Azure OpenAI calls
2025-03-24 03:03:55 +08:00
yangdx
7e8a2c0e9b Added temperature parameter for LLM 2025-03-24 02:02:34 +08:00
yangdx
a444edd9eb Added auth mode status to health check endpoint.
- Introduced auth_mode in health check response
- Updated App.tsx to handle guest mode logic
2025-03-23 02:43:44 +08:00
yangdx
ba07ec86a5 Fix linting 2025-03-23 00:30:18 +08:00
yangdx
31c7923067 Added core and API version to health check
- Bumped API version to 1.2.2
2025-03-23 00:28:50 +08:00
yangdx
0df0ba269d Implemented version display in SiteHeader of webui
- Updated API version to 1.2.0
- Stored versions in localStorage
2025-03-22 01:51:39 +08:00
yangdx
67eee2d2d5 Prioritize OS environment variables over .env file to improve Docker compatibility for the server 2025-03-21 13:27:12 +08:00
yangdx
5536ed50ca Fix linting 2025-03-18 16:18:37 +08:00
yangdx
d80ca4dc07 Added root redirect to /webui and updated webui config 2025-03-18 15:38:41 +08:00
yangdx
43996656d3 Fix linting 2025-03-18 03:30:43 +08:00
yangdx
f8440c8f80 feat(auth): implement auto guest mode and enhance token system
- Add role-based token system with metadata support
- Implement automatic guest mode for unconfigured authentication
- Create new /auth-status endpoint for authentication status checking
- Modify frontend to auto-detect auth status and bypass login when appropriate
- Add guest mode indicator in site header for better UX

This change allows users to automatically access the system without manual
login when authentication is not configured, while maintaining secure
authentication when credentials are properly set up.
2025-03-18 02:56:02 +08:00
choizhang
b58729751a Merge branch 'improve-property-tooltip' into loginPage 2025-03-15 00:11:50 +08:00
yangdx
6893e3c4e2 Unify two log filters into one and move it to utils 2025-03-13 17:39:06 +08:00
yangdx
002d675dc6 Explicitly set API docs and schema URLs.
- Set OpenAPI schema URL to `/openapi.json`
- Set docs URL to `/docs`
- Set redoc URL to `/redoc`
- Update Vite config for API docs routing
- Ensure proper path handling for docs endpoints
2025-03-13 13:00:14 +08:00
yangdx
330f608fa9 Fix linting 2025-03-12 18:55:15 +08:00
yangdx
5c1cf6a8ff Prevent caching problem of HTML files for web UI
- Add NoCacheStaticFiles class
- Set Cache-Control headers for HTML files
2025-03-12 18:54:35 +08:00
choizhang
6b22e8065b Added loginPage 2025-03-11 14:48:19 +08:00
yangdx
5d64f3b0a0 Improved auto-scan task initialization and status tracking.
- Added autoscan status tracking in pipeline
- Ensured auto-scan runs only once per startup
2025-03-10 17:14:14 +08:00
yangdx
bc42afe7b6 Unify llm_response_cache and hashing_kv, prevent creating an independent hashing_kv. 2025-03-09 22:15:26 +08:00
yangdx
020a6b5ae0 Refactor LLM cache config to use argparse and add status display 2025-03-09 16:45:57 +08:00
yangdx
c2f861fba9 Settign LLM cache option for entity extraction from env 2025-03-07 15:03:33 +08:00
Milin
c015296081 refactor(api): Fix issues reported by pre-commit
- Modified code layout and formatting in multiple files, improving code readability.
  - Updated import statements, removing unused libraries.
  - Simplified the writing of some functions and exception handling.
2025-03-06 14:23:52 +08:00
Milin
59e3b2eec1 refactor(api): Code optimization based on review comments.
- Removed authentication dependency for the health check endpoint in lightrag_server.py
- Removed the authentication dependency for the entire router in ollama_api.py
- Updated the parameter list and example usage in README.md, removing authentication-related parts
- Removed neo4j and tqdm dependencies from requirements.txt
- Deleted command-line argument parsing code related to authentication from utils_api.py
2025-03-05 20:38:05 +08:00