20 Commits

Author SHA1 Message Date
Ganonmaster b7365ef1e9 v0.3.0
Release / Build and push Docker image (push) Successful in 14m9s
Release / Build Linux release binary (push) Successful in 15m47s
v0.3.0
2026-04-28 11:46:00 +02:00
Ganonmaster 2c219f5565 Fix S3 collision, alias clearing, upload limit, TOCTOU; add tests
Bug fixes:
- S3 key is now emoji/{uuid}.{ext} instead of emoji/{filename},
  preventing silent overwrites when two emotes share a filename
- UpdateEmoteRequest.alias uses Option<Option<String>> with a custom
  deserializer so a JSON null clears the alias rather than being ignored;
  the manage UI now sends null when the alias field is emptied
- POST /emotes is limited to 8 MiB via DefaultBodyLimit
- update_emote replaced the fetch-then-update pair with a single
  UPDATE … RETURNING using COALESCE/CASE WHEN, eliminating the TOCTOU
  race between concurrent edits

Refactoring:
- Extracted src/lib.rs so domain logic is a library crate; src/main.rs
  is now a thin startup entry point
- auth::check decoupled from AppState — takes Option<&AuthConfig> directly
- Removed unused config field from Database struct

Tests (40 total):
- auth: 10 unit tests covering all check() branches
- models: 6 unit tests for timestamp parsing and alias deserialization
- db: 9 unit tests against in-memory SQLite covering full CRUD
- routes: 15 integration tests in tests/routes.rs covering auth
  middleware, input validation, and all mutating endpoints
2026-04-28 11:31:25 +02:00
Ganonmaster 08fd6cea70 Add HTTP Basic Auth
All write endpoints and the manage
routes are gated behind HTTP Basic Auth middleware; credentials are
configured via [auth] in config.toml or APP__AUTH__USERNAME /
APP__AUTH__PASSWORD environment variables.
2026-04-28 03:23:57 +02:00
Ganonmaster c13f5b9a88 Add emote management UI at /manage
Adds a server-side HTML management page and supporting backend for
full CRUD on emotes. The /manage prefix is kept isolated so an auth
middleware can be applied to it later without touching other routes.

- GET /manage — serves the management UI (add, edit, delete, search)
- GET /manage/emotes — admin JSON endpoint with uuid and alias included
- AdminEmoteResponse model for the expanded admin representation
- Client-side search filters by name or alias as you type
2026-04-28 03:14:54 +02:00
Ganonmaster 6a86cc8cce Release v0.2.4 2026-04-11 22:53:33 +02:00
Ganonmaster 6df3ab1db1 Release v0.2.3 2026-04-11 22:03:08 +02:00
Ganonmaster 80cbc66878 Update gitea workflow 2026-04-11 21:33:59 +02:00
Ganonmaster b4a887603e Update Registry token. 2026-04-09 17:39:44 +02:00
Ganonmaster e27587a990 Remove old github workflows 2026-04-09 17:33:42 +02:00
Ganonmaster 92f834a52b Merge branch 'main' of git.open3dlab.com:Open3DLab/mikebase 2026-04-09 17:31:18 +02:00
Ganonmaster 9f9ada8150 Add docker build, rewrite Actions for Gitea, and add healthcheck endpoint. 2026-04-09 17:26:35 +02:00
Ganonmaster f5cb4b31eb Merge pull request #2 from Open3DLab/copilot/add-emotes-display-and-healthcheck
Add emotes display page, health endpoint, Dockerfile, and Docker CI
2026-04-07 02:41:03 +02:00
Ganonmaster 85498a357f Spice up HTML page styling with accent colors, drop shadow, and glow effects 2026-04-07 00:40:02 +00:00
Ganonmaster 2d4ad79857 Add error handling to emotes fetch call 2026-04-07 00:25:09 +00:00
Ganonmaster 5d9fc26011 Add emotes HTML page at /, health endpoint, Dockerfile, and Docker workflow 2026-04-07 00:21:42 +00:00
Ganonmaster 55f42ac1f3 Merge pull request #1 from Open3DLab/copilot/create-emote-database-api
feat: Rust emote database and REST API (axum + sqlx + S3)
2026-03-18 14:55:10 +01:00
Ganonmaster abc6cf1ecd Add /version endpoint and GitHub Actions release workflow 2026-03-18 13:42:40 +00:00
Ganonmaster 33acab96a2 Implement Rust-based emote database and REST API 2026-03-18 13:18:40 +00:00
Ganonmaster 4642587f5c Initial plan 2026-03-18 12:54:45 +00:00
Ganonmaster 0a36aeb434 Initial commit 2026-03-18 13:54:42 +01:00