Commit Graph

768 Commits

Author SHA1 Message Date
VnPower bbf77baec3 Fix responses logging without any content 2024-10-02 19:31:59 +07:00
VnPower ca0750ef88 Move test files to a separate folder 2024-10-02 18:53:49 +07:00
VnPower 2e861b69ac Proposed testing procedure 2024-09-29 19:31:22 +07:00
perennial b3b8d5117c revert to net/url in config.go 2024-09-29 20:10:38 +10:00
VnPower fe227013c9 Bump Playwright version 2024-09-29 16:56:17 +07:00
VnPower 684d18cf25 Fix App API base 2024-09-29 16:56:15 +07:00
iacore 5f8b659b49 use urlx.Parse 2024-09-28 23:12:00 +00:00
iacore 7899dd3c73 add to feature ideas 2024-09-28 23:01:31 +00:00
VnPower 24a977bfab Note for App API 2024-09-28 19:56:41 +07:00
VnPower 08ffd72dc6 App API base for credentials 2024-09-28 19:23:49 +07:00
VnPower 58f1d36114 Modify instance rules 2024-09-26 20:43:08 +07:00
VnPower f1a98404dc Add instance rules 2024-09-26 20:07:13 +07:00
VnPower cbca734426 Fix sidebar overlapping with navbar 2024-09-26 19:31:02 +07:00
perennial 4ad1d59bc0 Actually fix caching in Dockerfile.testing 2024-09-25 18:40:18 +10:00
perennial c197d8b383 Create compose.testing.yaml
Everything finally works
2024-09-25 18:34:51 +10:00
perennial 5343575f09 Fix caching in Dockerfile.testing 2024-09-25 18:14:24 +10:00
perennial 87a39887fc Fix Dockerfile.testing 2024-09-25 17:32:58 +10:00
perennial 7aec0d9075 Add Dockerfile for testing 2024-09-25 17:20:19 +10:00
perennial 32739f7dad Add test case for LoadConfig 2024-09-25 17:20:19 +10:00
perennial 10250205f0 Add test case for parseRevision 2024-09-25 17:20:19 +10:00
perennial c03355d939 Create unit tests for validateURL 2024-09-25 17:20:19 +10:00
perennial 5d4cae7505 Require both scheme and host in validateURL
Prevents random strings like "hrpuohreoghpaeuog" from being
considered valid.
2024-09-25 17:20:19 +10:00
perennial 64761db5c1 Remove duplicate log message on startup 2024-09-25 17:20:19 +10:00
iacore 079993e801 Use proper rate limiter
Rename package handlers to middleware, since most are middleware

router.go is not middleware. can be moved out to router/router.go
2024-09-25 05:05:04 +00:00
iacore 1868c7a539 clean up 2024-09-24 18:56:01 +00:00
iacore ee2f2ba104 Log response. Fix #116 2024-09-24 18:46:00 +00:00
VnPower 18d6874e89 Merge pull request 'Implement series navigation info in novel page' (#114) from jackyzy823/PixivFE:novel-nav into v2
Reviewed-on: https://codeberg.org/VnPower/PixivFE/pulls/114
2024-09-24 12:51:02 +00:00
perennial 6a1334658a Improve About page content and add domain information
Update the About page to provide clearer information about the PixivFE instance.
Add functionality to display the current domain name.
2024-09-24 21:47:08 +10:00
perennial e00ad1dad8 docs: format and update Proposals page 2024-09-24 20:43:35 +10:00
perennial c00d8ea042 docs: update Reference Material page with API resources 2024-09-24 20:05:22 +10:00
perennial 7cb210fc4f docs: fix link to ext doc in README 2024-09-24 19:48:59 +10:00
perennial c3bb477132 Rename token management environment variables
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.
2024-09-24 19:32:14 +10:00
perennial ae031dbd8b Add option to disable image proxy checker
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.
2024-09-24 19:08:40 +10:00
perennial 305f574f15 Refactor proxy checker initialisation and shutdown
Restructure the proxy checking logic to use a ticker for periodic checks
when a non-zero interval is set. Improve handling of zero interval case
by waiting for a stop signal. Improve stop mechanism and initialisation
of stopChan.

Also introduce a new test file proxy_checker_test.go for unit testing.
2024-09-24 18:41:40 +10:00
perennial 198258b641 Remove unused funcs in token_manager_test 2024-09-24 16:28:53 +10:00
perennial ed2f5c9dc0 Merge pull request 'docs: add comments to package handlers' (#115) from perennial/PixivFE:handlers-comments into v2
Reviewed-on: https://codeberg.org/VnPower/PixivFE/pulls/115
2024-09-24 06:25:20 +00:00
perennial 722988986b Format handlers/doc.go 2024-09-24 16:21:29 +10:00
perennial 2442f6598c Add tutorial to router.go 2024-09-24 16:10:01 +10:00
perennial 3c1bb0badb Add comments to package handlers 2024-09-24 15:51:23 +10:00
jackyzy823 5a558a6b7d Implement series navigation info in novel page 2024-09-23 22:57:57 +08:00
perennial 32a52d4f29 Remove unused functions in token_manager 2024-09-24 00:37:13 +10:00
perennial 79f5c99ae3 Actual token exhaustion error handling and messaging
Actually reset all tokens to initial state when exhausted in retryRequest and
provide a more informative error message.
2024-09-24 00:24:08 +10:00
perennial 6ffb1e0c1f Merge pull request 'Implement random User-Agent selection' (#113) from perennial/PixivFE:random-ua into v2
Reviewed-on: https://codeberg.org/VnPower/PixivFE/pulls/113
2024-09-23 12:38:06 +00:00
perennial 7473aa14bd Run gofmt 2024-09-23 22:35:35 +10:00
perennial 7fcec3ff75 Add unit tests for user_agent_list 2024-09-23 22:35:20 +10:00
perennial d1534682e2 Implement random User-Agent selection
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.
2024-09-23 22:30:26 +10:00
perennial d25b3a3ec9 Add comments to HTTP utility functions and client 2024-09-23 21:20:24 +10:00
perennial d5fe921c2b docs: fix headings on env vars page 2024-09-23 15:29:06 +10:00
perennial b49e8609ae docs: network proxy configuration
ref: https://codeberg.org/VnPower/PixivFE/pulls/111
2024-09-23 15:25:25 +10:00
VnPower 1ff1f1e5e2 Merge pull request 'Support *_PROXY env' (#111) from jackyzy823/PixivFE:proxy_env into v2
Reviewed-on: https://codeberg.org/VnPower/PixivFE/pulls/111
2024-09-23 04:54:34 +00:00