182 Commits

Author SHA1 Message Date
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
b63f38c95d feat(cache): Add persistent configuration storage for cache manager
- Implement saveConfig and loadConfig methods to persist cache settings
- Add JSON-based configuration file in cache directory
- Support loading and saving cache configuration (max age, cleanup interval, cache size)
- Handle configuration file creation and error scenarios
- Automatically save configuration after updates and load on initialization
2025-02-16 14:17:27 +08:00
5f67325055 refactor(cache): Improve cache expiration using LastAccess timestamp
- Update cache expiration check to use LastAccess instead of CreatedAt
- Reset expiration time on each cache item access
- Enhance cache management with more accurate access tracking
2025-02-16 14:12:29 +08:00
c51d4869ba feat(auth): Add authentication to cache management API and frontend
- Implement token-based authentication for cache-related API endpoints
- Add authorization headers to frontend fetch requests
- Handle unauthorized access by redirecting to login page
- Improve security for cache configuration and management routes
2025-02-16 14:06:04 +08:00
8a910d9d91 Merge branch 'main' of https://github.com/woodchen-ink/proxy-go 0.1 2025-02-16 13:57:15 +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
wood chen
470b27c62b
Update readme.md 2025-02-15 18:33:50 +08:00
d00ab0a6e1 feat(metrics): Improve latency tracking and error visualization
- Add atomic operations to track minimum and maximum request latency
- Update GetStats method to handle uninitialized latency values
- Modify dashboard error chart with improved color scheme and legend
- Adjust chart margins and axis width for better readability
2025-02-15 18:24:55 +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
1c44fe1bf4 feat(metrics): Add status code tracking and improve path metrics handling
- Implement status code statistics tracking in Collector
- Update PathMetrics type to use pointer-based access
- Enhance atomic operations for request and error count tracking
- Modify type assertions to use pointer-based type conversion
2025-02-15 18:08:49 +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