Commit Graph

256 Commits

Author SHA1 Message Date
Nya Candy 68c7430fbb
feat(core): opentelementry support (update of #14668) (#16087)
* chore: squash commit

* fix: tweak some mentioned issues

---------

Co-authored-by: incubator4 <aries0robin@gmail.com>
2024-07-05 19:22:33 +08:00
DIYgod 53edbc7e62
test: fix rate limiter duration 2024-05-26 20:51:30 +08:00
DIYgod e16f95c546
feat: add outgoing request rate limit 2024-05-26 17:18:48 +08:00
DIYgod e3f57a17e0
feat: temporarily disable request timeout 2024-05-26 15:58:43 +08:00
github-actions[bot] 9af421ae2f style: auto format 2024-05-10 14:46:15 +00:00
Tony 41c6861d88
fix(got): posting form as x-www-form-urlencoded (#15348) 2024-04-24 00:10:53 +08:00
Rongrong f3cf86cd72
fix(core/utils/wechat-mp): empty description when request blocked by WAF (#15294)
* fix(core/utils/wechat-mp): empty description when request blocked by WAF

Silently falling back to the fallback method would generate empty
description. Fixed by throwing an error when failed to extract
item_show_type from the page.

Some misc warnings are also added to make bug reporting easier.

Signed-off-by: Rongrong <i@rong.moe>

* fix(core/utils/wechat-mp): err msg for unknown page

Signed-off-by: Rongrong <i@rong.moe>

* test(core/utils/wechat-mp): fix coverage

Signed-off-by: Rongrong <i@rong.moe>

* fix(core/utils/wechat-mp): ESLint no-await-in-loop

Signed-off-by: Rongrong <i@rong.moe>

* fix(core/utils/wechat-mp): normalizeUrl: &amp; -> &

Signed-off-by: Rongrong <i@rong.moe>

* feat(core/utils/wechat-mp): do not prompt raising an issue when blocked
by WAF

Signed-off-by: Rongrong <i@rong.moe>

* feat(core/utils/wechat-mp): recognize deleted page

Signed-off-by: Rongrong <i@rong.moe>

* feat(core/utils/wechat-mp): log when error

Prevent errors from being completely suppressed if the caller catches
them.

Signed-off-by: Rongrong <i@rong.moe>

---------

Signed-off-by: Rongrong <i@rong.moe>
2024-04-22 02:19:33 +08:00
Mg Pig 8eccccc59c
fix(core): request-rewriter proxy ignore loopback address and puppeteer ws endpoint (#15293) 2024-04-19 23:58:43 +08:00
Tony 9ef453e501 style: run prettier before eslint 2024-04-18 22:44:04 +08:00
github-actions[bot] a11404ee02 style: auto format 2024-04-18 14:07:09 +00:00
Rongrong a99b35f257
feat(core/utils/wechat-mp): major rewrite (#15276)
* feat(core/utils/wechat-mp): major rewrite

* Support more `item_show_type`: `APP_MSG_PAGE`, `VIDEO_SHARE_PAGE`,
`AUDIO_SHARE_PAGE`, and `IMG_SHARE_PAGE`. Previously only the first one
could be parsed properly. There are still some other known types waiting
for live examples for further adaptation. If this is the case, a
fallback method will try to generate entries using mostly OpenGraph
metadata. Meanwhile, the administrator of self-hosted instances will see
warnings in the log, asking them to report the URL as a new live
example. Still, `VIDEO_SHARE_PAGE` explicitly uses the fallback method
without any warning, as there is no possible approach to generate a
video/iframe URL from page metadata.

* Show audio and videos in `APP_MSG_PAGE`. However, not all videos
can be shown due to the same reason as `VIDEO_SHARE_PAGE`.

* Show the location where the article is sent.

* Some bugs, mostly due to outdated cheerio selector, are fixed.

* Add a new sub-route `wechat-mp` to `/test` to make things easier.

* All changes are well-tested.

Signed-off-by: Rongrong <i@rong.moe>

* style(core/utils/wechat-mp): fix ESLint & CodeQL errors

Signed-off-by: Rongrong <i@rong.moe>

* style(core/utils/wechat-mp): fix a DeepScan issue

Signed-off-by: Rongrong <i@rong.moe>

* style(core/utils/wechat-mp): fix ESLint error

Another try w/ pre-commit hook disabled.

Signed-off-by: Rongrong <i@rong.moe>

---------

Signed-off-by: Rongrong <i@rong.moe>
2024-04-18 22:05:32 +08:00
Henry Wang 5c3711cbcc
feat: support .rss3 output type (#15258)
Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
2024-04-18 02:10:33 +08:00
Prajna a51cc049bf
feat: add javdb session config and cookieJar to fakeGot (#14782)
* feat: add javdb session config

* fix: Return data instead of setting ctx.set in JavDB routes

* docs: Add JavDB login instructions to config.md

* docs: Add note about javdb session validity in config.md

* fix: Return data instead of setting ctx.set in JavDB routes

* fix: Update route path in javdb index.ts

Remove '/:category?/:sort?/:filter?', it will cause other module routes to be inaccessible

* chore: Remove unused cookie variable in ProcessItems function

* chore: Unnecessary changes

* chore: Add JAVDB sessions in alphabetical order.

* docs: Add JAVDB sessions in alphabetical order.

* feat: Add support for passing cookies in headers

* test: Add cookieJar test to got.test.ts

* Update lib/utils/got.ts

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* feat: Update JavDB routes to include optional JAVDB_SESSION in requireConfig

---------

Co-authored-by: zhaoyi.wu <zhaoyi.wu@amh-group.com>
2024-04-12 19:30:42 +08:00
Tony 0893debb07
style(eslint): lint tsx (#15098) 2024-04-04 20:28:45 +08:00
xtex 06a995b9aa
feat(routes): Add censorbib (#15082)
* feat(routes): Add censorbib

* fix: Make got options optional

* Update lib/routes/nymity/censorbib.ts

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

---------
2024-04-04 01:17:49 +08:00
JimenezLi 690b06e680
fix(core): buffer responseType (#15083) 2024-04-03 23:01:02 +08:00
JimenezLi 3d3286db6d
fix(core): fix Git Hash unknown (#15041)
* fix: replace git-rev-sync with node function

* fix: replace git-rev-sync in routes-deprecated
2024-04-02 01:28:35 +08:00
DIYgod bc2fd88abf
test: longger puppeteer timeout 2024-04-02 01:26:23 +08:00
DIYgod 39f8eeb1fc
test: add ofetch tests 2024-04-01 21:00:32 +08:00
DIYgod bf4e5dd78f
test: fix caces 2024-03-31 23:13:22 +08:00
DIYgod f7048d4c24
fix: ignore url parsing error 2024-03-31 02:45:40 +08:00
DIYgod 8c50e2f96f
test: request-rewriter 2024-03-31 02:28:58 +08:00
DIYgod d83c951d8c
fix: proxy auth 2024-03-31 02:28:26 +08:00
DIYgod 59631b2e9b
test: request-rewriter headers 2024-03-30 18:30:41 +08:00
DIYgod bec0ba0705
test: request headers 2024-03-30 18:29:38 +08:00
DIYgod a828b3dd1c
feat: request rewriter 2024-03-30 18:21:14 +08:00
DIYgod 176e773013
fix: setting dispatcher in options 2024-03-28 19:39:29 +08:00
DIYgod 4287da8e9c
Merge remote-tracking branch 'origin/master' into feature/ofetch 2024-03-28 03:11:10 +08:00
DIYgod 759c03cd23
feat: intercept undici and use fetch dispatcher 2024-03-28 02:45:08 +08:00
DIYgod 23104cd1f6
feat: use undici 2024-03-28 02:42:24 +08:00
DIYgod 2a366ef56d
test: rss-parser test 2024-03-27 16:18:37 +08:00
DIYgod a87ec36450
test: got test 2024-03-27 16:15:39 +08:00
DIYgod bcd5f6ff8b
test: rand-user-agent test 2024-03-27 15:37:51 +08:00
DIYgod 3016a2f44f
test: fix wechat-mp test 2024-03-27 14:53:43 +08:00
DIYgod 760f48b8cf
test: fix common-config test 2024-03-27 14:49:43 +08:00
DIYgod 8c0534393f
feat: use ofetch in parameter common-config wechat-mp 2024-03-27 14:40:42 +08:00
Tony 6e53d7263c
fix(core): accept header not working (#14961) 2024-03-26 03:02:47 +08:00
DIYgod 07c891caa6
feat: remove timeout test 2024-03-26 01:15:06 +08:00
DIYgod d190d9d700
test: ofetch got 2024-03-26 00:33:36 +08:00
DIYgod 81bf135e96
fix: ofetch searchParams and form 2024-03-25 02:00:47 +08:00
DIYgod 9f7de5ab9a
Merge remote-tracking branch 'origin/master' into feature/ofetch 2024-03-24 23:30:19 +08:00
DIYgod f837345f36
fix: remove require 2024-03-24 21:20:18 +08:00
DIYgod e5a9fd46ee
feat: use ofetch imitate got 2024-03-23 02:03:55 +08:00
DIYgod 2789ed96e5
chore: upgrade got (#14913)
* chore: upgrade got

* fix: new got
2024-03-22 22:42:29 +08:00
DIYgod 40350abcbb
feat: use jsx (#14863)
* feat: render rss using jsx

* fix: error page response header

* feat: render atom using jsx

* feat: export art

* feat: use jsxRenderer

* chore: upgrade hono
2024-03-21 00:28:11 +08:00
SettingDust e76e0ab547
fix(modrinth): fix the path & adapt to typescript (#14765) 2024-03-12 14:33:34 +00:00
DIYgod d3a8747711
feat: recover google chrome extension 2024-03-06 18:17:25 +08:00
DIYgod 1b1915edca
fix: custom got response type 2024-03-05 23:04:28 +08:00
Tony d17ebe81d0
feat(index): add back hot stats (#14664) 2024-03-05 13:55:39 +08:00
TonyRL eea1607fca fix: add type exports for got 2024-03-04 16:21:13 +00:00