refactor: move credentials to .env and add python-dotenv support
Replace hardcoded database credentials, ntfy tokens, and Uptime Kuma push URLs with environment variable lookups via python-dotenv. Add .env.example template and update .gitignore to exclude .env. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
# config/database.py
|
||||
# 统一的数据库配置
|
||||
|
||||
import os
|
||||
|
||||
# ================= SQL Server 配置 =================
|
||||
SQL_SERVER_CONFIG = {
|
||||
'driver': 'ODBC Driver 18 for SQL Server',
|
||||
'server': '192.168.110.114',
|
||||
'database': 'CompanyDB',
|
||||
'username': 'peng',
|
||||
'password': 'Cqbld123456.',
|
||||
'driver': os.environ.get('DB_DRIVER', 'ODBC Driver 18 for SQL Server'),
|
||||
'server': os.environ.get('DB_SERVER', ''),
|
||||
'database': os.environ.get('DB_DATABASE', ''),
|
||||
'username': os.environ.get('DB_USERNAME', ''),
|
||||
'password': os.environ.get('DB_PASSWORD', ''),
|
||||
'TrustServerCertificate': 'yes'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user