From bd506752ece74b0336edbcad62ccad6a93c666af Mon Sep 17 00:00:00 2001 From: Harwinder Sekhon Date: Tue, 21 Jul 2026 12:32:28 -0400 Subject: [PATCH] Add config.json.example template; gitignore config.json Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01VPNF37MP9Kuv62B1VBrZ1b --- .gitignore | 1 + config.json.example | 24 +++++++++++++++++++ .../2026-07-21-centralized-config-design.md | 6 ++--- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 config.json.example diff --git a/.gitignore b/.gitignore index 21c7d28..2d96ab4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Secrets .env .env.local +config.json # Editor / tooling .claude/ diff --git a/config.json.example b/config.json.example new file mode 100644 index 0000000..11fdbf4 --- /dev/null +++ b/config.json.example @@ -0,0 +1,24 @@ +{ + "telegram": { + "token": "123456789:REPLACE_WITH_YOUR_BOT_TOKEN", + "chat_id": "REPLACE_WITH_OWNER_CHAT_ID", + "channel_id": "-100REPLACE_WITH_CHANNEL_ID_OR_EMPTY_STRING", + "alert_min_quality": "C" + }, + "data_providers": { + "active": "twelve_data", + "twelve_data": { + "api_key": "REPLACE_WITH_YOUR_TWELVE_DATA_API_KEY" + } + }, + "scanning": { + "pairs": ["XAU/USD"], + "timeframes": ["M5", "M15", "H1", "H4"] + }, + "pairs": { + "XAU/USD": { + "blocked_hours_utc": [0, 1, 2, 10, 11, 13, 16, 21] + } + }, + "log_level": "INFO" +} diff --git a/docs/superpowers/specs/2026-07-21-centralized-config-design.md b/docs/superpowers/specs/2026-07-21-centralized-config-design.md index f6d0f33..9ffdf03 100644 --- a/docs/superpowers/specs/2026-07-21-centralized-config-design.md +++ b/docs/superpowers/specs/2026-07-21-centralized-config-design.md @@ -18,7 +18,7 @@ test-enforced (see Testing). ## Scoping decisions (user-confirmed 2026-07-21) 1. **Secrets live in config.json** (gitignored). A committed - `config.example.json` carries placeholders. Env vars still override. + `config.json.example` carries placeholders. Env vars still override. The hardcoded credential fallbacks in `config.py` and `telegram_bot.py` are **deleted** — on a machine with neither config.json nor env vars, the bot refuses to start with an explicit error instead of silently using @@ -39,7 +39,7 @@ test-enforced (see Testing). ## File schema -`config.json` (gitignored; `config.example.json` committed with placeholders +`config.json` (gitignored; `config.json.example` committed with placeholders for secrets and today's tuned values for everything else): ```json @@ -128,7 +128,7 @@ block + one adapter class registered here. No shared base class extracted now - Create the local `config.json` populated with the **current live values** (the ones being deleted from source) so the running bot keeps working unchanged. `.gitignore` gains `config.json`. -- Commit `config.example.json` with placeholders. +- Commit `config.json.example` with placeholders. - CLAUDE.md: update the env-var table, repository map, and config section. - Post-merge recommendation (user action): rotate the Telegram token and Twelve Data key, since both are in git history.