Commit Graph

1593 Commits

Author SHA1 Message Date
ryan 0099ce7cb4 Merge branch 'main' into cordis 2026-09-17 21:43:50 +08:00
ryan c6ae84de81 refactor(layout): adopt wavelet manifest layout for configs and docker while preserving docker-compose 2026-09-03 10:46:51 +08:00
ryan 953a224245 refactor(arch): decouple private imports, enforce contracts and comply with cordis architecture 2026-09-03 10:40:02 +08:00
ryan dbcf485d8a Merge remote-tracking branch 'wavelet/main' 2026-09-03 10:27:18 +08:00
ryan 14d9bddf46 feat(contracts): implement driver.Valuer and sql.Scanner on UploadMetadataDTO 2026-09-03 10:27:08 +08:00
ryan 630803d5a3 merge: sync upstream wavelet/main (clean contracts DTOs and configs) 2026-09-03 10:25:52 +08:00
ryan 99fff5d5af fix(contracts): decouple DTOs from ORM tags and table name mappings 2026-09-03 10:17:11 +08:00
ryan 807343c82c feat(config): load manifest config.default.yaml with config.yaml override and clean root configs 2026-09-03 10:13:57 +08:00
ryan 25c3249ce2 Merge branch 'wavelet/main' into main 2026-09-03 10:08:50 +08:00
ryan 967c3e4209 feat(contracts): add TableName and gorm serializer tags to DTOs 2026-09-03 10:08:11 +08:00
ryan 52daf8129d Merge remote-tracking branch 'wavelet/main' 2026-09-03 09:56:59 +08:00
ryan 1d4bfea63b feat(contracts): add UploadMetadataDTO to contracts.UploadDTO 2026-09-03 09:56:54 +08:00
ryan 911a42fa10 Merge remote-tracking branch 'wavelet/main' 2026-09-03 09:42:15 +08:00
ryan c88c1c7b4e feat(contracts): provide SystemConfigService, UploadService and TaskService.GetExecutionByTaskID 2026-09-03 09:42:12 +08:00
ryan ed57e44e3c ci(arch): include openflare in cordis architecture checks 2026-09-03 09:32:43 +08:00
ryan b183e80565 merge(wavelet): sync upstream changes 2026-09-03 09:29:28 +08:00
ryan a190bd6a13 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	AGENTS.md
#	backend/docs/docs.go
#	backend/docs/swagger.json
#	backend/docs/swagger.yaml
#	frontend/components/providers/title-updater.tsx
#	frontend/messages/fragments/admin.en.json
#	frontend/messages/fragments/admin.zh-CN.json
#	frontend/proxy.ts
2026-09-03 09:16:22 +08:00
ryan 4407589b62 refactor(auth): modularize auth plugin with physical subpackages and decoupled services 2026-09-03 09:12:44 +08:00
ryan 2124bce7ca fix(core): optimize ioc interface caching, event parallel timeout and router teardown reversibility 2026-09-03 09:09:33 +08:00
ryan 30ab8810cc refactor(auth): merge cap domain plugin into auth 2026-09-03 08:58:34 +08:00
ryan 6b28adfacf refactor(admin): decouple system cleanup with event bus and enforce single owner principle 2026-09-03 08:50:37 +08:00
ryan 1e19d8114a refactor(msg_gateway): decouple bot gateway and push notification architecture
- Split shared monolithic consts into bot, push, and errs with typed sentinel errors
- Restructure model layer into distinct bot and push subdomains
- Refactor DAO layer to enforce single-owner principle and remove cross-table raw SQL queries
- Decompose 1150+ line service/push.go into push_channel, push_event, push_trigger, push_worker, and push_template
- Clean up controller layer with generic request handlers and parameter validation in controller/base.go
- Streamline plugin.go to core Cordis lifecycle orchestration and remove re-export bloat
- Verify all unit tests, race tests, Cordis architecture rules, and Swagger generation pass cleanly
2026-09-02 23:21:36 +08:00
ryan 8395dd5019 refactor(msg_gateway): restructure and rename message_gateway aligned with custom_example 2026-09-02 22:50:40 +08:00
ryan 87e3bfd0e6 chore: doc 2026-09-02 22:41:06 +08:00
ryan fff3a7589c docs(plugin): unify plugin development template based on custom_example 2026-09-02 22:39:13 +08:00
ryan 6388c28b91 chore: template 2026-09-02 22:34:19 +08:00
ryan 7df31befb5 feat(message_gateway): integrate nikoksr/notify engine and support multi-channel push 2026-09-02 22:30:59 +08:00
ryan 90f3efdd50 ci(arch): forbid pkg packages from depending on project core packages 2026-09-02 22:22:04 +08:00
ryan 9632604958 feat(auth): implement decoupled sliding-window rate limiting for login and oauth 2026-09-02 22:15:21 +08:00
ryan 39f02b5d7a refactor(message_gateway): upgrade notification template engine with text/template and rich helpers 2026-09-02 22:04:48 +08:00
ryan cf0cba0679 refactor(mail): modernize smtp sending with go-mail and unify message gateway pusher 2026-09-02 21:59:47 +08:00
ryan 88ed98b013 chore: remove accidental test upload
fix(user): backfill snowflake id on login for legacy zero user
2026-09-02 21:47:12 +08:00
ryan 40c2212dd3 fix(upload): apply login middleware to /f/:id route
/f/:id had no LoginRequired middleware, so AuthUserObjKey was never
populated and GetCurrentUser/GetUserIDFromContext could not authenticate
even logged-in users, returning 401 未登录 on private files. Add loginMW.
2026-09-02 20:32:33 +08:00
ryan df6aa9ff4d fix(auth): encode snowflake user ids as strings in session and /user-info
Registered users get snowflake ids above JS MAX_SAFE_INTEGER.
/user-info emitted them as JSON numbers and login stored uint64 in
the session. Both now use decimal strings. Tests cover admin vs
non-admin cookie access to /user/self, /user-info, and /upload/my.
2026-09-02 20:22:22 +08:00
ryan c27da41b64 fix(auth): forward session cookies through the Next API proxy
Login Set-Cookie was dropped by Next rewrites, so non-admin sessions
never stuck and every later API looked unauthenticated. Proxy JSON
APIs in proxy.ts, copy Set-Cookie, send 401 to login and 403 to /403.
2026-09-02 18:49:42 +08:00
ryan 353a5f9f75 fix(user): assign snowflake IDs on registration
The HTTP register path left ID at 0, so SQLite/GORM filled a
serial primary key. CreateUser now generates a snowflake ID when
none is set, matching admin create and OAuth signup.
2026-09-02 18:41:37 +08:00
ryan 05606dfb56 feat(frontend): add a dedicated 403 forbidden page
Show /403 instead of toasting or staying on the denied screen when
the API returns 403 or a non-admin opens an admin route.
2026-09-02 18:39:11 +08:00
ryan b7e5e811d1 fix(auth): register CAP scope, 400 on captcha, 403 for permission
Navigating from login reused a send_email_code token on register.
Captcha failure used 401 so the client stored /register as the
post-login target and never left the page. Permission denials now
return 403, and the API client no longer wipes the session on 401.
2026-09-02 18:26:22 +08:00
ryan df7ad453cc fix(tasks): canonicalize triggered_by so execution labels resolve
Unknown values such as http and inproc_cron made the admin UI call
t(undefined). Dispatch sites now write system/manual/retry/schedule,
the list API maps legacy rows, and the table skips missing i18n keys.
2026-09-02 18:04:32 +08:00
ryan 1f1f4efec7 fix(admin): stop console Intl errors and log websocket drops
Use raw i18n for push template hints so ICU does not parse
{{placeholders}}. Pass total into the user list record count.
Allow log websocket origins behind the Next rewrite, skip the
proxy on Upgrade, and do not open a socket after unmount.
2026-09-02 17:52:57 +08:00
ryan 8aa0753b12 fix(logs): flush small access-log batches within two seconds
Default MinBatchSize of 50 left quiet admin traffic in memory
forever because MaxFlushWait was unset. Force a timed flush so
the logs page can show recent authenticated requests.
2026-09-02 17:40:43 +08:00
ryan bec1352ef7 fix(logs): collect access logs regardless of plugin order
Global Router.Use middleware is applied at HTTP Start instead of
being snapshotted when each route is registered, so risk_control
still wraps admin APIs that mount earlier. Access-log collection
is enabled by default on SQLite/Postgres, not only ClickHouse.
2026-09-02 17:39:40 +08:00
ryan ef88811ccb fix(frontend): call versioned CAP challenge and redeem APIs
Point the PoW solver at /api/v1/cap/{challenge,redeem} so login
verification hits the routes registered by the cap plugin.
2026-09-02 17:31:06 +08:00
ryan 455e2f8be5 fix(config): serve public settings and enforce login CAP
Public config now comes from admin as a flat visibility=1 map instead of
a cross-plugin query that compared an integer column to "visible". Login
and register resolve CaptchaService per request so CAP is not skipped
when user applies before cap.
2026-09-02 17:07:07 +08:00
ryan 4f50f6a8f9 feat(core): bind request services and implement registered tasks
Wire plugin services through Bind/InjectFrom and AppContext so HTTP and
workers resolve dependencies after Apply. Register TaskHandler objects
with persisted results, and implement send_email_code, mail:send,
cleanup_inactive_users, and dispatch_bot_msg.
2026-09-02 16:59:00 +08:00
ryan 30bbe965bf fix(task): execute dispatched jobs and persist run records
Asynq func handlers now go through ProcessTask so admin execution
rows leave pending. The in-process worker resolves admin type
identifiers and writes the same w_task_executions table. Remove
the no-op admin system_cleanup that shadowed the upload handler.
2026-09-02 16:11:45 +08:00
ryan 33f28ad671 fix: sql 2026-09-02 15:37:06 +08:00
ryan 18339ee3d4 fix: pg sql 2026-08-31 15:48:28 +08:00
ryan f975c4f7cc merge(cordis): abort helpers and gold upgrade fixture
Bring Wavelet AbortNotFoundIfMissing/AbortBadRequestOnError, switch OpenFlare handlers to them, and pin the golden upgrade test to v3.5.4 via git archive.
2026-08-30 18:03:04 +08:00
ryan c22ca408d4 merge: merge branch 'feat/cordis-router-raw-routes' into main 2026-08-30 17:57:38 +08:00