31 Commits

Author SHA1 Message Date
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
HolgerHuo
123c96dde7
add: cache for remote images (#310)
* add: cache for remote image requests

* update: use default expiration for NoExpiration setting

* update: clean code

* fix: do not save empty etag

* fix: panic during type assertion
2024-02-11 10:55:23 +08:00
Nova Kwok
12d4cc1a0b
Upgrade to Go 1.22 (#311) 2024-02-10 10:00:40 +01:00
Nova Kwok
d83f6667cc
Refine convert part (#303)
* Refine convert part

* Only open image once

* More refine
2023-12-16 20:12:42 +01:00
HolgerHuo
0d4856c4b1
fix: metadata not updated when remote file changes (#297) 2023-11-23 16:38:50 +08:00
Nova Kwok
cc26be0f1d
Add healthz endpoint (#296) 2023-11-23 15:40:29 +08:00
Nova Kwok
4a90b18a63
Fix bug that could remove original image (#287)
* Fix bug that could remove original image

* Refine notice
2023-11-04 22:22:56 +08:00
Nova Kwok
d9da7f3cd3
Remove metadata when original not exist, update support for heic (#266)
* Remove metadata when original not exist, update support for heic

* Warnf to Warnln
2023-08-17 12:30:53 +02:00
BugFest
4003b03022
Multiple backends support (#207)
* Fix: h2non/filetype upgraded to support avif signatures

* Fix: make clean updated to include test/output dirs

* Feature: multi-backend support via IMG_MAP config key as described in #217

* feat: implement both local and remote (proxyMode) mappings for multi-backend

* Feature: multi-backend support via IMG_MAP config key as described in #217

* fix: go-is-svg should be direct import

* fix: imgMap paths are relative to CWD

* feature: IMG_MAP is parsed on start

---------

Co-authored-by: Nova Kwok <n0vad3v@riseup.net>
2023-08-02 23:33:54 +08:00
Benny
a7b5992662
Metadata (#251)
* recover middleware

* simplify Atoi

* metadata data prototype

* InterestingAttention

* resize itself

* Bump version to 0.9.4
Added some comments
Removed String() for Extraparams

* Add metadata test

* Fix CI

* Remove unnecessary tests

* Update file count

* use t.Run to get test case

---------

Co-authored-by: n0vad3v <n0vad3v@riseup.net>
2023-07-11 19:08:32 +02:00
Nova Kwok
eea4537f22
iOS 16 supports AVIF and WebP (#242)
* iOS 16 supports AVIF and WebP

* iOS 17 should support WebP and AVIF too

* Determine image type by GetFileContentType
2023-07-03 16:57:47 +08:00
Benny
23bbed8ce6
Refactor review (#220)
* runnable

* convert is working

* some refactoring

* update go.mod

* fix some TODOs

* add TODO

* update go mod

* rebase onto master

* fix #234

2: 5.9s - 7.6MB
4: 26s - 6.9MB

* fix malloc tests

* fix malloc tests

* remote TODO

* add X-Real-IP #236

* Better localRawImagePath

* remove some wrong comments

* Bump version to 0.9.0

---------

Co-authored-by: n0vad3v <n0vad3v@riseup.net>
2023-06-27 15:43:43 +02:00