From 89d70effe1a19cec8d9c3515ed30915c2cb6443c Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Wed, 9 Jul 2025 08:21:28 +0800 Subject: [PATCH] fix: ignore extra envs in env file Signed-off-by: Frost Ming --- config.py | 2 +- setup.sh | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config.py b/config.py index 89607ad..d67ee8d 100644 --- a/config.py +++ b/config.py @@ -5,7 +5,7 @@ from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): - model_config = SettingsConfigDict(env_file=".env") + model_config = SettingsConfigDict(env_file=".env", extra="ignore") telegram_bot_token: str timezone: str = "Asia/Shanghai" diff --git a/setup.sh b/setup.sh index 09bdc60..b786690 100644 --- a/setup.sh +++ b/setup.sh @@ -1,7 +1,7 @@ #!/bin/bash python_bin_path="$(which python3)" -venv_dir="venv" +venv_dir=".venv" project_path="$(pwd)" service_name="tgbotyh" @@ -88,12 +88,12 @@ function installPythonVirtualEnv(){ echo echo "Project path: $project_path" echo "Python bin path: $python_bin_path" - echo "Google_Gemini_API_Key: $Google_Gemini_API_Key" - echo "Telegram Bot Token: $Telegram_Bot_Token" - echo "Anthropic API Key: $Anthropic_API_Key" - echo "Openai API Key: $Openai_API_Key" - echo "Yi API Key: $Yi_API_Key" - echo "Yi Base Url: $Yi_Base_Url" + echo "Google_Gemini_API_Key: $google_gemini_api_key" + echo "Telegram Bot Token: $telegram_bot_token" + echo "Anthropic API Key: $anthropic_api_key" + echo "Openai API Key: $openai_api_key" + echo "Yi API Key: $yi_api_key" + echo "Yi Base Url: $yi_base_url" echo "==============================" echo