- Changed the file paths in the Docker workflow to reflect the new directory structure for public assets.
- Removed the top referers display section from index.html to streamline the user interface and improve performance.
- Ensured proper cleanup and permissions for the new public data directory in the Docker workflow.
- Introduced a new section in the index.html to display the top referers with their respective counts.
- Implemented dynamic rendering of referers based on available data, enhancing user insights into traffic sources.
- Ensured the referers are sorted by count for better visibility and understanding of user access patterns.
- 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.
- Simplified MetricsMiddleware by removing unnecessary comments and focusing on essential request logging.
- Updated RequestLog structure to exclude the Referer field from JSON serialization, enhancing data privacy.
- Removed top referers tracking and associated HTML/CSS elements to declutter the user interface and improve performance.
- Cleaned up CSS styles related to referers for a more streamlined design.
- Added a main title to the index.html for better context.
- Introduced a new stats container to organize summary and detail statistics.
- Implemented a refresh animation for loading stats, improving user experience.
- Updated the updateStats function to streamline data handling and display.
- Enhanced the metrics section with improved formatting and error handling.
- Refined CSS styles for better visual presentation and responsiveness.
- Ensured a cleaner layout for system metrics and top referers, contributing to a more intuitive interface.
- Updated the metrics API endpoint from '/metrics' to '/api/metrics' for better organization.
- Added data validation to ensure the metrics data received is an object, enhancing error handling.
- Refactored the updateMetricsDisplay function to dynamically create metric items, improving the display of metrics.
- Implemented HTML escaping for metric keys and values to prevent XSS vulnerabilities.
- Cleared existing content in the metrics container before updating, ensuring a clean display.
- Improved LogRequest function to correctly increment counts for referers, ensuring accurate tracking of direct and indirect accesses.
- Added MarshalJSON method to SystemMetrics for proper serialization of TopReferers, facilitating better JSON representation of metrics.
- Updated comments for clarity and maintainability, enhancing code readability.
- Streamlined SystemMetrics by removing unnecessary fields and focusing on essential metrics such as AverageLatency and MemoryStats.
- Updated LogRequest to improve handling of referers and average latency calculations, ensuring accurate metrics collection.
- Enhanced the HTML display to include a dedicated section for system metrics, ensuring graceful handling of undefined values.
- Improved the presentation of top referers with a time-based reset mechanism, contributing to a cleaner and more efficient user interface.
- Removed the RecentRequests field from SystemMetrics and its associated logic in LogRequest to streamline metrics collection.
- Updated the HTML to eliminate the recent requests section, focusing on the top referers display for improved performance and clarity.
- Enhanced the overall metrics presentation by ensuring only relevant data is displayed, contributing to a cleaner user interface.
- 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.
- Introduced global locks to protect concurrent writes to metrics maps in the LogRequest function.
- Ensured thread safety for updating status codes, path latencies, and recent requests, preventing data races.
- Improved overall reliability of metrics logging during high concurrency scenarios.
- Removed the obsolete formatLatency function from metrics.go to simplify the codebase.
- Updated the HTML to utilize the new latency formatting method, ensuring consistent display of average latency metrics.
- Enhanced the LogRequest function to accurately calculate and update average latency based on request counts, improving metrics accuracy.
- 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.
- Updated latency formatting in Go and JavaScript to display three decimal places for improved precision.
- Enhanced LogRequest function to store only the main domain of the referer, improving data clarity.
- Added MarshalJSON method to SystemMetrics for better JSON representation of request counts.
- 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.
- 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.
- Added a new function to format latency metrics in both Go and JavaScript for improved readability.
- Updated the LogRequest function to parse and store only the domain of the referer, enhancing data clarity.
- Modified the recent requests and top referers display logic in the HTML to improve performance and maintainability.
- Ensured that the recent requests are displayed in a more user-friendly format, including formatted latency values.
- 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.
- 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.
- Changed log_file path in config.json to point to /root/data/logs/server.log.
- Updated BASE_URL in docker-compose.yml to use https://example.net/random-api for improved clarity and consistency.
- Removed unnecessary volume mounts for public and logs in docker-compose.yml.
- Updated Dockerfile to create necessary directories under /root/data.
- Modified start.sh to copy files to the new public directory location.
- Enhanced config.go to create default configuration and directory structure if not present.
- Adjusted router.go to serve static files from the new public directory path.
- Moved the configuration loading to occur before creating necessary directories.
- Improved code clarity by ensuring that configuration is loaded prior to any directory operations.
- 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.
Update the GitHub Actions workflow to include Go setup, multi-arch builds, and push multi-arch Docker images. Also, refactor the CSV service to improve logging and caching mechanism.