changelog
This commit is contained in:
+61
-2
@@ -1,6 +1,65 @@
|
|||||||
# Changelog - TestPostsBot V2
|
# Changelog - TestPostsBot
|
||||||
|
|
||||||
## Overview
|
## Version 2.1.0 - Update Checker System
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
#### 1. Update Checker System
|
||||||
|
- Bot now periodically checks for new versions from a centralized update server
|
||||||
|
- Automatically sends modmail notifications to subreddit modteam when updates are available
|
||||||
|
- Includes changelog URL in notification for easy reference
|
||||||
|
- 24-hour cooldown prevents spam (max 1 notification per day)
|
||||||
|
- Runs as a background daemon thread alongside main bot operations
|
||||||
|
- Tracks last update notification timestamp to file for persistence across restarts
|
||||||
|
|
||||||
|
#### 2. Version Management
|
||||||
|
- Bot version is now centralized at the top of `bot.py` in a dedicated section
|
||||||
|
- `BOT_VERSION` and `BOT_NAME` constants used throughout the bot
|
||||||
|
- Easy single-location reference for version updates
|
||||||
|
- Version automatically included in update checker calls and user agent string
|
||||||
|
|
||||||
|
#### 3. Infrastructure
|
||||||
|
- Created separate `update_server/` project for version management service
|
||||||
|
- Flask-based REST API serving version information via `/api/version/<bot_name>`
|
||||||
|
- `versions.json` file stores version details for all bots
|
||||||
|
- Docker support with Dockerfile for containerized deployment
|
||||||
|
- Includes comprehensive README with deployment options
|
||||||
|
|
||||||
|
### New Files
|
||||||
|
- **update_checker.py** - Background module that checks for and notifies about updates
|
||||||
|
|
||||||
|
### Modified Files
|
||||||
|
|
||||||
|
#### bot.py
|
||||||
|
- Added version constants section at top for easy reference
|
||||||
|
- Added import for `update_checker` module
|
||||||
|
- Added `start_update_checker()` call in `main()` function
|
||||||
|
- User agent now uses version constants: `{BOT_NAME}/{BOT_VERSION}`
|
||||||
|
|
||||||
|
#### requirements.txt
|
||||||
|
- Added `requests` library for HTTP requests to update server
|
||||||
|
|
||||||
|
#### docker-compose.yml
|
||||||
|
|
||||||
|
- Volume mounts for persistent `versions.json` and log files
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
Update checker timing is configurable in `update_checker.py`:
|
||||||
|
- `UPDATE_CHECK_INTERVAL = 60` seconds (check frequency)
|
||||||
|
- `UPDATE_COOLDOWN = 86400` seconds (24 hours between notifications)
|
||||||
|
|
||||||
|
### How It Works
|
||||||
|
1. On startup, bot creates background thread running update checker
|
||||||
|
2. Every hour, thread polls `https://updts.slfhstd.uk/api/version/TestPostsBot`
|
||||||
|
3. If version differs from current `BOT_VERSION`, and 24 hours have passed since last notification, sends modmail
|
||||||
|
4. Modmail includes current version, available version, and changelog URL
|
||||||
|
5. Last notification timestamp stored in `DB/.last_update_check.txt`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Version 2.0.0 - Trigger-Based Redesign
|
||||||
|
|
||||||
|
### Overview
|
||||||
Complete refactor of TestPostsBot to be a continuously running, trigger-based posting bot that responds to moderator commands via chat messages.
|
Complete refactor of TestPostsBot to be a continuously running, trigger-based posting bot that responds to moderator commands via chat messages.
|
||||||
|
|
||||||
## Major Features Added
|
## Major Features Added
|
||||||
|
|||||||
Reference in New Issue
Block a user