Add config.json.example template; gitignore config.json
Claude-Session: https://claude.ai/code/session_01VPNF37MP9Kuv62B1VBrZ1b
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# Secrets
|
||||
.env
|
||||
.env.local
|
||||
config.json
|
||||
|
||||
# Editor / tooling
|
||||
.claude/
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user