diff --git a/app/models/concerns/has_user_settings.rb b/app/models/concerns/has_user_settings.rb index 09c9521c9b..dd28d9654e 100644 --- a/app/models/concerns/has_user_settings.rb +++ b/app/models/concerns/has_user_settings.rb @@ -71,6 +71,10 @@ module HasUserSettings settings['noindex'] end + def setting_noai + settings['noai'] + end + def setting_theme settings['theme'] end diff --git a/app/models/user_settings.rb b/app/models/user_settings.rb index ee519c6117..9b518d8355 100644 --- a/app/models/user_settings.rb +++ b/app/models/user_settings.rb @@ -11,6 +11,7 @@ class UserSettings setting :aggregate_reblogs, default: true setting :theme, default: -> { ::Setting.theme } setting :noindex, default: -> { ::Setting.noindex } + setting :noai, default: true setting :show_application, default: true setting :default_language, default: nil setting :default_sensitive, default: false diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb index 62a0273e55..c879766c50 100644 --- a/app/serializers/rest/account_serializer.rb +++ b/app/serializers/rest/account_serializer.rb @@ -15,6 +15,7 @@ class REST::AccountSerializer < ActiveModel::Serializer attribute :suspended, if: :suspended? attribute :silenced, key: :limited, if: :silenced? attribute :noindex, if: :local? + attribute :noai, if: :local? attribute :memorial, if: :memorial? @@ -146,6 +147,10 @@ class REST::AccountSerializer < ActiveModel::Serializer object.user_prefers_noindex? end + def noai + object.user&.setting_noai + end + delegate :suspended?, :silenced?, :local?, :memorial?, to: :object def moved_and_not_nested? diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml index 1a644c9022..f1076e04b4 100644 --- a/app/views/accounts/show.html.haml +++ b/app/views/accounts/show.html.haml @@ -4,10 +4,11 @@ - content_for :header_tags do - if @account.user_prefers_noindex? %meta{ name: 'robots', content: 'noindex, noarchive, noai, noimageai' }/ - - else + %meta{ name: 'CCBot', content: 'nofollow' }/ + - elsif @account.user&.setting_noai %meta{ name: 'robots', content: 'noai, noimageai' }/ + %meta{ name: 'CCBot', content: 'nofollow' }/ - %meta{ name: 'CCBot', content: 'nofollow' } %link{ rel: 'alternate', type: 'application/rss+xml', href: @rss_url }/ %link{ rel: 'alternate', type: 'application/activity+json', href: ActivityPub::TagManager.instance.uri_for(@account) }/ diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 9299d5d851..c4ab49dbcd 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,6 +1,8 @@ - content_for :header_tags do - unless request.path == '/' %meta{ name: 'robots', content: 'noindex, noai, noimageai' }/ + - else + %meta{ name: 'robots', content: 'noai, noimageai' }/ %meta{ name: 'CCBot', content: 'nofollow' } = render partial: 'shared/og' diff --git a/app/views/settings/preferences/other/show.html.haml b/app/views/settings/preferences/other/show.html.haml index a44c418c7c..c726c02e1f 100644 --- a/app/views/settings/preferences/other/show.html.haml +++ b/app/views/settings/preferences/other/show.html.haml @@ -11,6 +11,9 @@ .fields-group = ff.input :noindex, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_noindex'), hint: I18n.t('simple_form.hints.defaults.setting_noindex') + .fields-group + = ff.input :noai, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_noai'), hint: I18n.t('simple_form.hints.defaults.setting_noai') + .fields-group = ff.input :aggregate_reblogs, wrapper: :with_label, recommended: true, label: I18n.t('simple_form.labels.defaults.setting_aggregate_reblogs'), hint: I18n.t('simple_form.hints.defaults.setting_aggregate_reblogs') diff --git a/app/views/statuses/show.html.haml b/app/views/statuses/show.html.haml index 9a404890f2..0290dbc361 100644 --- a/app/views/statuses/show.html.haml +++ b/app/views/statuses/show.html.haml @@ -4,9 +4,10 @@ - content_for :header_tags do - if @account.user_prefers_noindex? %meta{ name: 'robots', content: 'noindex, noarchive, noai, noimageai' }/ - - else + %meta{ name: 'CCBot', content: 'nofollow' }/ + - elsif @account.user&.setting_noai %meta{ name: 'robots', content: 'noai, noimageai' }/ - %meta{ name: 'CCBot', content: 'nofollow' } + %meta{ name: 'CCBot', content: 'nofollow' }/ %link{ rel: 'alternate', type: 'application/json+oembed', href: api_oembed_url(url: short_account_status_url(@account, @status), format: 'json') }/ %link{ rel: 'alternate', type: 'application/activity+json', href: ActivityPub::TagManager.instance.uri_for(@status) }/ diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 0355784353..ae4aacc8a7 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -219,6 +219,7 @@ en: setting_display_media_show_all: Show all setting_expand_spoilers: Always expand posts marked with content warnings setting_hide_network: Hide your social graph + setting_noai: Set noai meta tags setting_noindex: Opt-out of search engine indexing setting_public_post_to_unlisted: Convert public post to public unlisted if not using Web app setting_reduce_motion: Reduce motion in animations diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml index 91f037b8d9..3b8362c0d4 100644 --- a/config/locales/simple_form.ja.yml +++ b/config/locales/simple_form.ja.yml @@ -61,6 +61,7 @@ ja: setting_display_media_show_all: メディアを常に表示する setting_hide_network: フォローとフォロワーの情報がプロフィールページで見られないようにします setting_display_media_expand: Misskeyなどは4個を超えて投稿可能です。その追加分を最大8個まで表示します。kmyblueからアップロードはできません + setting_noai: AI学習への利用を禁止するメタタグをプロフィールページに追加します。ただし実効性があるとは限りません setting_noindex: 公開プロフィールおよび各投稿ページに影響します setting_public_post_to_unlisted: 未対応のサードパーティアプリからもローカル公開で投稿できますが、公開投稿はWeb以外できなくなります setting_reject_unlisted_subscription: Misskeyやそのフォーク(Calckeyなど)は、フォローしていないアカウントの「未収載」投稿を **購読・検索** することができます。これはkmyblueの挙動と異なります。そのようなサーバーのうち管理人が指定したものに、指定した公開範囲の投稿を「フォロワーのみ」として配送します。ただし構造上、完璧な対応は困難でたまに未収載として配信されること、ご理解ください @@ -224,6 +225,7 @@ ja: setting_display_media_show_all: 表示 setting_expand_spoilers: 閲覧注意としてマークされた投稿を常に展開する setting_hide_network: 繋がりを隠す + setting_noai: 自分のコンテンツのAI学習利用に対して不快感を表明する setting_noindex: 検索エンジンによるインデックスを拒否する setting_public_post_to_unlisted: サードパーティアプリから投稿するとき、公開投稿をローカル公開に変更する setting_reduce_motion: アニメーションの動きを減らす