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>
14 lines
594 B
Python
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()
|