Skip to content

v0.5.3

Choose a tag to compare

@orenlab orenlab released this 21 Oct 12:47
0b68827

Summary

Security and reliability patch release 0.5.3 for the supported 0.5 stable line. All 0.5.2 users should upgrade.

Security

  • No passwords in container and image details. Passwords given as short options or inside shell scripts (for example mysqld -p…, curl -u user:…, redis-cli -a …, sh -c '…') are masked, as are healthcheck output and container errors. Full command arguments and image build steps are shown only to admins in a private chat with the bot; everyone else sees just the program name.
  • 2FA stays private. The QR code and 2FA codes are handled only in a private chat with the bot. In a group, the bot replies with an Open private chat link; after confirming there, the action can be repeated in the group.
  • A 2FA code can't be reused after a restart. Codes issued before the restart are refused, so you may need to wait for the next code (up to a minute).
  • Webhook behind a reverse proxy: a forged X-Forwarded-For entry no longer passes as Telegram. Overly wide Telegram ranges and 0.0.0.0/0 trusted proxies are rejected.
  • Fewer image scanner findings: the Ubuntu base image's unused pebble binary, which bundled an outdated Go runtime, is no longer in the image.

Reliability

  • The Docker healthcheck reflects the bot's real state. It used to report "healthy" no matter what; now a stuck or stopped bot shows up as unhealthy.
  • Read-only containers work without extra settings. If the default state folder can't be written and PYTMBOT_STATE_DIR isn't set, the bot keeps its small runtime files (health snapshot, 2FA replay protection, webhook bans) in a private /dev/shm/pytmbot-<uid> folder (not with ipc: host).
  • The bot recovers from network problems at start-up instead of silently stopping, and exits with an error code when it stops because of a failure, so restart: on-failure restarts it.
  • Stop and Restart honour the configured grace period: new optional docker.stop_timeout and docker.restart_timeout (1–300 s, 10 s by default).
  • Server screens say whether a number is for the whole host or only for the bot's container.

Upgrade notes

  • Docker: pull orenlab/pytmbot:0.5.3, or 0.5 / stable once the release workflow has finished, and recreate the container.
  • Config version: set config_version: "0.5.3" to match the running app version. 0.5.2 configs still load, and auto-migration handles the mismatch on startup.
  • Groups: admins who use the bot in groups confirm 2FA via the private-chat link.
  • State directory: if you set PYTMBOT_STATE_DIR, it must be writable; the healthcheck depends on it.
  • End of life: 0.5.2 is end-of-life as of this release.

Full Changelog: v0.5.2...v0.5.3