This commit clarifies the purpose of certain environment variables
by explicitly associating them with token management. The variables
PIXIVFE_MAX_RETRIES, PIXIVFE_BASE_TIMEOUT, and PIXIVFE_MAX_BACKOFF_TIME
are now prefixed with "TOKEN_" to better distinguish them from API-level
settings.
The ServerConfig struct, configuration loading, logging,
and documentation have been updated accordingly.
This commit introduces a new configuration option to disable the image proxy
checker. A new environment variable PIXIVFE_PROXY_CHECK_ENABLED and
corresponding ServerConfig field are added. The main.go file is updated
to conditionally initialise the proxy checker based on this setting.
Documentation is also updated to explain the new configuration options.
This commit introduces a mechanism for randomly selecting User-Agents
from a predefined list to be used for requests to the Pixiv API.
References to setting a custom User-Agent via the PIXIVFE_USERAGENT
environment variable have been removed as it is no longer used.
This commit improves the error handling in the configuration loading
process, specifically for URL validations.
It replaces panic calls with proper error returns and adds
fallback mechanisms for invalid proxy server and repo URLs.
Warning logs are now used for these configuration issues.
This commit introduces a new PIXIVFE_REPO_URL configuration option,
allowing users to specify a custom repository URL.
The about page now uses this configurable URL, and the configuration
loading process has been updated to validate and handle the new option.
Documentation has been updated to reflect these changes.
Modify the REVISION variable to include both commit date and hash.
Update config package to parse and store revision components separately.
Modify about page and routes to display more detailed revision information.
Introduce a new ResponseSaveLocation config option to flexibly store
API responses during development. Move InDevelopment flag to a
dedicated "Development options" section in the config struct.
Update audit package to use the new configurable save location instead
of a hardcoded path.
Implement new backoff settings for API requests, distinct from token
management backoff.
Update config, core request handling, and documentation to reflect the
new API request backoff mechanism. Refactor TokenManager to use the
manager's baseTimeout instead of individual token timeouts.
Introduce a new TokenManager to handle token rotation, status
tracking, and automatic retries with exponential backoff for API
requests. This change aims to improve the reliability API
interactions by intelligently managing tokens and gracefully
handling request failures.
Update API request functions to utilise the new TokenManager. This
commit also adds configuration options for max retries, base timeout,
and max backoff time to fine-tune the retry behavior.