Skip to content

feat!: v6 - #93

Open
kakkokari-gtyih wants to merge 88 commits into
misskey-dev:masterfrom
kakkokari-gtyih:feat-v6
Open

kakkokari-gtyih wants to merge 88 commits into
misskey-dev:masterfrom
kakkokari-gtyih:feat-v6

Conversation

@kakkokari-gtyih

@kakkokari-gtyih kakkokari-gtyih commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

実験中

Fix #59
Fix #27
Fix #5
Fix #4
Close #75
Close #42

6.0.0 / Unreleased

v6 では、内部実装を一から見直し、よりパフォーマンスが向上したほか、プラグインシステムの刷新により、プラグインの開発における開発者体験を改善しています。

summaly() の呼び出し方と SummalyResult の形は v5 と変化していません。

破壊的変更

  • Node.js ^22.22.2 || ^24.17.0 || >=26.4.0 が必要になりました
  • package.json に exports を追加し、各部をサブパスエクスポートにより取り出せるようになりました(任意の深いパスの import はできません)
  • Fastify プラグインのデフォルトエクスポートを廃止し、@misskey-dev/summaly/fastify の fastifySummaly に移動しました
    • fastify は optional な peerDependencies になり、自動ではインストールされません
  • プラグインシステムを刷新しました
    • 【重要】 プラグインは @misskey-dev/summaly/plugin の defineSummalyPlugin() で定義できます。summarize は通信のための関数を持つ ctx (SummalyPluginContext) を引数で受け取ります。
    • 【重要】 name が必須になりました。summaly: で始まる名前は組み込みプラグイン用に予約されています
    • summaly() 実行時に渡したプラグインは、組み込みプラグインより先に test されます。
    • 【重要】 summarize が null を返すと、failed summarize のエラーではなく、汎用の規則で要約します
    • GeneralScrapingOptions 型を廃止しました。プラグインの型はルートではなく @misskey-dev/summaly/plugin から公開します
  • summalyDefaultOptions を廃止しました。既定値を変えるには createSummaly(base) を使ってください
  • ルートから公開する型を SummalyResult、SummalyOptions、SummalyInstance、Player にしました(Summary は @misskey-dev/summaly/plugin から公開します)
  • agent の型が got の Agents から { http?: http.Agent, https?: https.Agent } になりました
    • プライベート IP アドレスの判定を agent に任せるかどうかは、scheme ごとに決まります。agent.http だけを渡した場合、https: の要求は summaly が判定します。
  • Fastify プラグイン(スタンドアロンサーバー)が要約に失敗したときの応答を { error: { name, message, statusCode?, statusMessage?, isPermanentError?, code? } } にしました
  • スタンドアロンサーバーは built/server.js ではなく built-server/server.mjs になり、npm パッケージには含まれなくなりました

新機能

  • createSummaly(base) で、設定と接続を共有する summaly のインスタンスを作れるようになりました
    • close()(と await using)で、実行中の要約を待ってから接続を閉じます
  • @misskey-dev/summaly/cache を追加しました。キャッシュ(SummaryCache)と同時要求の共有(InflightCoordinator、InProcessCoordinator)を、渡したときだけ使います
  • プラグインの ctx を通した通信にも、プライベート IP アドレスの遮断・agent・proxy・User-Agent・タイムアウト・サイズ上限がかかります
  • allowedPrivateNetworks オプションで、プライベート IP アドレスの遮断から除外するネットワークを指定できるようになりました
  • proxy オプションで、外向きのプロキシを指定できるようになりました
  • Fastify プラグインが、Misskey が Summaly プロキシに送るクエリ(userAgent、followRedirects、タイムアウト、サイズ)を読むようになりました
    • 登録時のオプションがクエリより優先され、タイムアウトとサイズはクエリで厳格化できますが、設定値以上に緩和することはできません
  • Fastify プラグイン(スタンドアロンサーバー)が、成功した要約の応答に Cache-Control ヘッダーを付けるようになりました
    • 既定値は public, max-age=86400, stale-while-revalidate=43200 です。cacheControl オプション(スタンドアロンサーバーでは SUMMALY_CACHE_CONTROL)で変更でき、false に設定すると付与しません
  • スタンドアロンサーバーの機能を拡充しました
    • GET /healthz を追加しました
    • 結果を短時間キャッシュし、同じ URL への同時の要求を 1 本にまとめます(SUMMALY_CACHE_TTL、SUMMALY_ERROR_CACHE_TTL)
    • SUMMALY_ALLOWED_PRIVATE_NETWORKS と HTTP_PROXY / HTTPS_PROXY / NO_PROXY を読むようになりました
    • 依存を 1 ファイルにバンドルし、Docker イメージを軽量化しました
      • HEALTHCHECK を追加しました

挙動の変化

  • プライベート IP アドレスの遮断を、応答を受け取った後ではなく接続する前に行います。リダイレクトの各段と、oEmbed・favicon の要求も対象です
  • 必要ない場面ではページの <head> だけを解析するようにし、本文の解析を効率化しました
  • 文字コードの判定を改善しました
  • contentLengthLimit が、受信したバイト数に加えて展開後のバイト数にもかかります。圧縮された応答でも content-length ヘッダーを上限と比べます
  • タイムアウトに 0 を指定すると、タイムアウトしなくなります
  • oEmbed と favicon の要求にも、User-Agent・タイムアウト・サイズ上限がかかります
  • URL の検証処理を強化しました
  • 1 つのインスタンスの要求どうしで、サイトへの接続を短時間使い回します
  • 抽出結果の細部が変わる場合があります

samunohito and others added 30 commits November 11, 2026 10:26
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- guard が有効なホップは transport 専用の agent(guarded lookup 付き)を使い、
  http.globalAgent の共有プールのソケットを使い回さない (R11)
- 呼び出し側の agent がない scheme は guard を残す (R12)
- 圧縮された受信バイト数も contentLengthLimit で数える (R14)
- 127.0.0.2 を bind できない環境ではリダイレクトのテストを skip する (R13)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
htmlparser2 の Parser でストリーム処理し、</head> か <body> の開始で
meta/link の収集を止める。<title> が head の外にしかない場合に備え、
停止後も title だけは探す。エンティティはデコードせず生の値を返す。
Amazon プロバイダ用に cheerio の loadDom も用意した。

実測 (Node 24.20.0, 約 400KB の HTML, 1 回あたりの平均, 200 回):
  parseHead     0.171 ms
  cheerio.load  16.805 ms (約 100 倍)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- assertHostAllowed が検証したアドレスを返し、CONNECT の宛先にそれを使う(IPv6 は角括弧付き)。
  Host ヘッダと TLS の SNI・証明書検証は元のホスト名のまま(R25)
- hpagent をやめ、CONNECT トンネルを自前で実装。ハンドシェイクを responseTimeout で打ち切り、
  オペレーションの中断でも待機中の CONNECT を閉じる。sendRequest も中断時に即座に reject する
- createTransport で http:/https: 以外やホスト名のないプロキシ URL を TypeError にする(R26)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…I の Node 22/24/26 matrix を追加(Ruling R44)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… lookup の any をなくす(Ruling R48)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…わせ、終了時の keep-alive 接続を閉じる。終了処理のテストと README の注記を追加(Ruling R51)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
コード中の判断番号への参照(Ruling Rxx)も外す。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BOM → Content-Type の charset → 先頭 8KB の <meta charset> → 先頭 16KB だけ chardet → utf-8
の順に判定する。本家はページ全体に chardet をかけており、350KB のページで約 57ms と
要約処理の大半を占めていた。手元のベンチでは 1件あたり 58ms → 約 1.5ms(本家は約 110ms)。

- ラベルは WHATWG の正規名に揃える(x-sjis → shift_jis など)
- meta の utf-16 系は utf-8、x-user-defined は windows-1252 として扱う(HTML の仕様どおり)
- コメント内の meta や、ほかの属性値の中の charset= は読まない
- 先頭 16KB が ASCII だけのときは、全体が UTF-8 として正しいか確かめ、だめなら全体で chardet

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- summarize / createSummarizer / defaultSummarizeOptions / SummaryResult / SummarizeOptions / SummaryPlugin を正式名にする
- summaly / createSummaly / summalyDefaultOptions と Summaly* 型は正式名と同じ実体を指す別名として export する
- CHIRAMISS_ALLOW_PRIVATE_IP を読み、なければ SUMMALY_ALLOW_PRIVATE_IP を使う(空文字は未設定扱い)
- キャッシュキーには解決後の許可の有無を入れ、どちらの変数名で許可しても同じキーになるようにする
- 正式名を使う型検査用ファイル test/compat/chiramiss-usage.ts を追加

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 各設定は CHIRAMISS_<NAME> を読み、未設定または空文字なら SUMMALY_<NAME> を使う
- 不正値のエラーメッセージには実際に読んだ変数名を出す
- ServerConfig.summalyOptions を summarizeOptions に改名し、lib の正式名(createSummarizer / SummarizeOptions)を使う
- 既存の SUMMALY_* のテストはそのまま通し、CHIRAMISS_* の読み取り・優先順・フォールバック・エラーメッセージのテストを追加

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kakkokari-gtyih and others added 11 commits November 12, 2026 18:29
- 依存関係: got と escape-regexp を外し、htmlparser2 を追加。ライブラリの依存はキャレット指定にする
- engines を chiramiss と同じ ^22.22.2 || ^24.17.0 || >=26.4.0 にする
- typecheck と typecheck:compat を追加し、CI でも実行する
- tsconfig の対象に test を加え、vitest に test/setup.ts を設定する
- サーバーは @tiramiss-community/chiramiss ではなく @/index.js を読み込むようにする
- サーバーのテストのパスを単一パッケージの配置に合わせる
- scripts/check-no-fastify.mjs が Windows で壊れたパスを使っていたのを直す
- SIGTERM を扱えない Windows では、終了処理のテストを飛ばす

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 公開名を summaly のものに戻し、別名を削除する
  (summarize → summaly、createSummarizer → createSummaly、defaultSummarizeOptions → summalyDefaultOptions、
  SummaryResult → SummalyResult、SummarizeOptions → SummalyOptions、SummaryPlugin → SummalyPlugin)
- 環境変数は SUMMALY_* だけを読む(CHIRAMISS_* を廃止)
- 既定の User-Agent を v5 と同じ SummalyBot/<version> (+https://github.com/misskey-dev/summaly/blob/master/README.md) に戻す
- ServerConfig のフィールド名を summalyOptions に戻す
- Derived from ヘッダー、upstream や chiramiss を基準にした説明、過去のレビューを指す見出しを整理する
- 別名のテストと CHIRAMISS_* の優先順位のテスト、フィクスチャの NOTICE.md を削除する
- test/compat/host-usage.ts を misskey-dev/misskey の使い方に合わせる

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
名前の置き換えで文字列の中まで置換されていたのを直す。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in から公開する

プラグインは defineSummalyPlugin() で作り、summarize() は ctx を 1 つ受け取る。

- ctx は url、options(既定値を埋めた値)、fetch、fetchPage、summarizePage、general を持つ。
  どのリクエストも要約と同じ接続設定(プライベート IP の遮断、allowedPrivateNetworks、proxy、agent、
  User-Agent、タイムアウト、サイズ上限)を通る
- 呼び出し側のプラグインを組み込みより先に試す
- summarize() が null を返したら汎用の規則で要約する。失敗させるときは throw する
- 戻り値は一部のフィールドだけでよく、残りは null、空の player、sensitive: false で補う
- name を必須にし、キャッシュのキーはプラグインの名前で作る(プロセスをまたいで同じキーになる)。
  名前の重複、defineSummalyPlugin で作っていないプラグインは TypeError。summaly: で始まる名前は組み込み用に予約
- 組み込みプラグインも defineSummalyPlugin と同じ形で書き、src/plugins に戻す
- キャッシュのキーに summaly のバージョンを含める
- package.json に exports(.、./plugin、./package.json)を追加し、./plugin のエントリをビルドする

BREAKING CHANGE: { test, summarize(url, opts) } 形式のプラグインと GeneralScrapingOptions 型を廃止した。
プラグインの型はルートではなく @misskey-dev/summaly/plugin から公開する。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SummalyPluginDefinition の test と summarize を関数型のプロパティとして宣言し、組み込みプラグインと
サンプルもアロー関数で書く。this では呼ばないので、定義の関数をそのまま持つ。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- cache と coordinator は渡されたときだけ使う。どちらもなければ保存の仕組みを通さず、結果とエラーをそのまま返す
- SummaryCache.set(key, entry) にし、保存するかどうかと TTL はキャッシュが決める
- @misskey-dev/summaly/cache を追加し、InProcessCoordinator と SummaryCache、CacheEntry、SerializedError、
  InflightCoordinator を公開する(ルートからは外す)
- MemorySummaryCache はスタンドアロンサーバー専用にし、TTL を持たせる(成功は ttl、失敗は errorTtl)。
  サーバーは既定でこれと InProcessCoordinator を使い、SUMMALY_CACHE_TTL / SUMMALY_ERROR_CACHE_TTL はその TTL になる
- createSummaly は SummalyInstance を返す。close()(と Symbol.asyncDispose)は新しい呼び出しを拒否し、
  実行中の呼び出しを待ってから接続を破棄する。サーバーは終了時に close() する
- summaly() の既定のインスタンスは最初の呼び出しで作り、import しただけでは何も作らない
- summalyDefaultOptions を廃止する

BREAKING CHANGE: 既定でキャッシュと同時要求の共有をしない。cacheTtl / errorCacheTtl オプション、
summalyDefaultOptions、ルートからの MemorySummaryCache と InProcessCoordinator の公開を廃止した。
SummaryCache.set は ttl を受け取らない。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- デフォルトエクスポートの Fastify プラグインを廃止し、./fastify の fastifySummaly にする
  - 登録ごとに summaly のインスタンスを作り、Fastify の onClose で close() する
  - Misskey が要約プロキシに送るクエリ(lang、userAgent、followRedirects、タイムアウト、サイズ)を読む。
    登録時の値がクエリより優先され、タイムアウトとサイズはクエリで厳しくできても緩められない
  - url が文字列でなければ 400
- スタンドアロンサーバーは fastifySummaly を登録し、/healthz を足すだけにする
- サーバーは fastify を含む依存ごと built-server/server.mjs にバンドルし、npm には含めない。
  バンドルしたパッケージのライセンスを THIRD-PARTY-LICENSES.txt に書き出す
- Docker イメージは node_modules を持たず、server.mjs とライセンスだけを入れる。HEALTHCHECK を追加
- fastify を optionalDependencies から optional な peerDependencies にする
- fastify を使えるのを src/fastify.ts と src/server/ に限る lint ルールを入れ、.d.ts を grep する
  scripts/check-no-fastify.mjs を廃止する。consistent-type-imports も有効にする
- typecheck:compat を、fastify を含まない厳密な検査と ./fastify の利用例の検査に分ける

BREAKING CHANGE: デフォルトエクスポート(Fastify プラグイン)と FastifyLike 型を廃止した。
fastify は自動ではインストールされない。サーバーは built/server.js ではなく built-server/server.mjs になる。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GET / が 500 で返す { error } を SummalyErrorBody にする。

- name と message(1024 文字まで)を常に含める。v5 の { error: e } では Error の message が列挙されず、
  通常のエラーでは中身が空になっていた
- HTTP エラー(StatusError)なら statusCode、statusMessage、isPermanentError を、
  Node.js のシステムエラーなら code(ENOTFOUND など)を含める
- スタックは含めない

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- エントリーは src/index.ts(.)、src/cache/index.ts(./cache)、src/fastify/index.ts(./fastify)、
  src/plugin/index.ts(./plugin)で、どれも再エクスポートだけを書く
- createSummaly と summaly の実装を src/summaly.ts に、Fastify プラグインの本体を src/fastify/plugin.ts に移す
- src/coalesce を src/cache に、組み込みプラグインの src/plugins を src/builtin-plugins に改名し、
  一覧を list.ts にする(plugin/ と plugins/ の取り違えを避ける)
- 内部のモジュールが index.ts を import しないよう lint で制限し、src/http/proxy/index.ts の再エクスポートをやめる
- ルートから Summary と ProxyOptions の公開をやめる(Summary は ./plugin から公開している)

BREAKING CHANGE: ルートから Summary と ProxyOptions 型を公開しない。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SKIP_NETWORK_TEST=true(CI)のときは飛ばす。期待値は現在の YouTube のページに合わせて取り直した。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 160 files, which is 60 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d94fefb0-eb1e-47b7-9597-ce35c55562be
Commits

Reviewing files that changed from the base of the PR and between 921dbaf and cc60514.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 160

  • .github/workflows/test.yml
  • .gitignore
  • CHANGELOG.md
  • Dockerfile
  • README.md
  • oxlint.config.ts
  • package.json
  • src/builtin-plugins/amazon.ts
  • src/builtin-plugins/bluesky.ts
  • src/builtin-plugins/branchio-deeplinks.ts
  • src/builtin-plugins/list.ts
  • src/builtin-plugins/wikipedia.ts
  • src/cache/in-process-coordinator.ts
  • src/cache/index.ts
  • src/cache/key.ts
  • src/cache/run.ts
  • src/cache/types.ts
  • src/context.ts
  • src/extract/fields.ts
  • src/extract/general.ts
  • src/extract/icon.ts
  • src/extract/oembed.ts
  • src/extract/sensitive.ts
  • src/extract/text.ts
  • src/extract/urls.ts
  • src/fastify/error.ts
  • src/fastify/index.ts
  • src/fastify/plugin.ts
  • src/fastify/query.ts
  • src/general.ts
  • src/html/dom.ts
  • src/html/head.ts
  • src/http/address-guard.ts
  • src/http/agent-pool.ts
  • src/http/decode.ts
  • src/http/proxy/no-proxy.ts
  • src/http/proxy/proxy-url.ts
  • src/http/proxy/tunnel.ts
  • src/http/request.ts
  • src/http/status-error.ts
  • src/http/transport.ts
  • src/index.ts
  • src/iplugin.ts
  • src/options.ts
  • src/plugin/context.ts
  • src/plugin/define.ts
  • src/plugin/index.ts
  • src/plugins/amazon.ts
  • src/plugins/bluesky.ts
  • src/plugins/branchio-deeplinks.ts
  • src/plugins/index.ts
  • src/plugins/wikipedia.ts
  • src/server/app.ts
  • src/server/config.ts
  • src/server/index.ts
  • src/server/memory-cache.ts
  • src/summaly.ts
  • src/summary.ts
  • src/types.ts
  • src/util/integer.ts
  • src/utils/cleanup-title.ts
  • src/utils/clip.ts
  • src/utils/encoding.ts
  • src/utils/got.ts
  • src/utils/null-or-empty.ts
  • src/version.ts
  • test/address-guard.test.ts
  • test/agent-pool.test.ts
  • test/coalesce.test.ts
  • test/compat/cache-usage.ts
  • test/compat/fastify-usage.ts
  • test/compat/host-usage.ts
  • test/compat/plugin-usage.ts
  • test/connection-reuse.test.ts
  • test/decode.test.ts
  • test/docker.test.ts
  • test/fastify.test.ts
  • test/fixtures/amazon.html
  • test/fixtures/htmls/activitypub.html
  • test/fixtures/htmls/basic.html
  • test/fixtures/htmls/dirty-title.html
  • test/fixtures/htmls/fediverse-creator.html
  • test/fixtures/htmls/meta-adult-sensitive.html
  • test/fixtures/htmls/meta-rta-sensitive.html
  • test/fixtures/htmls/mixi-sensitive.html
  • test/fixtures/htmls/no-favicon.html
  • test/fixtures/htmls/no-metas.html
  • test/fixtures/htmls/oembed-and-og-video.html
  • test/fixtures/htmls/oembed-and-og.html
  • test/fixtures/htmls/oembed-nonexistent-path.html
  • test/fixtures/htmls/oembed-relative.html
  • test/fixtures/htmls/oembed-wrong-path.html
  • test/fixtures/htmls/oembed.html
  • test/fixtures/htmls/og-description.html
  • test/fixtures/htmls/og-image.html
  • test/fixtures/htmls/og-site_name.html
  • test/fixtures/htmls/og-title.html
  • test/fixtures/htmls/player-peertube-video.html
  • test/fixtures/htmls/player-pleroma-image.html
  • test/fixtures/htmls/player-pleroma-video.html
  • test/fixtures/htmls/twitter-card-player.html
  • test/fixtures/htmls/twitter-card-summary-large-image.html
  • test/fixtures/htmls/twitter-card-summary.html
  • test/fixtures/htmls/twitter-description.html
  • test/fixtures/htmls/twitter-image.html
  • test/fixtures/htmls/twitter-title.html
  • test/fixtures/oembed/invalid/oembed-child-iframe.json
  • test/fixtures/oembed/invalid/oembed-double-iframes.json
  • test/fixtures/oembed/invalid/oembed-future.json
  • test/fixtures/oembed/invalid/oembed-insecure.json
  • test/fixtures/oembed/invalid/oembed-invalid-height.json
  • test/fixtures/oembed/invalid/oembed-no-height.json
  • test/fixtures/oembed/invalid/oembed-no-version.json
  • test/fixtures/oembed/invalid/oembed-old.json
  • test/fixtures/oembed/invalid/oembed-photo.json
  • test/fixtures/oembed/invalid/oembed-too-powerful.json
  • test/fixtures/oembed/invalid/oembed-too-powerful2.json
  • test/fixtures/oembed/oembed-allow-fullscreen-legacy.json
  • test/fixtures/oembed/oembed-allow-fullscreen.json
  • test/fixtures/oembed/oembed-allow-safelisted-permissions.json
  • test/fixtures/oembed/oembed-iframe-child.json
  • test/fixtures/oembed/oembed-ignore-rare-permissions.json
  • test/fixtures/oembed/oembed-percentage-width.json
  • test/fixtures/oembed/oembed-too-tall.json
  • test/fixtures/oembed/oembed-video.json
  • test/fixtures/oembed/oembed.json
  • test/fixtures/sjis.html
  • test/general.test.ts
  • test/head.test.ts
  • test/helpers/defined.ts
  • test/helpers/json-cache.ts
  • test/helpers/loopback-agent.ts
  • test/helpers/run-source.ts
  • test/helpers/source-hooks.mjs
  • test/helpers/test-server.ts
  • test/helpers/tls-cert.ts
  • test/icon-cache.test.ts
  • test/index.test.ts
  • test/instance.test.ts
  • test/network.test.ts
  • test/oembed/invalid/oembed-no-html.json
  • test/plugins.test.ts
  • test/proxy.test.ts
  • test/request.test.ts
  • test/server.test.ts
  • test/server/app.test.ts
  • test/server/config.test.ts
  • test/server/memory-cache.test.ts
  • test/server/shutdown.test.ts
  • test/setup.ts
  • test/summaly.test.ts
  • test/text.test.ts
  • test/tsconfig.json
  • test/urls.test.ts
  • test/version.test.ts
  • tsconfig.compat-fastify.json
  • tsconfig.compat.json
  • tsconfig.json
  • tsdown.config.ts
  • vitest.config.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

kakkokari-gtyih and others added 6 commits November 12, 2026 19:58
…ない (misskey-dev#4)

ページの meta や link、プラグインの戻り値にある javascript: などの URL が、そのまま結果に出ていた。
要約の最後にすべての結果へかけ、許可しない値は null にする。

- icon、thumbnail: http(s) と画像の data: URL
- player.url(iframe に読み込まれる)、activityPub: http(s) のみ

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ページと oEmbed の解析は htmlparser2 で行い、cheerio を使うのは本文を読む Amazon プラグインだけになっている。
loadDom で cheerio を動的に import し、Amazon のページを要約しないプロセスでは読み込まないようにする。

サーバーのバンドルでは cheerio が別のチャンクになるため、Docker イメージには built-server/ の中身をすべて入れる。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
前段のリバースプロキシや CDN でキャッシュできるよう、Fastify プラグインは成功した要約の応答に
Cache-Control を付ける。

- 既定値は public, max-age=86400, stale-while-revalidate=43200
- cacheControl オプションで変更でき、false なら付けない。スタンドアロンサーバーでは SUMMALY_CACHE_CONTROL
- 400 と 500 の応答には付けない(一時的な失敗が前段に長くキャッシュされないように)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v5 では読めていたページが v6 で文字化けしていたのを直す。

- content-type や meta が UTF-8 でも、本文が UTF-8 として正しくなければ、宣言はなかったものとして
  次の手がかり(meta、chardet)で判定する
- content-type の windows-1252(ISO-8859-1)は、サーバーの既定値として送られがちなため、
  ページの meta と chardet の後に使う
- 先頭 16KB が ASCII だけかどうかを自前で確かめる。chardet は ASCII だけのサンプルを ISO-8859-1 と
  答えることがあり、全体での判定し直しに進まなかった。ASCII だけなら chardet を呼ばない
  (ISO-2022-JP のエスケープ(ESC)は ASCII 以外として扱う)
- UTF-8 の確認でデコードした結果はそのまま使い、デコードを 2 回しない

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kakkokari-gtyih and others added 4 commits November 12, 2026 20:01
v6 のサーバーは要約をキャッシュするため、他のテストと同じ URL では 2 回目の要求がフィクスチャのサーバーに届かず、
受け取った User-Agent が空になっていた。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kakkokari-gtyih
kakkokari-gtyih marked this pull request as ready for review November 12, 2026 14:12
@samunohito

Copy link
Copy Markdown
Member

レビューは @syuilo 氏にしたほうが良さそう…?

  • ベースが拙作のsummalyコンパチなのでレビューの意味が薄い
  • プロダクトのコードベースを丸ごと置き換える方針転換なのでメンテナ同士で進められる範囲を逸脱している(明確に定められているわけではないが、何となくそう思う)

@syuilo

syuilo commented Nov 13, 2026

Copy link
Copy Markdown
Member

lgtm

@samunohito
samunohito removed their request for review November 13, 2026 06:08
@samunohito

Copy link
Copy Markdown
Member

(あっさりOKでたけど)1つ目のことがあるので、とりあえずレビュアーからはunassignしておきます

@kakkokari-gtyih

Copy link
Copy Markdown
Member Author

いれるか

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cheerioやめる キャッシュ機能を持たせる UNIXドメインソケットへのリクエストの拒否 出力URLのサニタイズ

3 participants