110 Commits

Author SHA1 Message Date
4ac2c1c43c 为图片请求添加 Vary 头部支持,以便 CDN 根据 Accept 头部进行缓存,优化响应处理逻辑。 2025-07-15 11:51:56 +08:00
8e484f29e9 添加安全头部过滤功能,优化请求头复制逻辑,确保跳过不必要的 hop-by-hop 头部和安全头部,提高安全性和性能。 2025-07-13 04:50:09 +08:00
775814eb24 新增当前会话请求数统计,优化请求窗口逻辑,更新仪表板以展示缓存管理和智能缓存统计,添加工具提示功能以增强用户体验。 2025-07-13 04:31:00 +08:00
1e77085e10 移除缓存管理器的测试文件,更新缓存管理器以支持图片请求的智能格式回退和统计功能,优化缓存命中率的记录逻辑,增强仪表板的缓存统计展示。 2025-07-13 03:57:25 +08:00
6fd69ba870 添加LRU缓存和内存池优化,提升缓存管理性能。实现缓存预热功能,支持热点数据的快速访问。优化连接池配置,增强镜像代理和代理处理的性能。更新指标收集逻辑,使用分片哈希表提升引用来源统计效率。 2025-07-12 01:19:28 +08:00
f31c601c20 更新Go版本至1.24,添加对github.com/woodchen-ink/go-web-utils的依赖,优化IP获取逻辑,统一使用iputil包获取客户端IP,提升代码一致性和可读性。 2025-06-21 22:39:04 +08:00
da3200c605 添加IP封禁功能,增强安全管理,支持配置IP封禁策略,包括错误阈值、统计窗口、封禁时长和清理间隔。更新配置页面以支持安全设置的可视化管理。 2025-06-21 21:33:12 +08:00
f126dbb9dc 添加域名过滤功能,支持根据请求域名配置不同的扩展规则,增强代理服务的灵活性和可控性。 2025-06-18 16:47:30 +08:00
5790b41a03 优化配置更新逻辑,添加清理缓存功能以确保使用新配置,增强代理处理器的性能和准确性。 2025-06-02 07:54:25 +08:00
83c544bd5b 添加动态压缩管理器支持,优化配置更新逻辑,确保压缩配置可动态调整。更新配置处理器以使用ConfigManager,简化配置保存和加载流程。 2025-06-02 07:52:33 +08:00
605b26b883 添加ExtensionMatcher缓存机制,优化缓存管理器和302跳转处理逻辑,增强规则服务集成,提升代码可读性和性能。 2025-06-02 07:18:40 +08:00
1c9d5bc326 移除扩展名匹配器的缓存机制,简化相关逻辑,优化配置更新时的处理流程,提升代码可读性和维护性。 2025-06-02 06:50:37 +08:00
9e45b3e38a 添加扩展名匹配器和缓存机制,优化302跳转规则选择逻辑,增强缓存统计功能,确保配置更新时清理缓存以提高性能和准确性。 2025-06-02 06:33:50 +08:00
8dd410fad4 优化302跳转逻辑,确保在默认目标未配置时仍能进行扩展名匹配,增强代码可读性和逻辑清晰度。 2025-06-02 06:18:28 +08:00
4447e690db 更新302跳转处理逻辑,添加客户端参数以优化规则选择,增强扩展名匹配和文件大小判断,确保代理请求的准确性和稳定性。 2025-06-02 06:12:36 +08:00
1a2c7bd06d 添加302跳转支持,更新相关配置和处理逻辑 2025-05-27 08:18:40 +08:00
6bdcaf6f83 优化代理响应头设置,将"Proxy-Go-Cache"和"Proxy-Go-AltTarget"的值调整为更具语义的格式,以提高可读性和一致性。 2025-05-10 18:10:49 +08:00
d1db2835b4 添加原始请求的查询参数到目标URL,以确保代理请求能够正确传递查询信息。 2025-05-05 21:51:51 +08:00
0335640df5 优化Accept-Encoding请求头的设置逻辑,确保在存在该头时使用其值,否则删除该头,以提高代理请求的兼容性和稳定性。 2025-05-05 21:34:15 +08:00
4156b64ac6 优化配置管理逻辑,确保路径配置的扩展名规则在更新时得到正确处理,移除冗余代码以简化回调逻辑。 2025-05-01 08:42:26 +08:00
1d84c0c614 增强路径匹配逻辑,添加前缀匹配器以提高性能,同时优化请求头设置和扩展名处理,确保代理请求的兼容性和稳定性。 2025-04-17 22:11:15 +08:00
c2266a60d6 增强请求头设置,添加Origin和Accept-Encoding头,确保代理请求的兼容性和稳定性。同时更新User-Agent和Referer的设置逻辑,以支持更灵活的请求处理。 2025-03-24 12:00:04 +08:00
5418e89e3b 移除路径统计相关代码和数据存储,更新指标处理逻辑,调整引用来源统计的加载数量限制,以简化代码和提高性能。 2025-03-23 12:28:15 +08:00
11378a7e0c 增强请求头设置,添加浏览器User-Agent和Referer,以提高目标URL的可访问性和兼容性。 2025-03-22 18:48:43 +08:00
c85d08d7a4 移除错误处理模块并更新目标URL获取逻辑,调整返回值以支持备用目标标记。 2025-03-22 16:03:51 +08:00
e98b2c3efe feat(config): 更新配置处理逻辑并添加日志记录
- 确保在更新配置时调用 ProcessExtensionMap 方法,以更新路径配置的 processedExtMap
- 在配置更新和加载时添加日志记录,便于调试和监控
- 优化回调触发逻辑,确保所有路径配置在触发回调前已更新
2025-03-13 13:23:06 +08:00
de2209d177 优化指标处理逻辑,移除错误统计部分并更新前端展示。更新.gitignore以忽略.cursor文件。 2025-03-13 00:54:29 +08:00
7f4a964163 feat(auth): 增强OAuth认证状态管理和安全性
- 新增 state 状态管理机制,增加 10 分钟有效期
- 实现 generateState 和 validateState 方法
- 优化 LoginHandler 和 OAuthCallbackHandler 中的状态验证逻辑
- 添加更详细的调试和错误日志记录
- 完善回调地址生成逻辑,支持更多网络环境
- 在 OAuth 授权请求中添加 scope 参数
2025-03-12 20:27:20 +08:00
512ec6707d feat(auth): 支持自定义OAuth回调地址配置
- 在 docker-compose.yml 中新增 OAUTH_REDIRECT_URI 环境变量配置
- 修改 getCallbackURL 方法,优先使用环境变量指定的回调地址
- 保留原有的自动获取回调地址逻辑作为备选方案
- 增加配置灵活性,方便在不同部署环境中自定义回调地址
2025-03-12 18:54:01 +08:00
a4067a6c66 feat(auth): 增强OAuth用户信息解析和处理逻辑
- 重构用户信息解析方法,支持更多JSON字段和灵活的用户名提取
- 添加调试日志记录用户信息响应内容
- 优化用户名提取策略,支持多种备用字段
- 增加头像URL的多字段兼容处理
- 改进用户信息验证和错误处理机制
- 扩展 OAuthUserInfo 结构体,支持更多可选字段
2025-03-12 15:43:42 +08:00
0d10e89a0b feat(auth): 增强OAuth认证流程的错误处理和日志记录
- 添加详细的OAuth认证流程错误日志
- 增加对OAuth请求各个阶段的参数和状态验证
- 完善错误处理,提供更具体的错误信息和状态码
- 记录认证过程中的关键步骤和错误信息
- 新增客户端IP和请求来源的日志记录
- 优化OAuth令牌和用户信息的验证逻辑
2025-03-12 15:14:01 +08:00
0ce0f75b58 feat(proxy): 优化路径匹配
- 增强路径匹配逻辑,确保仅匹配完整路径段
2025-03-11 02:47:22 +08:00
22c0d2e301 feat(metrics): 优化指标数据处理和清理机制
- 在指标收集器中新增定期清理任务,自动清理无效的统计数据
- 修改 MetricsHandler 中的延迟分布处理,移除冗余日志输出
- 优化 MetricsStorage 的数据加载逻辑,限制加载的统计数据数量
- 新增延迟分布单独持久化存储,减少主指标文件的复杂性
- 改进数据加载和恢复的日志记录,提供更清晰的操作反馈
2025-03-09 13:21:35 +08:00
d2e5020d22 feat(metrics): 优化延迟分布数据处理逻辑
- 增加对延迟分布数据的类型兼容性处理
- 新增直接使用 map[string]int64 类型的处理分支
- 优化日志输出,提供更详细的类型转换信息
- 在处理结束后打印最终的延迟分布数据
- 改进错误处理和类型转换的健壮性
2025-03-09 11:49:37 +08:00
f2e1b8cbf5 feat(metrics): 统一延迟分布桶命名并优化日志记录
- 将延迟分布桶键名从 "<10ms" 和 ">1s" 改为 "lt10ms" 和 "gt1s"
- 在指标处理和收集过程中添加详细日志,帮助诊断数据处理流程
- 前端页面适配新的桶键名,并提供友好的显示转换
- 增强延迟分布数据处理的健壮性和可读性
2025-03-09 11:43:26 +08:00
2cb88a4f5e fix(metrics): 优化延迟统计和分布数据处理
- 修复延迟统计分布数据获取逻辑,增加更健壮的类型转换
- 确保延迟分布桶始终存在,即使没有数据
- 在处理器中为空分布数据添加默认初始化
- 优化指标收集器中的延迟桶初始化和数据获取方法
2025-03-09 11:33:47 +08:00
b6b77b03ed feat(metrics): 增强指标展示和统计功能
- 在指标结构中新增延迟统计、错误统计和引用来源统计字段
- 更新前端仪表盘,添加延迟、带宽、错误和引用来源统计卡片
- 优化指标收集器,支持引用来源和错误类型统计
- 在工具函数中新增字符串转整数解析方法
- 简化引用来源URL处理,提取域名信息
2025-03-09 11:24:46 +08:00
3810153f8e refactor(auth): Update OAuth URLs and button text for CZL Connect integration 2025-03-03 23:08:27 +08:00
4af1592021 删除固定路径代理配置, 因为普通代理好像已经支持了 2025-03-03 06:47:52 +08:00
f614692f33 refactor(auth): Remove user allowlist filtering
- Delete `isAllowedUser` function for user authorization
- Remove environment variable `OAUTH_ALLOWED_USERS` from docker-compose
- Eliminate user whitelist check in OAuth callback handler
2025-02-20 02:50:43 +08:00
929d13157d refactor(proxy): Optimize hop-by-hop header handling and routing logic
- Simplify hop-by-hop headers initialization using map literal
- Create a local copy of hop headers to improve header filtering
- Enhance routing logic with context-based timeout for alternative target checks
- Improve error handling and logging in file size and routing detection
- Reduce unnecessary goroutine complexity in target URL selection
2025-02-18 13:34:50 +08:00
ed63121a00 refactor(metrics): Introduce JSON-friendly metrics serialization
- Create PathMetricsJSON struct for clean JSON serialization
- Add ToJSON method to convert PathMetrics to JSON-compatible representation
- Update metrics handlers and collectors to use new JSON-friendly type
- Simplify type conversion in SafePathMetrics utility function
- Improve metrics data transfer and serialization consistency
2025-02-17 08:01:29 +08:00
92910a608f feat(metrics): Add interval-based metrics tracking and reporting
- Implement time-interval statistics for requests, errors, and bytes
- Add per-second metrics calculation for requests and bandwidth
- Enhance GetStats method to return interval-specific performance data
- Track and reset interval status codes dynamically
- Improve metrics granularity with more detailed performance insights
2025-02-17 06:13:24 +08:00
a4437b9a39 feat(auth): Implement OAuth-based authentication with Q58 platform
- Replace password-based login with OAuth authentication
- Add OAuth login and callback handlers
- Support user whitelist via environment variables
- Update login page to use OAuth flow
- Remove legacy metrics-related authentication configuration
- Enhance token management with username tracking
2025-02-17 05:43:23 +08:00
41f5b82661 feat(metrics): Enhance uptime formatting with more precise time display
- Update FormatUptime to include seconds in time representation
- Modify metrics handler to use new uptime formatting method
- Improve readability of uptime display with more granular time details
2025-02-16 20:24:31 +08:00
4e3a17ecd4 refactor(logging): Standardize logging format across components
- Update logging in cache, auth, proxy, metrics, and fixed path middleware
- Add consistent log message structure with method, path, status, and source
- Improve error logging with more descriptive and uniform messages
- Enhance log readability by using concise and informative log formats
2025-02-16 14:34:49 +08:00
a4c4688412 feat(cache): Add dynamic cache configuration management
- Implement GetConfig and UpdateConfig methods in CacheManager
- Add cache configuration endpoints in CacheAdminHandler
- Create frontend UI for dynamically updating cache settings
- Support configurable max age, cleanup interval, and cache size
- Add input validation for cache configuration updates
2025-02-16 13:57:12 +08:00
35ea14a91f feat(cache): Add Content-Encoding support in cache management
- Update CacheItem struct to include ContentEncoding field
- Modify Put and Commit methods to store Content-Encoding header
- Enhance cache retrieval to set Content-Encoding header for cached responses
- Implement Content-Encoding preservation across proxy and mirror handlers
2025-02-15 18:16:04 +08:00
2267a27b37 feat(cache): Implement streaming cache with TeeReader for efficient response handling
- Replace full response body reading with streaming cache mechanism
- Add CreateTemp and Commit methods to CacheManager for incremental caching
- Use io.TeeReader to simultaneously write response to client and cache file
- Remove buffer pool and full body reading in proxy and mirror handlers
- Improve memory efficiency and reduce latency for large responses
- Update error handling and logging for cache-related operations
2025-02-15 17:48:13 +08:00
ffc64bb73a feat(cache): Add fixed path cache support to admin dashboard and API
- Integrate fixed path cache into cache admin handler and API endpoints
- Update cache admin dashboard to display fixed path cache statistics
- Modify cache management functions to support fixed path cache operations
- Add new cache type to frontend cache management UI
2025-02-15 17:32:27 +08:00