Commit Graph

7 Commits

Author SHA1 Message Date
wassname 15fa661b7a security: require pre-configured allowedUserId, remove auto-pair
The first-DM auto-pair behavior combined with ! shell passthrough meant
the first account to DM the bot gained arbitrary shell access. This
removes that footgun entirely.

- allowedUserId must be set before polling starts; missing config blocks
  polling with a TUI warning rather than silently accepting any sender
- TELEGRAM_ALLOWED_USER_ID env var is read on session start and
  overwrites the saved config value, so rotating the allowed user is a
  restart away
- /telegram-setup now prompts for a numeric user ID after the bot token
  if one is not already configured
- Denied senders receive an auth error reply; their numeric ID is also
  logged to the pi TUI as a warning so operators can identify themselves
  on a fresh install without needing @userinfobot
- Dropped the {kind: "pair"} authorization state entirely; undefined
  allowedUserId now produces deny, not pair
- Removed pairTelegramUserIfNeeded, shouldPair, shouldNotifyPaired

Existing installs with allowedUserId already in telegram.json are
unaffected. Fresh installs require explicit configuration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 06:04:56 +08:00
wassname c28436503f slash 2026-04-21 18:09:09 +08:00
wassname 5da34c33a2 skip [telegram] prefix for ! commands so pi handles them natively as shell
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 21:38:51 +08:00
wassname c2d25b31fe wip 2026-04-19 16:08:23 +08:00
wassname 5aa37b7a99 tool verbose 2026-04-19 15:41:15 +08:00
LLB e7e3e86550 0.2.7: priority symbol 2026-04-17 14:33:55 +04:00
LLB 8dcf761937 0.2.0: refactor into domain modules 2026-04-11 11:32:44 +04:00