Files
g0v0-server/app/tasks/update_client_version.py
MingxuanGame 8923d714a7 feat(client-verification): add client verification (#104)
New configurations:

- `CHECK_CLIENT_VERSION` enables the check (default=True)
- `CLIENT_VERSION_URLS` contains a chain of valid client hashes. [osu!](https://osu.ppy.sh/home/download) and [osu! GU](https://github.com/GooGuTeam/osu/releases) are valid by default. View [g0v0-client-versions](https://github.com/GooGuTeam/g0v0-client-versions) to learn how to support your own client.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-11 16:30:25 +08:00

14 lines
594 B
Python

from app.config import settings
from app.dependencies.scheduler import get_scheduler
from app.log import logger
from app.service.client_verification_service import get_client_verification_service
if settings.check_client_version:
@get_scheduler().scheduled_job("interval", id="update_client_version", hours=2)
async def update_client_version():
logger.info("Updating client version lists...")
client_verification_service = get_client_verification_service()
await client_verification_service.refresh()
await client_verification_service.load_from_disk()