Commit Graph

124 Commits

Author SHA1 Message Date
MingxuanGame
5c2687e1e4 feat(cache): add user cache invalidation for avatar, cover, and beatmapset updates 2025-11-08 18:14:51 +00:00
MingxuanGame
0be3e903d4 feat(performance-point): switch performance calculator to performance-server (#80)
* feat(config): make `performance_server` as default calculator

* deploy(docker): use osu-performance-server

* docs(readme): add ruleset download instructions

* chore(dev): update development environment

* feat(dev): update development environment setup and service startup order

* fix(deps): move `rosu-pp-py` to `project.optional-dependencies`

* feat(beatmap): handle deleted beatmaps

* feat(performance-server): add a long timeout for calculation

* feat(recalculate): enhance CLI arguments for performance, leaderboard, and rating recalculations with CSV output support

* fix(recalculate): resolve reviews

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix(beatmapsync): resolve too long line

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-09 01:59:09 +08:00
咕谷酱
73d25c7604 Add Cloudflare Turnstile verification to auth flows
Introduces Cloudflare Turnstile verification for registration, OAuth password grant, and password reset endpoints (excluding osu! client). Adds related configuration options and a new service for token validation. Also refactors password change logic to support TOTP or password-based verification, improving security for users with TOTP enabled.
2025-10-12 02:39:46 +08:00
咕谷酱
301130df02 Refactor SMTP config usage in EmailQueue
Move SMTP configuration retrieval from class initialization to method scope in send_email_by_smtp. This improves encapsulation and ensures the latest settings are used when sending emails.
2025-10-12 00:47:18 +08:00
咕谷酱
6731373ded Add MailerSend and template-based email verification
Introduced support for MailerSend as an email provider alongside SMTP, with configuration options in settings. Added Jinja2-based multi-language email templates for verification emails, and refactored the email sending logic to use these templates and support language selection based on user country code. Updated related services and API endpoints to pass country code and handle new response formats. Added dependencies for Jinja2 and MailerSend.
2025-10-12 00:36:47 +08:00
MingxuanGame
1d1221a740 fix(beatmapset): invalidate beatmapset and beatmap lookup caches after updates 2025-10-07 18:09:09 +00:00
MingxuanGame
b4e164faad fix(beatmapset): load beatmapset from database 2025-10-07 17:55:35 +00:00
MingxuanGame
c0575f3274 fix(beatmapset): handle 404 errors and fix qualified sync from add_missing_beatmapsets 2025-10-07 17:40:50 +00:00
MingxuanGame
c76d6163ac fix(sync): cannot qualified beatmapset 2025-10-07 17:05:33 +00:00
MingxuanGame
64e221c641 perf(beatmapset): optimize beatmap fetching 2025-10-07 15:27:06 +00:00
MingxuanGame
1db34bf5c5 feat(sync): add configuration to control syncing & support sync immediately by API 2025-10-05 03:44:46 +00:00
MingxuanGame
6f48dd4575 fix(sync): handle 404 errors for missing beatmaps and beatmapsets 2025-10-04 08:58:05 +00:00
MingxuanGame
ca7c74f709 refactor(project): remove useless getattr 2025-10-04 06:43:55 +00:00
MingxuanGame
c2bfafc67a refactor(message): replace synchronous Redis client with asynchronous client 2025-10-04 05:26:37 +00:00
MingxuanGame
7c18fc5fb6 refactor(userpage): move APIs into g0v0 private API 2025-10-04 04:57:24 +00:00
MingxuanGame
dfd656f2fb style(project): remove from __future__ import annotations 2025-10-03 17:15:41 +00:00
MingxuanGame
046f894407 refactor(assets_proxy): use decorators to simplify code 2025-10-03 17:12:28 +00:00
MingxuanGame
d490239f46 chore(linter): update ruff rules 2025-10-03 15:46:53 +00:00
MingxuanGame
b10425ad91 refactor(service): remove unused services 2025-10-03 13:40:18 +00:00
MingxuanGame
0d9019c6cc refactor(signalr): remove SignalR server & msgpack_lazer_api
Maybe we can make `msgpack_lazer_api` independent?
2025-10-03 13:20:12 +00:00
MingxuanGame
d23f32f08d refactor(log): refactor the whole project
format: {time:YYYY-MM-DD HH:mm:ss} [{level}] | {name} | {message}
{name} is:
- Uvicorn: log from uvicorn server (#228B22)
- Service: log from class of `app.service` (blue)
- Fetcher: log from fetchers (magenta)
- Task: log from `app.tasks` (#FFD700)
- System: log from `system_logger` (red)
- Normal: log from `log(name)` (#FFC1C1)
- Default: the module name of caller

if you are writing services or tasks, you can just call `logger.`, we will pack it with name `Service` or `Task`
if you want to print fetcher logs, system-related logs, or normal logs, use `logger = (fetcher_logger / system_logger / log)(name)`
2025-10-03 11:53:05 +00:00
MingxuanGame
fce88272b5 refactor(task): move schedulers and startup/shutdown task into tasks directory 2025-10-03 10:15:22 +00:00
MingxuanGame
afd5018bcd refactor(log): add prefix for fetcher and services 2025-10-03 08:22:41 +00:00
MingxuanGame
37b4eadf79 refactor(database): rename filename to find the models by table name easily 2025-10-03 03:33:47 +00:00
MingxuanGame
40670c094b feat(auth): support trusted device (#52)
New API to maintain sessions and devices:

- GET /api/private/admin/sessions
- DELETE /api/private/admin/sessions/{session_id}
- GET /api/private/admin/trusted-devices
- DELETE /api/private/admin/trusted-devices/{device_id}

Auth:

web clients request `/oauth/token` and `/api/v2/session/verify` with `X-UUID` header to save the client as trusted device.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-03 11:26:43 +08:00
MingxuanGame
9a77c8d246 feat(beatmapset): use https://catboy.best as global downloading service 2025-10-02 14:50:36 +00:00
MingxuanGame
e57702073f fix(sync): some logs have no color 2025-10-02 14:38:26 +00:00
MingxuanGame
bb1c09f4fd feat(beatmapset): sort based on time 2025-10-02 09:28:04 +00:00
MingxuanGame
7deb328b09 feat(beatmapset): enhance jitter calculation for too-long next sync time 2025-10-02 09:26:28 +00:00
MingxuanGame
5ff6708781 feat(beatmapset): add error handling for missing beatmapset additions 2025-10-02 08:07:05 +00:00
MingxuanGame
6252e04253 feat(beatmapset): add mechanism to prevent duplicate missing beatmapset additions 2025-10-02 07:37:33 +00:00
MingxuanGame
3f6776847e feat(beatmap,score): update beatmaps from Bancho & deleting scores (#50)
New API:

- DELETE /api/private/score/{score_id}: delete a score
- POST /api/private/beatmapsets/{beatmapset_id}/sync: request for syncing a beatmapset

New configuration:

- OLD_SCORE_PROCESSING_MODE
2025-10-02 13:36:09 +08:00
MingxuanGame
017b058e63 chore(linter): make linter happy 2025-09-30 07:57:08 +00:00
咕谷酱
4017f2af73 fix:修复音频代理缓存报错 2025-09-29 21:22:06 +08:00
咕谷酱
3a434ee02c 修复部分报错 2025-09-24 03:04:09 +08:00
咕谷酱
86c7bbb74e 优化验证 2025-09-24 02:08:13 +08:00
咕谷酱
953f33be4f fix ranking total 0 2025-09-24 00:29:32 +08:00
咕谷酱
99d6af1c1f 修复邮件验证部分问题 2025-09-23 22:13:15 +08:00
咕谷酱
7d6eeae073 添加音频代理 2025-09-23 03:32:30 +08:00
咕谷酱
884a4cad2c 添加音频代理 2025-09-23 03:28:13 +08:00
咕谷酱
bb06643de8 fix error 2025-09-23 01:56:50 +08:00
咕谷酱
edbf01daa1 添加谱面查询缓存 2025-09-23 01:34:43 +08:00
MingxuanGame
1527e23b43 feat(session-verify): 添加 TOTP 支持 (#34)
* chore(deps): add pyotp

* feat(auth): implement TOTP verification

feat(auth): implement TOTP verification and email verification services

- Added TOTP keys management with a new database model `TotpKeys`.
- Introduced `EmailVerification` and `LoginSession` models for email verification.
- Created `verification_service` to handle email verification logic and TOTP processes.
- Updated user response models to include session verification methods.
- Implemented routes for TOTP creation, verification, and fallback to email verification.
- Enhanced login session management to support new location checks and verification methods.
- Added migration script to create `totp_keys` table in the database.

* feat(config): update config example

* docs(totp): complete creating TOTP flow

* refactor(totp): resolve review

* feat(api): forbid unverified request

* fix(totp): trace session by token id to avoid other sessions are forbidden

* chore(linter): make pyright happy

* fix(totp): only mark sessions with a specified token id
2025-09-21 19:50:11 +08:00
MingxuanGame
ad78663ba0 chore(linter): make ruff happy 2025-09-20 10:41:15 +00:00
咕谷酱
b834799a2d 优化ip库获取逻辑 2025-09-19 17:03:45 +08:00
咕谷酱
08ff35509e 修复代理问题,添加头像接口 2025-09-19 17:02:24 +08:00
pre-commit-ci[bot]
6330e9b6e1 chore(linter): auto fix by pre-commit hooks 2025-09-17 17:39:21 +00:00
咕谷酱
0913625836 Update bbcode_service.py 2025-09-16 00:44:38 +08:00
咕谷酱
0b43f2aad8 支持个人介绍编辑 2025-09-16 00:33:46 +08:00
MingxuanGame
98f5a1d184 fix(user-cache): fix wrong score cache model for legacy format 2025-09-14 08:19:20 +00:00