Change default token expire hour

This commit is contained in:
yangdx
2025-04-04 21:26:55 +08:00
parent 95630aa669
commit 27d478385d
2 changed files with 4 additions and 4 deletions

View File

@@ -166,8 +166,8 @@ REDIS_URI=redis://localhost:6379
### For JWT Auth ### For JWT Auth
# AUTH_ACCOUNTS='admin:admin123,user1:pass456' # AUTH_ACCOUNTS='admin:admin123,user1:pass456'
# TOKEN_SECRET=Your-Key-For-LightRAG-API-Server # TOKEN_SECRET=Your-Key-For-LightRAG-API-Server
# TOKEN_EXPIRE_HOURS=4 # TOKEN_EXPIRE_HOURS=48
# GUEST_TOKEN_EXPIRE_HOURS=2 # GUEST_TOKEN_EXPIRE_HOURS=24
# JWT_ALGORITHM=HS256 # JWT_ALGORITHM=HS256
### API-Key to access LightRAG Server API ### API-Key to access LightRAG Server API

View File

@@ -311,8 +311,8 @@ def parse_args() -> argparse.Namespace:
# For JWT Auth # For JWT Auth
args.auth_accounts = get_env_value("AUTH_ACCOUNTS", "") args.auth_accounts = get_env_value("AUTH_ACCOUNTS", "")
args.token_secret = get_env_value("TOKEN_SECRET", "lightrag-jwt-default-secret") args.token_secret = get_env_value("TOKEN_SECRET", "lightrag-jwt-default-secret")
args.token_expire_hours = get_env_value("TOKEN_EXPIRE_HOURS", 4, int) args.token_expire_hours = get_env_value("TOKEN_EXPIRE_HOURS", 48, int)
args.guest_token_expire_hours = get_env_value("GUEST_TOKEN_EXPIRE_HOURS", 2, int) args.guest_token_expire_hours = get_env_value("GUEST_TOKEN_EXPIRE_HOURS", 24, int)
args.jwt_algorithm = get_env_value("JWT_ALGORITHM", "HS256") args.jwt_algorithm = get_env_value("JWT_ALGORITHM", "HS256")
ollama_server_infos.LIGHTRAG_MODEL = args.simulated_model_name ollama_server_infos.LIGHTRAG_MODEL = args.simulated_model_name