Commit Graph

67 Commits

Author SHA1 Message Date
iacore 4a0bcf2f58 Translate short strings 2024-10-07 05:05:47 +00:00
jackyzy823 0b304ef8ab fix: escape external url in some template and add a fallback router. 2024-10-07 10:24:25 +08:00
jackyzy823 4098c489ad fix: get user info after checking correct id 2024-10-07 00:55:53 +08:00
jackyzy823 10dfaa477b fix: i18n error for manga routes 2024-10-06 12:00:46 +08:00
VnPower 317c1dac71 Merge pull request 'feat: implement manga series' (#120) from jackyzy823/PixivFE:manga-series into v2
Reviewed-on: https://codeberg.org/VnPower/PixivFE/pulls/120
2024-10-06 03:38:31 +00:00
perennial 991fcea714 revert proxy server pooling 2024-10-06 01:50:19 +10:00
iacore d99c974745 use http client from utils 2024-10-05 15:32:10 +00:00
iacore 2f4e95d002 Capture error strings for i18n 2024-10-05 15:19:22 +00:00
jackyzy823 d912a78f3a feat: implement manga series 2024-10-05 22:59:45 +08:00
iacore 546f83df20 make regex constructions global 2024-10-05 14:58:32 +00:00
iacore c70f3aaa8f cleanup 2024-10-05 14:25:00 +00:00
perennial 5ced43adbc Fix failing compilation + gofmt 2024-10-05 21:37:46 +10:00
iacore 7cb6ac50c6 simplify proxy checker 2024-10-04 16:04:08 +00:00
iacore 91c2a7a0ba Restore user Atom page support 2024-10-02 14:36:26 +00:00
VnPower c78b207231 Fix: don't use urlx for pagination
goware/urlx fails if the supplied URL doesn't contain a host?
(The URL passed to the CreatePaginator() template function was actually a path,
which did not contain a host or a scheme.)
2024-10-02 19:54:44 +07:00
iacore 5f8b659b49 use urlx.Parse 2024-09-28 23:12:00 +00: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
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 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 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 d25b3a3ec9 Add comments to HTTP utility functions and client 2024-09-23 21:20:24 +10:00
jackyzy823 db798db95b Support *_PROXY env 2024-09-22 22:55:29 +08:00
VnPower 37ee3d1877 Merge pull request 'Novel comments and special marks' (#108) from jackyzy823/PixivFE:novel-page-improve into v2
Reviewed-on: https://codeberg.org/VnPower/PixivFE/pulls/108
2024-09-22 14:06:08 +00:00
VnPower 4d5b8b2209 Pixivision: Tag page 2024-09-22 20:39:51 +07:00
perennial 8a2f817ae6 Add configurable repository URL
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.
2024-09-22 20:57:29 +10:00
perennial d977ae7d62 Improve version and revision info handling
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.
2024-09-22 20:57:28 +10:00
jackyzy823 517fef6e78 Support special marks for novel
1. `rb` mark for furigana
2. `jumpuri` mark to open link externally
3. `chapter` mark
4. `jump` to jump to page num anchor
5. Refactor `newpage` mark
2024-09-22 18:28:48 +08:00
jackyzy823 c61cc0dd3f Implement novel comments 2024-09-22 18:28:48 +08:00
perennial a8aaefef37 Restore user token precedence and rename GetPixivToken
This commit restores the ability to use a user-provided token when
making API requests and gives it precedence over the default token
provided by tokenManager.

Additionally, the function GetPixivToken has been renamed to
GetUserToken for clarity.
2024-09-22 02:27:32 +10:00
VnPower 7af2e9a500 Merge pull request 'Display revision on about page' (#104) from jackyzy823/PixivFE:about-revision into v2
Reviewed-on: https://codeberg.org/VnPower/PixivFE/pulls/104
2024-09-21 14:40:33 +00:00
jackyzy823 b1526fc751 Add novel series to render test 2024-09-21 18:17:17 +08:00
jackyzy823 87b3656818 Fix render test 2024-09-21 18:16:59 +08:00
perennial 9bab56f6dd proxy checker: fix staticcheck issues 2024-09-21 19:18:52 +10:00
perennial 6492663203 Refactor audit Init function for readability
Simplify the conditional logic in the Init function by using an early
return when optionSaveResponse is false. Move the MaxRecordedCount
assignment and directory creation outside the conditional block to
improve code structure and readability.
2024-09-20 18:30:17 +10:00
perennial 2647143a05 Add logging statements in audit 2024-09-20 18:28:44 +10:00
perennial 6a6fb803a4 Remove redundant responseSaveLocation variable
Replace local responseSaveLocation variable in audit_init.go
with direct references to config.GlobalConfig.ResponseSaveLocation.
2024-09-20 18:09:34 +10:00
perennial b480df0e7f Add configurable response save location
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.
2024-09-20 16:09:41 +10:00
perennial 316ca993e9 Add inline comments to audit_log.go 2024-09-20 15:16:47 +10:00
VnPower cbf870c989 Merge pull request 'Implement exponential backoff for API requests and token management' (#101) from perennial/PixivFE:tokenmanager into v2
Reviewed-on: https://codeberg.org/VnPower/PixivFE/pulls/101
2024-09-19 14:31:03 +00:00
VnPower 8e9342fb1f Pixivision category 2024-09-19 21:30:01 +07:00
perennial 4c0cb79470 Run make fmt 2024-09-19 20:04:19 +10:00
perennial 5c35d87371 Edit settings in token_manager_test.go 2024-09-19 20:03:46 +10:00
perennial c0aaedfc3b Add test suite for token_manager
This commit introduces a new file token_manager_test.go containing
unit tests for the token_manager package.

The test suite covers various aspects, including initialisation,
token selection methods, status updates, fallback mechanisms, and
concurrent access.
2024-09-19 19:51:24 +10:00
perennial bc19f485a2 Add separate API request level backoff mechanism
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.
2024-09-19 16:27:22 +10:00