7d9c4b9e0f
refactor: simplify TraceLayer setup and reformat route definitions
2026-06-09 15:58:18 +08:00
035d11e39b
fix: log warning when WebP env vars are clamped
2026-06-09 15:53:39 +08:00
db3379364f
fix: limit WebP decode buffer size to prevent malicious allocations
2026-06-09 15:48:34 +08:00
7c6bab8019
fix: preserve f32 precision for WebP quality
2026-06-09 15:43:16 +08:00
2e2be7b16d
feat: add WebP encoding support with zenwebp
...
- Replace image crate's WebP with zenwebp for better quality/speed
- Add webp.rs module with configurable quality and method
- Update .env.example with WEBP_QUALITY and WEBP_METHOD
- Add WebP decode support in image serving pipeline
- Add detailed timing logs for WebP conversion
2026-06-09 15:30:06 +08:00
5ecd8a9b86
feat: add disk-level cache for processed image variants
2026-06-09 13:45:49 +08:00
0319c927c6
chore: format code
2026-06-09 13:43:10 +08:00
b26094835f
feat: convert uploaded images to WebP for storage savings
2026-06-09 13:39:36 +08:00
281da208f5
fix: remove stray space in upload filename format string
2026-06-09 13:37:11 +08:00
44c1358da5
refactor: extract post content JS into standalone script
2026-06-09 13:18:40 +08:00
0345fa70f2
fix: add click handler for code block copy button
2026-06-09 11:33:26 +08:00
42b39266a6
fix: preserve data URI in img src during markdown rendering
...
ammonia's default url_schemes whitelist excludes 'data', causing
data:image/* URLs to be stripped from img src attributes. Add 'data'
to allowed schemes. Also skip data: URIs in JS thumbnail logic.
2026-06-09 10:06:34 +08:00
3974856f3d
fix: resolve image/upload 500 errors and refactor rate limiting
...
- Separate /uploads and /api/upload routes from Dioxus app to avoid
IncrementalRenderer intercepting non-page requests
- Remove broken SmartIpKeyExtractor-based general_limit() that failed
under Dioxus dev server proxy (Unable To Extract Key)
- Move rate limiting into handlers using governor::RateLimiter directly
- Add IMAGE_LIMITER for /uploads/* serving
- Make all rate limits configurable via environment variables
- Add rate limit config to .env.example with sensible defaults
2026-06-09 09:48:51 +08:00
4f368e6fb8
test: add 122 unit tests across 12 modules
...
Cover utils/text, api/slug, auth/password, auth/session,
models/post, models/user, api/auth validation, api/markdown,
api/image, highlight, api/rate_limit. Add make test target.
2026-06-09 09:25:44 +08:00
959d813630
feat: pg_trgm full-text search for posts ( #2 )
...
* feat(db): add pg_trgm search index on posts
* feat(api): use pg_trgm similarity search for posts
* fix(api): use ILIKE + word_similarity instead of % operator for search
2026-06-08 18:26:35 +08:00
e74b9f3c39
feat: apply rate limiting to Register, Login, and upload endpoints
...
- Remove unused tags.rs and related re-exports
- Convert strict_limit/upload_limit from Layer to manual check functions
- Add IP-based rate limiting checks to Register, Login, and upload_image
- Keep general_limit as global middleware for all other routes
2026-06-08 17:30:26 +08:00
db33d02154
feat: apply rate limiting middleware to axum router
2026-06-08 16:59:26 +08:00
76f1b8dd53
feat: add rate limiting configurations
2026-06-08 16:57:48 +08:00
771b155a88
refactor: split posts.rs and fix N+1 with JOIN+array_agg
2026-06-08 16:53:31 +08:00
32131377c3
refactor: integrate tags module into posts.rs and mod.rs
2026-06-08 16:45:20 +08:00
441060e7c2
refactor: extract tag operations into api/tags.rs
2026-06-08 16:44:38 +08:00
6e4e72b232
refactor: extract markdown rendering into api/markdown.rs
2026-06-08 16:42:55 +08:00
4c88d5e2bb
refactor: extract slug utilities into api/slug.rs
2026-06-08 16:40:44 +08:00
185bcab9f9
cleanup(forms): remove unused BUTTON_SECONDARY_CLASS
2026-06-08 16:19:35 +08:00
e5d37aa034
refactor(api): extract error helper functions, DRY up db/query/tx error handling
2026-06-08 16:17:03 +08:00
717266db1e
fix: resolve conditional compilation and dead code warnings
2026-06-08 16:11:24 +08:00
b6f41e74e7
feat: image thumbnail + lightbox viewer
...
- Add ImageViewer reusable component with thumbnail and click-to-zoom
- PostCover: load ?w=1200 thumbnail, click to view full-size
- PostCard: display cover thumbnail (?thumb=400x300) in list view
- PostContent: inline images load ?w=800 thumbnail, click to zoom
- Add lightbox overlay styles with fade-in animation
- Add zoom cursor and hover effect for zoomable images
- Extend web-sys features for DOM image/lightbox manipulation
2026-06-08 15:52:47 +08:00
2c08c6c7fd
fix(image): case-insensitive format matching in process_image
2026-06-08 15:29:17 +08:00
8b1b949bf8
refactor: apply formatting to image.rs
2026-06-08 15:13:18 +08:00
d584ef6e00
fix(image): improve cache keys, case-insensitive format, strict thumb validation
2026-06-08 15:13:18 +08:00
7963103f62
feat: wire up image processing route replacing ServeDir
2026-06-08 15:13:18 +08:00
1f009f57c8
feat: add image processing handler with resize/thumbnail/rotate/format
2026-06-08 15:13:18 +08:00
3fc91db515
fix(posts): replace space-x-3 with flex gap-3 for edit/delete button spacing
2026-06-05 18:22:59 +08:00
c776536678
fix(write-skeleton): align skeleton layout with actual write page
...
- fix bottom button bar layout (justify-end -> items-center with flex-1 spacer)
- remove extra p-6 padding from editor container
- add p-4 padding to toolbar area to match Tiptap editor padding
2026-06-05 18:21:35 +08:00
f6db477a88
fix(write): reset tiptap editor state on unmount to prevent blank editor on re-navigation
2026-06-05 18:16:46 +08:00
72b932c21b
fix(write): add allow lint for unused vars in write_editor
2026-06-05 17:58:05 +08:00
077573af67
fix(layout): highlight write nav for both /write and /write/:id
2026-06-05 17:55:18 +08:00
4805f915c7
fix(write): address review feedback - backfill race, load errors, nav delay
2026-06-05 17:51:46 +08:00
2ecdc09138
feat(write): support edit mode with data backfill
2026-06-05 17:45:54 +08:00
0c3a084c9b
feat(admin): add edit button to post list
2026-06-05 17:37:37 +08:00
026a331dcd
feat(router): add /admin/write/:id route for post editing
2026-06-05 17:34:26 +08:00
6d28c2b4ce
feat(api): add get_post_by_id server function for editing
2026-06-05 17:29:48 +08:00
0a33a843f8
fix(theme): resolve hydration mismatch in ThemeToggle by deferring icon render until mounted
2026-06-05 17:07:23 +08:00
6d621d9ec4
feat(admin): remove '前台' nav item from admin header
2026-06-05 17:07:22 +08:00
26eb62c2ae
fix(upload): disable default body limit and fix error object serialization
2026-06-05 16:52:52 +08:00
22de5add83
fix(api): restore deleted_at filter in slug uniqueness check
2026-06-05 16:20:43 +08:00
c7668c679c
fix(api): include deleted posts in slug uniqueness check
2026-06-05 16:02:45 +08:00
53047bf824
fix(utils): strip images before links in markdown stripping
2026-06-05 15:58:35 +08:00
08bd69d64b
feat(write): add onImageUpload callback to tiptap editor
2026-06-05 15:23:36 +08:00
76797f1bc3
feat(server): register upload route and static file serving
2026-06-05 15:14:10 +08:00