Add: #600 NGルール (#602)

* Wip

* Wip

* Wip: History

* Wip: テストコード作成

* Fix test

* Wip

* Wip

* Wip

* Fix test

* Wip

* Wip

* Wip

* Wip

* なんとか完成、これから動作確認

* spell miss

* Change ng rule timings

* Fix test

* Wip

* Fix test

* Wip

* Fix form

* 表示まわりの改善
This commit is contained in:
KMY(雪あすか) 2024-02-26 17:45:41 +09:00 committed by GitHub
parent 0779c748a6
commit 7d96d5828e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 2062 additions and 42 deletions

View file

@ -647,9 +647,108 @@ en:
title: IP rules
media_attachments:
title: Media attachments
ng_rules:
account_avatar_state: Has avatar or not
account_display_name: Name
account_domain: Domain
account_field_name: Field name
account_field_value: Field value
account_header_state: Has header or not
account_include_local: Contains local users
account_note: Account note
account_username: ID
copy: Copy
copy_error: Copy failed.
edit:
headers:
account: Account
options: Options
reaction: Reaction
status: Post
helps:
generic: Restrictions will be in effect only if all items match the criteria.
textarea_html: <strong>Where multiple lines can be entered</strong>, enter conditions separated by line breaks. If any one of the multiple lines is included, the condition is considered a match. You can use a regular expression by starting a line with "?" at the beginning of a line to use a regular expression.
threshold_html: <strong>In specifying the upper limit</strong>, specifying "-1" disables the upper limit check. If "0" is specified, the check will pass only if the subject is completely absent. For example, an upper limit of "0" for the number of media is not equivalent to "no media.
history: Check the history of this rule's application.
summary:
account: Set the conditions for the account. This NG rule will be checked when an account matching here posts and reacts. No check is performed when an account is created. By default, all accounts are subject to this rule.
reaction: Set the reaction conditions. The account conditions must match at the same time. Please note that by default, not all reactions will match unless you set the "Reaction Type".
status: Set the conditions of your submission. The account conditions must match at the same time. Please note that by default, not all posts will be applicable unless you set the "Visibility" and "Searchability".
title: Edit NG Rule
index:
delete: Delete
disabled: Disabled
edit:
title: Edit
empty: Empty NG rules
empty_title: Empty title
hit_count: "%{count} hits on this week"
preamble: While NG words are sufficient to deal with normal spam, some of these words must be specified too loosely, making it easier for other normal postings to get caught up in the restrictions. You can also specify the details of the account and the characteristics of the post in the NG rule. NG rules also support the prevention of spam using reactions.
title: NG Rules
new:
save: Save new NG rule
title: Add new NG Rule
reaction_type: Reaction type
reaction_types:
emoji_reaction: Emoji reaction
favourite: Favourite
follow: Follow
reblog: Boost
vote: Vote
reaction_allow_follower: Allow all reactions targeted at followers
reaction_allow_follower_hint: If enabled, reactions between other servers are unconditionally allowed
record_history_also_local: Local users are also subject to history recording
rubular: Regular Expression Checker
states:
needed: have
no_needed: Should not have
optional: Optional
status_allow_follower_mention: Check posts only if they contain mentions/references to non-followers
status_allow_follower_mention_hint: If enabled, mentions between other servers are unconditionally allowed
status_cw_state: Has warning or not
status_media_state: Has media or not
status_media_threshold: Medias limit
status_mention_state: Has mention or not
status_mention_threshold: Mentions limit
status_poll_state: Has poll or not
status_poll_threshold: Poll items limit
status_quote_state: Has quote or not
status_reference_state: Has reference or not
status_reference_threshold: Has reference or not
status_reply_state: Is reply or not
status_searchability: Searchability
status_sensitive_state: Is sensitive or not
status_spoiler_text: Content warning
status_tag: Tag
status_text: Post text
status_visibility: Visibility
test_error: Regular expression syntax is incorrect.
title: NG Rule
ng_rule_histories:
back_to_ng_rule: Back to NG rule
back_to_ng_rules: Back to index
data:
media_count: "%{count} medias"
poll_count: "%{count} polls"
from_local_user: Local user
hidden: Private post
moderate_account: Moderate account
reason_actions:
reaction_emoji_reaction: Emoji reaction
reaction_favourite: Favourite
reaction_follow: Follow request
reaction_reblog: Boost
reaction_vote: Vote
status_create: Post
status_edit: Edit post
title: NG Rule History %{title}
ng_words:
block_unfollow_account_mention: Reject all mentions/references from all accounts that do not have followers on your server
block_unfollow_account_mention_hint: この設定は削除予定です。設定削除後は、常にチェックをつけていない場合と同じ挙動になります。NGルールで代替してください。
deprecated: Will remove settings
deprecated_hint: These settings will be removed in the next LTS or kmyblue version 14.0, whichever comes first. Please refer to the description of each setting and replace them with the new settings if possible.
hide_local_users_for_anonymous: Hide timeline local user posts from anonymous
hide_local_users_for_anonymous_hint: この設定は削除予定です。設定削除後は、常にチェックをつけていない場合と同じ挙動になります。サーバー設定の「見つける」にある「公開タイムラインへの未認証のアクセスを許可する」で、完全ではありませんが代替可能です。
history_hint: We recommend that you regularly check your NG words to make sure that you have not specified the NG words incorrectly.
hold_remote_new_accounts: Hold new remote accounts
keywords: Reject keywords
@ -657,15 +756,18 @@ en:
keywords_for_stranger_mention_hint: This words are checked posts from other servers only.
keywords_hint: The first character of the line is "?". to use regular expressions
permit_new_account_domains: Domain list to automatically approve new users
preamble: This setting is very useful when you receive spam or harassment from many servers, or when you encounter other problems that cannot be solved by domain blocking. You can reject posts received from other servers or within your own server that contain specific keywords or too many mentions. Please consider this setting carefully to ensure that posts that are not problematic are not deleted. Rejected posts will be recorded in your history unless they are limited posts. If you need more detailed settings, please use another feature, "NG Rules".
post_hash_tags_max: Hash tags max for posts
post_mentions_max: Mentions max for posts
post_stranger_mentions_max: 投稿に設定可能なメンションの最大数 (If the mentions include at least one person who is not a follower of yours)
remote_approval_list: List of remote accounts awaiting approval
remote_approval_hint: Newly recognized accounts with unspecified domains will be placed in Suspended status. You can review that list and approve them if necessary. If this setting is not enabled, all remote accounts will be approved immediately.
stranger_mention_from_local_ng: フォローしていないアカウントへのメンションのNGワードを、ローカルユーザーによる投稿にも適用する
stranger_mention_from_local_ng_hint: サーバーの登録が承認制でない場合、あなたのサーバーにもスパムが入り込む可能性があります
stranger_mention_from_local_ng_hint: この設定は削除予定です。設定削除後は、常にチェックをつけている場合と同じ挙動になります。この動作を希望しない場合は、NGルールで代替してください。
test_error: Testing is returned any errors
title: NG words and against spams
white_list: White list
white_list_hint: Unlike a normal whitelist, all previous accounts are marked as trusted, and all newly recognized accounts are placed on hold. Activating the whitelist does not immediately eliminate external attacks, but it can gradually and surely reduce them through moderation. In addition, a periodic remote account approval process is required.
ngword_histories:
back_to_ng_words: NG words and against spams
target_types:
@ -856,9 +958,9 @@ en:
title: Server rules
sensitive_words:
alert: This post contains sensitive words, so alert added
hint: This keywords is applied to public posts only..
keywords: Sensitive keywords
keywords_for_all: Sensitive keywords (Contains CW alert)
hint: The sensitive keywords setting is applied to the "Public", "Local Public", and "Logged-in Users Only" public ranges that flow through the local timeline. A mandatory warning text will be added to any post that meets the criteria.
keywords: Sensitive keywords for local posts
keywords_for_all: Sensitive keywords for local posts (Contains CW alert)
keywords_for_all_hint: The first character of the line is "?". to use regular expressions
title: Sensitive words and moderation options
settings:
@ -1954,6 +2056,7 @@ en:
public_search_long: You can search all posts permitted to search
public_unlisted: Local and followers
public_unlisted_long: Local users and followers can find
unset: (Unsupported servers)
show_more: Show more
show_newer: Show newer
show_older: Show older
@ -1961,8 +2064,10 @@ en:
title: '%{name}: "%{quote}"'
too_many_hashtags: Too many hashtags
too_many_mentions: Too many mentions
violate_rules: Violate NG rules
visibilities:
direct: Direct
limited: Limited
login: Login only
login_long: Only logined users
private: Followers-only

View file

@ -640,9 +640,114 @@ ja:
title: IPルール
media_attachments:
title: 投稿された画像
ng_rules:
account_allow_followed_by_local: ローカルユーザーからフォローされていないアカウントのみチェックする
account_allow_followed_by_local_hint: 1以上のフォローを持つ全てのローカルユーザーが信頼できる場合にのみこのオプションを使用してください
account_avatar_state: アイコンの有無
account_display_name: 名前
account_domain: ドメイン
account_field_name: フィールド名
account_field_value: フィールド値
account_header_state: ヘッダーの有無
account_include_local: ローカルユーザーを含む
account_note: アカウントの説明文
account_username: ID
available: 有効にする
copy: 複製
copy_error: 複製に失敗しました。
edit:
headers:
account: アカウント
options: オプション
reaction: リアクション
status: 投稿
helps:
generic: 全ての項目が条件にマッチしている場合のみ、制限が有効になります。
textarea_html: <strong>複数行入力可能な箇所</strong>では、改行区切りで条件を入力します。複数行のうちどれか1つが含まれている場合、条件にマッチしたと判断されます。行頭を「?」で始めると正規表現を利用できます。
threshold_html: <strong>上限の指定</strong>では、「-1」を指定すると上限チェックが無効になります。「0」を指定した場合、その対象が全く無い状態に限りチェックを通過します。例えばメディア数の上限「0」は、「メディア無し」と等価ではありません。
history: このルールが適用された履歴を確認する
summary:
account: アカウントの条件を設定します。ここでマッチしたアカウントが投稿・リアクションする場合に、このNGルールのチェックが行われます。アカウント作成時のチェックは行いません。初期状態では全てのアカウントが対象になります。
reaction: リアクションの条件を設定します。アカウントの条件も同時に一致しなければいけません。初期状態では、「リアクションの種類」を設定しない限り全てのリアクションが該当しませんので、ご注意ください。
status: 投稿の条件を設定します。アカウントの条件も同時に一致しなければいけません。初期状態では、「公開範囲」「検索許可」を設定しない限り全ての投稿が該当しませんので、ご注意ください。
title: NGルールを編集
emoji_reaction_name: 絵文字リアクションで使われる絵文字またはショートコード
emoji_reaction_origin_domain: 絵文字リアクションで使われたカスタム絵文字のドメイン
emoji_reaction_origin_domain_hint: 他のサーバーの絵文字に相乗りした場合、その絵文字がもともと登録されていたサーバーのドメインが使用されます
index:
delete: 削除
disabled: 無効
edit:
title: 編集
empty: NGルールが空です
empty_title: 空のタイトル
hit_count: ここ一週間で %{count} 件の検出
preamble: 通常のスパムへの対応にはNGワードで十分ですが、中にはどうしても緩すぎる条件を指定しなければならず、他の正常な投稿が規制に巻き込まれやすくなる場合があります。NGルールにおいてアカウントや投稿の特徴などを詳細に指定して、巻き込まれる投稿を少しでも減らすことができます。また、リアクションを使用したスパムの防止もサポートしています。
title: NGルール
new:
save: 新規NGルールを保存
title: 新規NGルールを追加
reaction_allow_follower: フォロワー以外に対するリアクションのみチェックする
reaction_allow_follower_hint: これを有効にすると、他のサーバー同士のリアクションは無条件で許可されます
reaction_type: リアクションの種類
reaction_types:
emoji_reaction: 絵文字リアクション
favourite: お気に入り
follow: フォロー
reblog: ブースト
vote: 投票
record_history_also_local: ローカルユーザーも履歴記録の対象とする
rubular: 正規表現チェッカー
states:
needed: 有り
no_needed: 無し
optional: 不問
status_allow_follower_mention: フォロワー以外へのメンション・参照を含む場合のみ投稿をチェックする
status_allow_follower_mention_hint: これを有効にすると、他のサーバー同士のメンションは無条件で許可されます
status_cw_state: 警告文の有無
status_media_state: メディアの有無
status_media_threshold: メディア数の上限
status_mention_state: メンションの有無
status_mention_threshold: メンション数の上限
status_poll_state: 投票の有無
status_poll_threshold: 投票項目数の上限
status_quote_state: 引用の有無
status_reference_state: 参照の有無
status_reference_threshold: 参照数の上限
status_reply_state: 返信の有無
status_searchability: 検索許可
status_sensitive_state: センシティブフラグの有無
status_spoiler_text: 投稿警告文
status_tag: タグ
status_text: 投稿本文
status_visibility: 公開範囲
test_error: 正規表現の文法が誤っています
title: NGルール
ng_rule_histories:
back_to_ng_rule: NGルール設定に戻る
back_to_ng_rules: 一覧に戻る
data:
media_count: "%{count} のメディア"
poll_count: 項目 %{count} の投票
from_local_user: ローカルユーザー
hidden: 非公開投稿
moderate_account: アカウントをモデレートする
reason_actions:
reaction_emoji_reaction: 絵文字リアクション
reaction_favourite: お気に入りに登録
reaction_follow: フォローリクエスト
reaction_reblog: ブースト
reaction_vote: 投票
status_create: 投稿
status_edit: 投稿を編集
title: NGルール「%{title}」の履歴
ng_words:
block_unfollow_account_mention: 自分のサーバーのフォロワーを持たない全てのアカウントからのメンション・参照を全て拒否する
block_unfollow_account_mention_hint: この設定は削除予定です。設定削除後は、常にチェックをつけていない場合と同じ挙動になります。NGルールで代替してください。
deprecated: 新しいバージョンで削除する予定の設定
deprecated_hint: これらの設定は、次回のLTS、またはkmyblueバージョン14.0のどちらか早い方で削除する予定です。それぞれの設定の説明を参照して、可能であれば新しい設定に置き換えてください。
hide_local_users_for_anonymous: ログインしていない状態でローカルユーザーの投稿をタイムラインから取得できないようにする
hide_local_users_for_anonymous_hint: この設定は削除予定です。設定削除後は、常にチェックをつけていない場合と同じ挙動になります。サーバー設定の「見つける」にある「公開タイムラインへの未認証のアクセスを許可する」で、完全ではありませんが代替可能です。
history_hint: 設定されたNGワードによって実際に拒否された投稿などは、履歴より確認できます。NGワードの指定に誤りがないか定期的に確認することをおすすめします。
hold_remote_new_accounts: リモートの新規アカウントを保留する
keywords: 投稿できないキーワード
@ -650,15 +755,18 @@ ja:
keywords_for_stranger_mention_hint: フォローしていないアカウントへのメンション、参照、引用にのみ適用されます
keywords_hint: 行を「?」で始めると、正規表現が使えます
permit_new_account_domains: 新規ユーザーを自動承認するドメイン
preamble: スパムや嫌がらせを多くのサーバーから受け取った場合など、ドメインブロックで解決できない問題が発生した場合にこの設定が非常に役に立ちます。他のサーバーからの受信や自分のサーバー内で、特定キーワードが含まれていたり、メンション数が多すぎたりする投稿を拒否することができます。問題のない投稿が削除されないよう、設定は慎重に検討してください。拒否された投稿は、限定投稿でない限り履歴に記録されます。さらに細かい設定が必要な場合は、別の機能である「NGルール」をお使いください。
post_hash_tags_max: 投稿に設定可能なハッシュタグの最大数
post_mentions_max: 投稿に設定可能なメンションの最大数
post_stranger_mentions_max: 投稿に設定可能なメンションの最大数 (メンション先にフォロワー以外を1人でも含む場合)
remote_approval_list: 承認待ちのリモートアカウント一覧
remote_approval_hint: 指定されていないドメインで新しく認識されたアカウントはサスペンド状態になります。その一覧を確認し、必要であれば承認を行うことができます。この設定が有効でない場合、全てのリモートアカウントが即座に承認されます。
stranger_mention_from_local_ng: フォローしていないアカウントへのメンションのNGワードを、ローカルユーザーによる投稿にも適用する
stranger_mention_from_local_ng_hint: サーバーの登録が承認制でない場合、あなたのサーバーにもスパムが入り込む可能性があります
stranger_mention_from_local_ng_hint: この設定は削除予定です。設定削除後は、常にチェックをつけている場合と同じ挙動になります。この動作を希望しない場合は、NGルールで代替してください。
test_error: NGワードのテストに失敗しました。正規表現のミスが含まれているかもしれません
title: NGワードとスパム
white_list: ホワイトリスト
white_list_hint: 通常のホワイトリストとは異なり、これまでのアカウントは全て信頼済としてマークされ、新たに認識されるアカウントが全て保留中となります。ホワイトリストを有効にしたところで外部からの攻撃が即座に消えるわけではありませんが、モデレーションを進めることで徐々に確実に減らすことができます。また、定期的なリモートアカウント承認作業が求められます。
ngword_histories:
back_to_ng_words: NGワードとスパム
target_types:
@ -846,9 +954,9 @@ ja:
title: サーバーのルール
sensitive_words:
alert: この投稿にはセンシティブなキーワードが含まれるため、警告文が追加されました
hint: センシティブなキーワードの設定は、当サーバーのローカルユーザーによる公開範囲「公開」「ローカル公開」「ログインユーザーのみ」に対して適用されます。
keywords: センシティブなキーワード(警告文は除外)
keywords_for_all: センシティブなキーワード(警告文にも適用)
hint: センシティブなキーワードの設定は、ローカルタイムラインを流れる公開範囲「公開」「ローカル公開」「ログインユーザーのみ」に対して適用されます。条件に該当した投稿には強制的に警告文章が追加されます。
keywords: ローカル投稿のみに適用するセンシティブなキーワード(警告文は除外)
keywords_for_all: ローカル投稿のみに適用するセンシティブなキーワード(警告文にも適用)
keywords_for_all_hint: ここで指定したキーワードを含む投稿は強制的にCWになります。警告文にも含まれていればCWになります。行が「?」で始まっていれば正規表現が使えます
keywords_hint: ここで指定したキーワードを含む投稿は強制的にCWになります。ただし警告文に使用していた場合は無視されます
title: センシティブ単語と設定
@ -1927,6 +2035,7 @@ ja:
public_search_long: 検索が許可された全ての投稿が検索できます
public_unlisted: ローカルとフォロワー
public_unlisted_long: ローカル・フォロワー・反応者のみが検索できます
unset: (未対応サーバー)
show_more: もっと見る
show_newer: 新しいものを表示
show_older: 古いものを表示
@ -1934,8 +2043,10 @@ ja:
title: '%{name}: "%{quote}"'
too_many_hashtags: ハッシュタグが多すぎます
too_many_mentions: メンションが多すぎます
violate_rules: サーバールールに違反するため投稿できません
visibilities:
direct: ダイレクト
limited: 限定投稿
login: ログインユーザーのみ
login_long: ログインしたユーザーのみが見ることができます
private: フォロワー限定

View file

@ -50,6 +50,7 @@ SimpleNavigation::Configuration.run do |navigation|
s.item :reports, safe_join([fa_icon('flag fw'), t('admin.reports.title')]), admin_reports_path, highlights_on: %r{/admin/reports}, if: -> { current_user.can?(:manage_reports) }
s.item :accounts, safe_join([fa_icon('users fw'), t('admin.accounts.title')]), admin_accounts_path(origin: 'local'), highlights_on: %r{/admin/accounts|/admin/pending_accounts|/admin/disputes|/admin/users}, if: -> { current_user.can?(:manage_users) }
s.item :ng_words, safe_join([fa_icon('list fw'), t('admin.ng_words.title')]), admin_ng_words_path, highlights_on: %r{/admin/(ng_words|ngword_histories)}, if: -> { current_user.can?(:manage_ng_words) }
s.item :ng_rules, safe_join([fa_icon('rub fw'), t('admin.ng_rules.title')]), admin_ng_rules_path, highlights_on: %r{/admin/(ng_rules|ng_rule_histories)}, if: -> { current_user.can?(:manage_ng_words) }
s.item :sensitive_words, safe_join([fa_icon('list fw'), t('admin.sensitive_words.title')]), admin_sensitive_words_path, highlights_on: %r{/admin/sensitive_words}, if: -> { current_user.can?(:manage_sensitive_words) }
s.item :invites, safe_join([fa_icon('user-plus fw'), t('admin.invites.title')]), admin_invites_path, if: -> { current_user.can?(:manage_invites) }
s.item :follow_recommendations, safe_join([fa_icon('user-plus fw'), t('admin.follow_recommendations.title')]), admin_follow_recommendations_path, highlights_on: %r{/admin/follow_recommendations}, if: -> { current_user.can?(:manage_taxonomies) }

View file

@ -34,6 +34,12 @@ namespace :admin do
resources :warning_presets, except: [:new, :show]
resource :ng_words, only: [:show, :create]
resources :ngword_histories, only: [:index]
resources :ng_rules, except: [:show] do
member do
post :duplicate
end
end
resources :ng_rule_histories, only: [:show]
resource :sensitive_words, only: [:show, :create]
resource :special_instances, only: [:show, :create]