migrate to Pydantic v2 and optimize Caddyfile
This commit is contained in:
parent
84b8c22942
commit
e4407392bb
@ -57,8 +57,6 @@
|
|||||||
handle /api/* {
|
handle /api/* {
|
||||||
reverse_proxy localhost:{$BACKEND_PORT:9001} {
|
reverse_proxy localhost:{$BACKEND_PORT:9001} {
|
||||||
header_up X-Real-IP {remote_host}
|
header_up X-Real-IP {remote_host}
|
||||||
header_up X-Forwarded-For {remote_host}
|
|
||||||
header_up X-Forwarded-Proto {scheme}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,8 +64,6 @@
|
|||||||
handle /jingrow* {
|
handle /jingrow* {
|
||||||
reverse_proxy localhost:{$BACKEND_PORT:9001} {
|
reverse_proxy localhost:{$BACKEND_PORT:9001} {
|
||||||
header_up X-Real-IP {remote_host}
|
header_up X-Real-IP {remote_host}
|
||||||
header_up X-Forwarded-For {remote_host}
|
|
||||||
header_up X-Forwarded-Proto {scheme}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
from pydantic_settings import BaseSettings
|
from pydantic_settings import BaseSettings
|
||||||
|
from pydantic import ConfigDict
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
from jingrow.utils.path import get_root_path
|
from jingrow.utils.path import get_root_path
|
||||||
|
|
||||||
@ -16,17 +17,17 @@ class Settings(BaseSettings):
|
|||||||
jingrow_cloud_api_url: str = 'https://api.jingrow.com'
|
jingrow_cloud_api_url: str = 'https://api.jingrow.com'
|
||||||
jingrow_cloud_api_key: str = ''
|
jingrow_cloud_api_key: str = ''
|
||||||
jingrow_cloud_api_secret: str = ''
|
jingrow_cloud_api_secret: str = ''
|
||||||
|
|
||||||
# 本地后端主机配置
|
# 本地后端主机配置
|
||||||
backend_host: str = '0.0.0.0'
|
backend_host: str = '0.0.0.0'
|
||||||
backend_port: int = 9001
|
backend_port: int = 9001
|
||||||
backend_reload: bool = True
|
backend_reload: bool = True
|
||||||
|
|
||||||
# Dramatiq 任务队列
|
# Dramatiq 任务队列
|
||||||
worker_processes: int = 1
|
worker_processes: int = 1
|
||||||
worker_threads: int = 1
|
worker_threads: int = 1
|
||||||
watch: bool = True
|
watch: bool = True
|
||||||
|
|
||||||
# Qdrant 向量数据库配置
|
# Qdrant 向量数据库配置
|
||||||
qdrant_host: str = ''
|
qdrant_host: str = ''
|
||||||
qdrant_port: int = 6333
|
qdrant_port: int = 6333
|
||||||
@ -47,11 +48,12 @@ class Settings(BaseSettings):
|
|||||||
# 日志级别:DEBUG/INFO/WARNING/ERROR/CRITICAL(全局默认级别)
|
# 日志级别:DEBUG/INFO/WARNING/ERROR/CRITICAL(全局默认级别)
|
||||||
log_level: str = 'INFO'
|
log_level: str = 'INFO'
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
class Config:
|
env_file=str(get_root_path() / '.env'),
|
||||||
env_file = str(get_root_path() / '.env')
|
env_file_encoding='utf-8',
|
||||||
env_file_encoding = 'utf-8'
|
case_sensitive=False,
|
||||||
case_sensitive = False
|
extra='ignore'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@lru_cache()
|
@lru_cache()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user