[Bug]: Config parse errors, with config.toml lines, are sent to every signed-in user

オープン 初心者向け
#102 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
backend, security

調査の方向性

各サブスクライバーがイベントを受け取る src/api/events.rs の132行目あたりにあるサブスクリプションハンドラーから始め、me と libraries がどのように translate に渡されるかを追ってください。次に src/config/store.rs の356行目あたりを読み、Event::ConfigError に何が含まれるかを正確に確認してください。非管理者にはエラーテキストのない単純な ConfigChanged が届き、管理者には引き続き表示され、管理者フラグが translate に正しく渡されれば完了です。既存のイベントテストでパターンを確認してください。

索引モデルが issue の本文から書いたものです。

説明

bug

[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a code review session with @PhrolovaMoe. It was found by reading the code and hasn't been reproduced on a running server.

Version

0.40.0 (feat/desktop, 017a837b)

Area

Config

What happened?

When config.toml changes on disk and fails to parse, the watcher sends Event::ConfigError with the parser's message (src/config/store.rs:356). The events subscription passes it to every subscriber, admin or not (src/api/events.rs:132). toml's error message quotes the offending line, so if that line holds a TMDB key, SMTP password or Torznab API key, every signed-in user receives it.

Steps to reproduce
  1. Sign in as a non-admin in one browser and keep a page open (it subscribes to events).
  2. Break a line containing a secret in config.toml, e.g. api-key = "abc (missing quote).
  3. The non-admin's events subscription gets a ConfigChanged with the line in error.
Expected behavior

Only admins get the error text; everyone else gets a plain ConfigChanged (or nothing).

Suggested fix

Filter Event::ConfigError (and ConfigChanged) by is_admin in translate, which needs the user's admin flag passed in alongside me and libraries.

主要言語
TypeScript
スター
4
フォーク
1
平均マージ
4時間 49分
マージ済み PR(30日)
5

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tinystream-dev/tinystream のほかの issue

tinystream-dev/tinystream の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。