173 Commits

Author SHA1 Message Date
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
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
9c3c48f4b6 feat(cache,middleware): Enhance caching mechanism for fixed path proxy
- Modify CacheKey to use a simplified string representation of Vary headers
- Update GenerateCacheKey to handle Vary headers more efficiently
- Implement caching in FixedPathProxyMiddleware with cache hit/miss tracking
- Improve response handling by reading entire response body before writing
- Add error handling for connection-related issues during response writing
2025-02-15 17:14:29 +08:00
88726d9d8f feat(cache): Add CacheKey methods for string representation, equality, and hashing
- Implement `String()` method to generate a unique string representation of CacheKey
- Add `Equal()` method to compare CacheKey instances
- Create `Hash()` method using FNV-64a hashing algorithm for efficient key comparison
2025-02-15 17:09:00 +08:00
c4cd99a827 feat(cache): Implement comprehensive caching system for proxy requests
- Add CacheManager to handle caching for proxy and mirror handlers
- Introduce cache-related API endpoints for stats, enabling, and clearing
- Modify proxy and mirror handlers to support caching GET requests
- Remove rate limiting and simplify request handling
- Update go.mod dependencies and remove unused imports
- Add cache hit/miss headers to responses
- Enhance metrics collection for cached requests
2025-02-15 17:00:16 +08:00
fc2e324d82 Merge branch 'main' of https://github.com/woodchen-ink/proxy-go 2025-02-15 16:23:23 +08:00
3e5950e3f6 feat(metrics,web): Enhance dashboard with advanced metrics visualization
- Integrate Recharts library for interactive data visualization
- Add detailed latency distribution charts and error type analysis
- Implement bandwidth and performance metrics graphs
- Update metrics collection to support more granular statistical tracking
- Modify frontend API routes to remove /admin prefix
- Improve metrics display with responsive and informative charts
2025-02-15 16:23:20 +08:00
wood chen
c21ba55041
Update readme.md 2025-02-15 12:10:41 +08:00
eabb1f1f9a refactor(models,web): Update JSON serialization and formatting utilities
- Modify RequestLog struct to use PascalCase JSON tags
- Enhance formatBytes function to handle undefined or NaN inputs
- Update formatDate to return full datetime and handle empty inputs
- Add null/NaN checks to formatLatency for more robust display
2025-02-15 12:01:28 +08:00
b5a6928a3a refactor(web): Update API routes to use /admin prefix
- Modify fetch API calls in dashboard, login, and config pages
- Update routes to consistently use /admin/api/ endpoint
- Ensure uniform API route handling across frontend components
2025-02-15 11:56:03 +08:00