253 Commits

Author SHA1 Message Date
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
f758db3531 refactor(metrics): Simplify metrics collection and improve performance
- Restructure Collector to use more efficient atomic operations
- Remove complex caching and monitoring dependencies
- Simplify path and status code tracking with sync.Map
- Optimize request logging with a dedicated request queue
- Remove unnecessary utility functions and pools
- Streamline stats generation and reduce complexity
2025-02-15 11:51:01 +08:00
33d6a51416 refactor(web): Migrate to modern web frontend and simplify admin routes
- Remove legacy static files, templates, and JavaScript
- Update main.go to serve SPA-style web application
- Modify admin route handling to support client-side routing
- Simplify configuration and metrics API endpoints
- Remove server-side template rendering in favor of static file serving
- Update Dockerfile and GitHub Actions to build web frontend
2025-02-15 11:44:09 +08:00
ecba8adbf1 refactor(templates): Update template definition names for admin pages
- Change template definition names from "Content" to specific page names
- Modify layout.html to conditionally render templates based on page name
- Ensure consistent template naming across admin page templates
2025-02-15 09:49:23 +08:00
ab8684d4c5 refactor(admin): Enhance template rendering and routing for admin pages
- Update template rendering to use a dynamic layout with configurable title
- Modify template parsing to use template.Must for simplified error handling
- Update static file serving path from /web/static to /admin/static
- Improve template execution with dynamic content mapping
- Simplify template loading and error management in main.go
2025-02-15 09:45:36 +08:00
8a2207bd29 feat(templates): Implement template rendering for admin routes
- Replace static file serving with Go template rendering
- Add template parsing for login, metrics, and config pages
- Set appropriate content type headers for HTML responses
- Improve error handling for template rendering
- Enhance logging for template-related errors
2025-02-15 09:40:52 +08:00
dca6a8a362 chore(ci): Include web directory in Docker build context
- Copy web directory to Docker context for image build
- Ensure web assets are available during Docker image creation
2025-02-15 09:32:48 +08:00
fa5cbff486 feat(web): Update file paths for static and template serving in Docker environment
- Modify Dockerfile to copy web directory into /app
- Update main.go to serve static and template files from absolute paths (/app/web)
- Add debug logging for static file and template route handling
- Ensure consistent file serving across admin and web routes
2025-02-15 09:29:55 +08:00
0446eb1c53 feat(proxy): Optimize HTTP transport and timeout configurations
- Increase connection pool and idle connection limits
- Extend timeout durations for more robust network handling
- Configure HTTP/2 transport with enhanced performance settings
- Add HTTP/2-specific optimizations and security constraints
2025-02-15 08:59:20 +08:00
ca79cc7dac feat(routing): Enhance main handler with admin route management and debug logging
- Refactor routing logic to use a more modular handler approach
- Add dedicated admin route handler with explicit path matching
- Implement comprehensive debug logging for request handling
- Simplify main handler by removing nested admin route logic
- Add fallback NotFound handler for unmatched routes
2025-02-15 08:51:16 +08:00
6c7bc2bfb8 refactor(proxy): Improve error handling and response writing in proxy handler
- Modify error response writing to use explicit WriteHeader and Write methods
- Remove redundant WriteHeader call in ServeHTTP method
- Add WriteHeader before writing response for both small and large responses
- Enhance code readability and error handling consistency
2025-02-15 08:34:14 +08:00
53b16f44fb feat(admin): Implement admin layout and login page template
- Add responsive admin layout with navigation menu
- Convert login page to use layout template system
- Integrate Tailwind CSS and DaisyUI for styling
- Add authentication check script in layout
2025-02-15 08:31:07 +08:00
47d2326815 补充丢失的登录页面 2025-02-15 08:29:07 +08:00
a827a79b4d chore(ci): Remove redundant SSH deployment step from docker-build workflow 2025-02-15 08:08:52 +08:00
e89ef02205 特性(代理):通过端口和身份验证更新来增强服务器配置和安全性。
- 更新 docker-compose.yml 文件,使用端口 3336
- 修改 Dockerfile 以暴露端口 3336
- 重构 main.go 以支持新的路由和管理端点
- 在 auth.go 中实现健壮的身份验证中间件
- 通过加强错误检查来改进指标处理。
- 添加用于安全类型转换的实用函数
- 引入请求ID生成功能,以便更好地进行追踪。
2025-02-15 08:07:28 +08:00
wood chen
03ffec4760
Update readme.md 2025-02-15 02:00:49 +08:00
f76649d0e7 refactor(proxy): streamline target URL selection logic by removing deprecated path handling 2025-01-12 18:24:19 +08:00
8f27b8b70f Merge branch 'main' of https://github.com/woodchen-ink/proxy-go 2025-01-12 18:14:29 +08:00
f8a5999d36 fix(utils): update default size threshold and enhance logging for extension mapping 2025-01-12 18:14:27 +08:00
wood chen
49042362ed
Merge pull request #2 from woodchen-ink/dependabot/go_modules/golang.org/x/time-0.9.0
chore(deps): bump golang.org/x/time from 0.8.0 to 0.9.0
2025-01-12 01:54:55 +08:00
dependabot[bot]
d331ad036b
chore(deps): bump golang.org/x/time from 0.8.0 to 0.9.0
Bumps [golang.org/x/time](https://github.com/golang/time) from 0.8.0 to 0.9.0.
- [Commits](https://github.com/golang/time/compare/v0.8.0...v0.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-06 12:33:06 +00:00