9 Commits

Author SHA1 Message Date
f2456e116b 删除不再使用的配置文件和脚本,更新Dockerfile以支持前后端构建,重构配置加载逻辑,添加OAuth2.0支持,优化API处理和路由设置。 2025-06-14 17:40:31 +08:00
b252b8313e refactor(handlers): simplify referer handling in API request logging
- Removed custom referer parsing logic and replaced it with direct usage of r.Referer() for cleaner code.
- Updated logging to consistently use the referer from the request object across all relevant handlers.
- Enhanced readability and maintainability by eliminating redundant code related to referer extraction.
2024-12-02 05:45:39 +08:00
f92b8385d8 fix(handlers, public): update timestamp logging to use Unix milliseconds
- Changed timestamp logging in the HandleAPIRequest function to use Unix milliseconds for improved precision.
- Updated the recent requests display in the HTML to correctly parse and format timestamps using the new millisecond format, enhancing readability and consistency in metrics presentation.
2024-12-01 00:55:20 +08:00
1248508302 refactor(handlers, monitoring): improve API request handling and metrics logging
- Refactored HandleAPIRequest to use a result channel for better error handling and response management.
- Updated metrics logging to directly use the full referer instead of just the main domain, enhancing data accuracy.
- Fixed recent requests display in HTML to correctly format timestamps for better readability.
2024-12-01 00:37:50 +08:00
d6fd055cd5 fix(handlers): add HTTP redirect for API requests
- Implemented an HTTP redirect to a random URL in the HandleAPIRequest function, enhancing user experience by guiding users to the appropriate resource after processing their request.
2024-12-01 00:20:23 +08:00
80d18f2b88 feat(config, handlers, middleware): enhance configuration and API request handling
- Added performance settings to the configuration, including max concurrent requests and caching options.
- Updated API request handling to use context for timeouts and improved logging with Unix timestamps.
- Introduced rate limiting middleware to manage request load effectively.
- Enhanced metrics logging to include atomic counters for request counts and improved data structure for performance metrics.
- Implemented caching for CSV content to optimize data retrieval and reduce load times.
2024-12-01 00:14:21 +08:00
fd9c616aa2 feat(main, handlers): initialize random number generator and enhance URL stats response format
- Added initialization of a random number generator in main.go to support future features.
- Refactored HandleURLStats in handlers.go to return URL statistics in a structured format, improving API response clarity and usability.
2024-11-30 23:56:21 +08:00
1b2fd3ea85 feat(handlers, monitoring, public): enhance API request handling and improve metrics logging
- Implemented detailed logging for API requests, including real IP, referer, and latency metrics.
- Added dynamic routing for handling requests to /pic/ and /video/ endpoints.
- Enhanced error handling for CSV content fetching and improved response messages.
- Updated the HTML and JavaScript to load and display statistics more efficiently, including filtering based on endpoint configuration.
- Introduced new metrics collection logic to only log relevant API requests, optimizing performance and clarity.
2024-11-30 23:52:31 +08:00
e70ca4cf52 feat(docker, config, api): update docker-compose for logging, enhance app structure, and add system metrics display
- Updated docker-compose.yml to mount logs directory.
- Changed BASE_URL environment variable to point to the new API endpoint.
- Refactored main.go to implement a structured App type, improving initialization and graceful shutdown.
- Enhanced config management with JSON loading and environment variable support.
- Added monitoring capabilities in api_handler for logging request metrics.
- Introduced new metrics display in index.html with corresponding CSS styles for better visualization.
2024-11-30 23:23:58 +08:00