feat(email): add SMTP security modes (starttls/ssl/none) with sensible default ports; add /notify_test endpoint; support ALWAYS_NOTIFY_ON_STARTUP to force first-run notification

chore(docker): run enhanced_crawler.py as entrypoint

ops(compose): load env via env_file and remove hardcoded secrets

docs: update README and .env.template for SMTP and startup notification
This commit is contained in:
2025-09-03 21:32:50 +08:00
parent 852f206d2e
commit 099f156e6f
5 changed files with 107 additions and 37 deletions

View File

@@ -6,24 +6,10 @@ services:
build: .
container_name: barrons-crawler
restart: unless-stopped
environment:
# 爬蟲設定
- CHECK_INTERVAL=300 # 5分鐘
- LOG_LEVEL=INFO
# 電子郵件設定(可選)
- EMAIL_SMTP_SERVER=smtp.gmail.com
- EMAIL_SMTP_PORT=587
- EMAIL_FROM=your_email@gmail.com
- EMAIL_TO=notification@gmail.com
- EMAIL_USERNAME=your_email@gmail.com
- EMAIL_PASSWORD=your_app_password
# Webhook 設定(可選)
- WEBHOOK_URL=https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK
# Discord 設定(可選)
- DISCORD_WEBHOOK=https://discord.com/api/webhooks/YOUR/DISCORD/WEBHOOK
# 將同目錄的 .env 檔注入容器環境變數
env_file:
- .env
# 所有環境變數由 .env 提供
volumes:
- ./data:/app/data # 資料持久化
@@ -47,4 +33,4 @@ services:
command: redis-server --appendonly yes
volumes:
redis_data:
redis_data: