192 Commits

Author SHA1 Message Date
wood chen
09173f4b0b
Update readme.md 2025-03-09 21:34:01 +08:00
22c0d2e301 feat(metrics): 优化指标数据处理和清理机制
- 在指标收集器中新增定期清理任务,自动清理无效的统计数据
- 修改 MetricsHandler 中的延迟分布处理,移除冗余日志输出
- 优化 MetricsStorage 的数据加载逻辑,限制加载的统计数据数量
- 新增延迟分布单独持久化存储,减少主指标文件的复杂性
- 改进数据加载和恢复的日志记录,提供更清晰的操作反馈
2025-03-09 13:21:35 +08:00
006fa9a172 refactor(metrics): 移除延迟分布统计的冗余日志输出
- 删除 RecordRequest 和 GetStats 方法中的详细日志记录
- 保留核心的延迟分布统计逻辑,提高代码简洁性
- 减少不必要的日志输出,优化性能和可读性
2025-03-09 12:16:44 +08:00
2a41458bb8 feat(metrics): 添加引用来源统计持久化支持
- 在 MetricsStorage 结构体中新增 refererStatsFile 字段
- 在 SaveMetrics 方法中添加引用来源统计保存逻辑
- 在 LoadMetrics 方法中实现引用来源统计的加载和恢复
- 前端页面调整路径显示,增加长路径的截断处理
- 优化引用来源统计的数据处理和类型转换
2025-03-09 12:02:32 +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
f0c806292b feat(metrics): 完善指标存储服务集成
- 在主程序中添加指标存储服务初始化和停止逻辑
- 更新指标收集器的保存方法,支持外部指标存储服务
- 优化静态文件服务路径,使用新的 web/dist 目录
- 调整静态文件处理逻辑,支持更灵活的路由
2025-03-09 11:00:39 +08:00
e67a3880f5 删除统计保存功能 2025-03-09 10:48:43 +08:00
a0cea8f5b8 feat(metrics): 增强指标收集和恢复日志记录
- 在指标初始化和加载过程中添加详细日志
- 改进指标恢复逻辑,支持从不同数据结构恢复统计信息
- 添加更多日志输出,帮助诊断指标加载问题
- 优化数据验证逻辑,允许小范围的统计数据误差
- 增加对未找到数据的日志提示
2025-03-09 10:41:24 +08:00
095b087fd8 refactor(metrics): 优化指标收集和内存管理
- 修改路径统计数据结构为指针类型,提高性能
- 使用原子操作方法替换旧的原子操作
- 添加内存释放和垃圾回收机制
- 限制路径统计数量,只保留前20个路径
- 优化指标保存和文件清理逻辑,减少内存使用
2025-03-09 10:35:00 +08:00
4276709b3f feat(config): 添加指标保存间隔和最大文件数的默认值处理
- 在配置解析中新增 MetricsSaveInterval 和 MetricsMaxFiles 字段
- 在前端页面为指标配置添加默认值(15分钟间隔,10个文件)
- 更新配置解析逻辑以支持新的指标相关配置
2025-03-09 05:47:41 +08:00
015aa6bc15 feat(metrics): 增加指标保存和管理功能
- 在配置中新增指标保存间隔和最大文件数量设置
- 实现定期自动保存指标数据到文件
- 添加指标文件自动清理机制
- 优化指标收集和存储逻辑
- 在Web界面添加指标设置选项卡
2025-03-09 05:41:22 +08:00
wood chen
34c561029c
Merge pull request #5 from woodchen-ink/dependabot/go_modules/golang.org/x/net-0.37.0
chore(deps): bump golang.org/x/net from 0.35.0 to 0.37.0
2025-03-08 22:55:18 +08:00
dependabot[bot]
906dea0bcb
chore(deps): bump golang.org/x/net from 0.35.0 to 0.37.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.35.0 to 0.37.0.
- [Commits](https://github.com/golang/net/compare/v0.35.0...v0.37.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 12:33:35 +00:00
5aeaa50c49 feat(dashboard): 移除固定路径选项卡
删除配置页面中的"固定路径"选项卡,简化用户界面
2025-03-04 16:23:52 +08:00
dc5ccbd98d Merge branch 'main' of https://github.com/woodchen-ink/proxy-go 2025-03-03 23:08:30 +08:00
3810153f8e refactor(auth): Update OAuth URLs and button text for CZL Connect integration 2025-03-03 23:08:27 +08:00
wood chen
4418d8d146
Update readme.md 2025-03-03 06:50:35 +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
v1.0.2
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
wood chen
ec07ae094e
Update readme.md v1.0.1 2025-02-17 19:10:18 +08:00
6bc6edfd37 refactor(config): Optimize configuration table layout and styling
- Adjust table column widths for better proportional display
- Reduce padding and font sizes in extension mapping section
- Enhance visual hierarchy with subtle background and border adjustments
- Maintain existing functionality while improving UI compactness
2025-02-17 19:03:02 +08:00
ed9f3be1ce refactor(config): Improve path configuration table layout and size display
- Restructure path configuration table to enhance readability
- Add tooltips for size thresholds showing exact byte values
- Separate extension mapping into a nested row with subtle background
- Improve visual hierarchy of path and extension configuration
- Maintain existing functionality while enhancing UI presentation
2025-02-17 18:55:28 +08:00
627a63caad chore(deps): Update Next.js and related dependencies to version 15.1.7
- Upgrade Next.js from 15.1.0 to 15.1.7
- Update package.json and package-lock.json with new dependency versions
- Modify dev script to specify localhost and port 13001
- Rename project from "proxy-go-web" to "web"
2025-02-17 18:38:21 +08:00
f7a52a1be5 feat(config): Add max file size threshold and improve path configuration
- Extend PathConfig with MaxSize parameter to define upper file size limit
- Update routing logic to handle both minimum and maximum file size thresholds
- Enhance frontend configuration UI to support max size input
- Improve file routing decision-making with comprehensive size range checks
2025-02-17 18:12:16 +08:00
69050adf57 refactor(routing): Improve file size detection and alternative target routing
- Enhance file size retrieval with fallback mechanisms for alternative and default sources
- Improve logging for file size detection and routing decisions
- Remove unused cache hit check function
- Optimize routing logic for extension-mapped targets
2025-02-17 17:56:29 +08:00
429664b598 feat(routing): Add target URL accessibility check for extension mapping
- Implement `isTargetAccessible` function to validate alternative target URLs
- Add fallback mechanism when alternative target is not reachable
- Enhance routing logic to prevent potential broken redirects
- Log detailed information about routing decisions and accessibility checks
2025-02-17 17:28:25 +08:00
00f4605e1c Merge branch 'main' of https://github.com/woodchen-ink/proxy-go 2025-02-17 08:36:08 +08:00
76b549aa90 refactor(metrics): Enhance path metrics sorting with secondary lexicographic ordering
- Update path metrics sorting to consider request count and path name
- Implement secondary sorting by path name when request counts are equal
- Improve deterministic ordering of metrics for consistent display
2025-02-17 08:36:05 +08:00
wood chen
a5d6543952
Update readme.md v1.0.0 2025-02-17 08:08:44 +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
55d3a9cebc refactor(metrics): Update metrics collection with atomic operations and improved type safety
- Replace manual increment methods with atomic store operations in PathMetrics
- Enhance GetStats method to handle different metric types and convert to value slice
- Update RequestLog JSON tags for consistent naming
- Add SafePathMetrics conversion for mixed pointer and value slices
- Improve type safety and consistency in metrics tracking
2025-02-17 07:56:52 +08:00
d0d752712e refactor(metrics): Comprehensive metrics system redesign with improved performance tracking
- Refactor Collector struct to use more efficient atomic counters and data structures
- Implement robust bandwidth tracking with sliding window mechanism
- Enhance path metrics with atomic operations and improved type safety
- Add data consistency checker for metrics integrity
- Optimize request logging with a more memory-efficient queue
- Simplify metrics collection and reporting logic
- Improve frontend metrics display with more detailed status code visualization
2025-02-17 07:46:58 +08:00
ff24191146 feat(dashboard): Enhance configuration management with advanced validation and UX improvements
- Add comprehensive input validation for path mappings, extension maps, and fixed paths
- Implement confirmation dialogs for deletion of paths, extensions, and fixed paths
- Improve error handling with detailed toast messages
- Add dynamic dialog state management for better user experience
- Enhance extension map editing with edit and delete functionality
- Implement more robust configuration import validation
2025-02-17 07:12:13 +08:00
4b1c774509 refactor(metrics): Optimize atomic counter initialization and status code tracking
- Refactor counter initialization to use pointer creation for better type safety
- Simplify atomic counter handling in RecordRequest method
- Add status code statistics collection with atomic load operations
- Improve consistency in counter initialization across different metrics tracking
2025-02-17 06:59:49 +08:00
9de17edcbd feat(config): Enhance path mapping configuration with size unit and editing support
- Add size unit selection (B, KB, MB, GB) for file size thresholds
- Implement path mapping editing functionality
- Improve UI with more descriptive placeholders and helper text
- Add utility functions for byte conversion and URL truncation
- Update table display to show formatted file sizes and truncated URLs
2025-02-17 06:57:31 +08:00
dd57ec2bd5 chore(build): Configure Next.js export and deployment settings
- Add export configuration for production builds
- Set base path for admin deployment
- Enable trailing slash for consistent routing
- Ignore ESLint during builds
- Configure development proxy rewrites
2025-02-17 06:44:53 +08:00
bee914fc61 chore(dependencies): Add Radix UI Select and related floating-ui packages
- Update package-lock.json and package.json to include @radix-ui/react-select
- Add supporting floating-ui dependencies for improved UI component interactions
2025-02-17 06:41:49 +08:00
e9aad806f8 refactor(metrics): Improve atomic counter handling and type safety in metrics collection
- Optimize latency bucket counter initialization using pointer creation
- Add type checking when loading latency distribution metrics
- Simplify counter initialization and access in metrics collector
- Enhance type safety for atomic counter operations
2025-02-17 06:36:38 +08:00
076ff7c269 feat(config): Enhance proxy configuration management UI
- Add comprehensive configuration management with tabs for paths, compression, and fixed paths
- Implement dynamic editing of path mappings, extension maps, and compression settings
- Support importing and exporting configuration as JSON
- Add dialogs for adding and editing configuration entries
- Improve configuration page with more interactive and user-friendly controls
2025-02-17 06:30:33 +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
621900d227 chore(ui): Update dashboard and layout titles
- Rename application title to "Proxy Go控制台"
- Reduce metrics and cache page refresh interval from 5s to 1s for more real-time updates
2025-02-16 23:06:40 +08:00
5c3fb00d57 feat(dashboard): Add clickable links to paths in metrics tables
- Make top paths and recent requests table entries clickable
- Open links in new tabs with appropriate security attributes
- Add hover and color styles to improve link visibility and interaction
2025-02-16 20:46:41 +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
v0.2.0
2025-02-16 14:34:49 +08:00
1f277997d3 feat(cache): Enhance cache file management and cleanup
- Add startup cleanup of stale and temporary files
- Modify ClearCache to remove all cache files except config
- Implement cleanStaleFiles method to remove orphaned and temporary cache files
- Improve file management by tracking and cleaning unused cache entries
2025-02-16 14:22:51 +08:00