61 Commits

Author SHA1 Message Date
85a4096ffc refactor(encoder): remove logging for image conversion and processing 2024-10-29 16:43:28 +08:00
5e2052a711 refactor(api): migrate from Fiber to Gin framework
Migrate the web framework from Fiber to Gin for better performance and community support.
2024-10-28 16:56:29 +08:00
ffa5242983 feat(handler/router): add image file type checking and non-image file handling 2024-10-23 06:53:00 +08:00
11d6f95787 refactor(router): improve image file type checking and error messages 2024-10-23 06:24:27 +08:00
2b46043bd0 refactor(router): streamline request URI and parameter parsing 2024-10-23 06:04:22 +08:00
603efd67e5 refactor(router): enhance file processing and redirection logic 2024-10-23 05:38:11 +08:00
317ff650e3 fix(router): change image file size limit from 100KB to 30KB 2024-10-23 05:17:52 +08:00
f241273bc4 refactor(router): simplify file path construction in Convert function 2024-10-23 04:32:20 +08:00
230cc6c31c refactor(encoder): improve image preprocessing and error handling 2024-10-23 04:02:23 +08:00
2a61cc9247 refactor(router): improve remote address construction logic 2024-10-23 03:04:32 +08:00
b7d9419408 refactor(router): simplify remote address construction logic 2024-10-23 02:59:21 +08:00
0ae84bc419 fix(router): improve remote URL parsing and logging 2024-10-23 02:42:59 +08:00
e791682e4c fix(handler): improve error messages in downloadFile function 2024-10-23 02:37:43 +08:00
0a36dd5284 refactor(handler): streamline file streaming and improve concurrency handling 2024-10-23 02:05:47 +08:00
85e0534523 chore(Dockerfile): Update Dockerfile to use Alpine Linux and refactor package management
Update Dockerfile to use Alpine Linux for base image and refactor package management to use apk instead of apt. Also, clean up cache directories after installing packages.
2024-10-23 01:16:23 +08:00
52e885d3ec chore(router): add os package and ensure target directory exists
remove unused image files
2024-10-23 00:23:59 +08:00
8381e24fc4 feat(handler, schedule): improve error handling and logging for file downloads and cleanup 2024-10-22 23:52:57 +08:00
8b6defa69c refactor(router): add file size check before image processing 2024-10-22 23:27:07 +08:00
c5ed3a1fea feat(encoder): add ProcessAndSaveImage function to handle image processing and saving 2024-10-22 22:36:58 +08:00
be7aed64a9 refactor(encoder): Update log messages and helper functions for better readability and maintainability 2024-10-22 21:45:47 +08:00
3353d014d4 调整以支持IMG_MAP情况下的本地路径 2024-10-22 20:18:09 +08:00
d872d71dcb feat(config, handler): Remove IMG_PATH config and update IMG_MAP handling, add root path greeting 2024-10-22 19:59:27 +08:00
c8f3d0bf38 进一步优化日志 2024-10-22 19:32:22 +08:00
f8b23a88f3 chore: Refactor workflow and Makefile, remove test files 2024-10-22 19:06:06 +08:00
4aea178ab0 100KB以下不处理, 调整日志 2024-10-22 18:20:59 +08:00
e7c2a50e2f 改为100KB以下不处理 2024-10-22 18:18:39 +08:00
9b6425777c feat(handler/router): 低于200k的图片直接跳过转换 2024-10-22 18:10:00 +08:00
c9cb32b0da 尝试优化内存占用
feat(encoder): optimize prefetch images with worker pool and progress bar
refactor(handler): improve downloadFile function with error handling
refactor(helper): use streaming JSON encoder for metadata
chore(webp-server): update server config with write buffer size
2024-10-22 17:26:43 +08:00
9ee97eab9d refactor(config, handler): Update error messages and logging to Chinese 2024-10-22 17:05:33 +08:00
cad6e95686 refactor(encoder, handler, schedule): Update error messages and code style for better readability 2024-10-22 16:56:42 +08:00
b6231118df Update root path welcome message and remove glib_malloc and jemalloc docker-compose files 2024-10-16 15:11:52 +08:00
2044d8388a 改进文件变更检测逻辑,增加文件大小和最后修改时间检查,优化日志记录 2024-10-07 15:08:52 +08:00
fef4228f7c 修复了非图片文件请求的处理逻辑,优化了本地和远程资源的区分和重定向方式。 2024-09-29 16:10:22 +08:00
b85b0c6260 修复了路径检查和根路径请求的处理,优化了代码结构。 2024-09-29 15:19:57 +08:00
585f9a52b8 尝试修复非图片文件的重定向问题,并优化了代码结构。 2024-09-29 15:17:45 +08:00
0b494e08ac 尝试修复无限重定向 2024-09-29 15:04:43 +08:00
68108a3946 修复了远程请求错误,优化了日志警告信息,并改进了生成默认etag的逻辑。 2024-09-29 12:25:29 +08:00
d976d8f7cb 修复每次都回源, 把默认etag改为静态值 2024-09-29 03:21:26 +08:00
b5fb5b84a0 fix 2024-09-29 02:18:49 +08:00
08be6ef926 fix 2024-09-29 02:13:10 +08:00
85362aad22 修复 2024-09-29 01:39:46 +08:00
214d189e24 尝试修复 2024-09-29 01:37:44 +08:00
77801f29fa 尝试修复 2024-09-29 01:08:37 +08:00
34092a41b0 非图片文件会302重定向到原始链接 2024-09-29 00:47:33 +08:00
9629b19b9a 导入time 2024-09-29 00:13:41 +08:00
e7c6fe9851 这个修改版本的 pingURL 函数有以下改进:
如果无法获取 ETag,尝试使用 Last-Modified 头部信息。
如果 ETag 和 Last-Modified 都不可用,使用一个基于 URL 和当前时间的回退标识符。
在出现错误或意外状态码时,也使用回退标识符。
增加了更详细的日志记录,有助于问题诊断。
2024-09-29 00:09:18 +08:00
Nova Kwok
89ea0affa3
Add MAX_CACHE_SIZE config (#344)
* Add MAX_CACHE_SIZE

* Bump actions version

* Optimize code

* Use Ticker to control GC loop
2024-06-29 16:42:00 +08:00
Benny
be32328998
Fix Malformed dir traversal (#331)
* Directory traversal with malformed HTTP request

#330

* bump version

* also %2e

* Use prefix to check invalid Path

---------

Co-authored-by: n0vad3v <n0vad3v@riseup.net>
2024-04-23 13:15:40 +08:00
Nova Kwok
43c275e3ec
Adds JPEG XL support, max_height/max_width support (#321)
* WIP JXL

* Fix test

* Tries to fix autobuild

* Tries to fix autobuild

* Add setup go in codeql

* Bump actions version

* Do not print curl output in CI

* Do not print curl output in CI

* Remove Metadata on RAW image

* Update sample config

* better loop

* Prefetch should also respect AllowedType

* Better Export params and UA handle

* Only do conversion on supported formats

* CONVERT_TYPES default to webp only

* CONVERT_TYPES default to webp only

* Add GIF to AllowedTypes

* Update README
2024-03-22 15:12:09 +08:00
Nova Kwok
9be1a6b1ed
Fix tests, bump version (#312) 2024-02-11 05:04:19 +01:00