feat(ImageProxy): 添加域名白名单和日志管理功能

- 在ImageProxy中添加了域名白名单配置,支持精确和子域名匹配,增强安全性。
- 实现了日志文件的自动清理和轮转功能,限制日志文件大小、保留时间和数量,优化日志管理。
- 更新README文档,详细说明了新功能和配置方法。
This commit is contained in:
2025-05-28 02:04:34 +08:00
parent 192fc2f45c
commit 39d21d3a6a
3 changed files with 156 additions and 9 deletions

View File

@@ -18,7 +18,13 @@ $proxy = new ImageProxy([
'cache_dir' => 'cache',
'timeout' => 30,
'connect_timeout' => 15,
'max_redirects' => 5
'max_redirects' => 5,
'allowed_domains' => [
'doubanio.com'
// 'trusted-site.com',
// 'images.example.org'
// 在这里添加更多允许的域名
]
]);
// 处理请求