11 Commits

Author SHA1 Message Date
Thigazhezhilan J
ae3a335ea1 Harden server restart: remove import-time crashes, centralise secret validation
- auth_service.py: RESET_OTP_SECRET no longer crashes at import; read lazily
  inside _hash_otp() so the module always loads cleanly
- main.py: _validate_runtime_secrets() now checks both BROKER_TOKEN_KEY and
  RESET_OTP_SECRET together, reporting all missing vars in one clear message
- .env.example: documents every required/optional env var with generation commands

With load_dotenv() + .env file, all secrets survive pm2 restarts automatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 12:58:22 +05:30
Thigazhezhilan J
0a7e038be9 Load .env file at startup and validate BROKER_TOKEN_KEY format
Adds python-dotenv so secrets survive pm2 restarts without relying on
PM2 env vars. Validates the Fernet key format at startup so a bad/missing
key fails immediately with a clear message rather than crashing mid-request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 12:49:33 +05:30
Thigazhezhilan J
6027dd3c6f Make auto-login optional at startup so backend always boots 2026-05-02 15:38:36 +05:30
Thigazhezhilan J
e1759b14fa Fix CORS to allow quantfortune.com alongside app.quantfortune.com 2026-05-02 15:23:24 +05:30
Thigazhezhilan J
94f175668a Add automated daily Zerodha token refresh (auto-login)
- New auto_login_service.py: stores encrypted credentials (login ID,
  password, TOTP secret), performs headless Zerodha login via pyotp,
  and refreshes the session daily at 6:05 AM IST via background thread
- New auto_login router: setup, status, remove, and manual trigger endpoints
- Scheduler started at app boot alongside existing daemons
- Added pyotp==2.9.0 dependency

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 12:47:21 +05:30
root
78aa2bf201 Made Changes from server by mohan 2026-04-10 00:06:30 +00:00
Thigazhezhilan J
9c171ba799 Fix broker reconciliation, health readiness, and live equity safety 2026-04-09 23:46:13 +05:30
Thigazhezhilan J
519addd78f Harden backend auth, execution safety, and market session logic 2026-04-08 22:02:24 +05:30
Thigazhezhilan J
9770b7a338 Add live equity snapshots and improve broker handling 2026-03-25 23:33:09 +05:30
root
f4b7575f00 Added CORS Origin 2026-02-21 10:33:37 +00:00
thigazhezhilan
53be845b6e Backend full repo clean 2026-02-01 13:57:30 +00:00