- Created a Dockerfile to build and deploy the application using a multi-stage build process.
- Added a GitHub Actions workflow to automatically build and publish the Docker image to GitHub Container Registry on pushes to the main branch.
- Updated go.mod and go.sum to reflect dependency upgrades and changes.
- Modified the RSS generator to extend the photo expiration time from 10 minutes to 12 hours.
- Updated rate limiter configuration to allow for environment variable customization.
- Load and validate BASE_URL, store in Config
- RSSGenerator now receives Config; adds <enclosure> for photo messages using BaseURL
- RateLimiter tracks feed and image limiters; provide FeedRateLimit and ImageRateLimit middleware
- Update routes to use the new middlewares and inject Config into RSSGenerator
- Stop ticker and signal goroutine exit in RegisterCleanup OnStop hook
- Call cancel() explicitly after AuthStatus instead of defer to prevent premature context cancellation
- Use consistent logger parameter in OnStop hook
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Implement per-client rate limiting (5 requests per 3 seconds)
- Change /channel/:id routes to /feed/:id for consistency
- Add data/ to .gitignore
- Include RateLimit middleware on GET /feed/:id endpoint
- Add proper XML headers, content type, and marshaling for RSS
- Conditionally expose auth endpoints based on Telegram auth state
- Add device model to Telegram client config
- Improve logging and caching behavior in auth service
- Add caching for AuthStatus to eliminate redundant Telegram API calls
- Create centralized timeout constants for consistent configuration
- Update handlers and telegram provider to use shared timeout values
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Introduced NewAuthHandler and integrated it into the server routes.
- Added limit query parameter with default value handling in GetLatestMessages.
- Improved error handling for invalid limit values.
- Refactored Config struct to remove unnecessary fields and clean up loading logic.
- Updated Telegram client connection handling to enhance stability.
- Added configuration loading from environment variables with default session path handling.
- Implemented a logger using Uber's zap library.
- Created a basic HTTP server with Gin and CORS support.
- Established Telegram client and service for message retrieval.
- Introduced initial API routes and handlers.
- Added necessary dependencies in go.sum.