3 Commits

Author SHA1 Message Date
zenfun
a7571dd4ad feat(server): integrate ip ban cron and refine updates
- Initialize and schedule IP ban maintenance tasks in server entry point
- Perform initial IP ban sync to Redis on startup
- Implement optional JSON unmarshalling to handle null `expires_at` in API
- Add CIDR overlap validation when updating rule status to active
2026-01-04 01:44:45 +08:00
zenfun
830c6fa6e7 feat(cron): implement IP ban maintenance tasks
Add IPBanManager to handle periodic background jobs including:
- Expiring outdated bans
- Syncing hit counts from Redis to DB
- Performing full Redis state synchronization

Additionally, update the service expiration logic to use system time
and add unit tests for CIDR normalization and overlap checking.
2026-01-04 01:28:43 +08:00
zenfun
2359603666 feat(service): implement IP ban service logic
Add IPBanService to manage global IP bans with Redis synchronization
for high-performance filtering. Includes logic for CIDR normalization,
overlap detection, hit count tracking, and rule expiration.
2026-01-04 00:59:03 +08:00