diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 2 | ||||
-rw-r--r-- | config/initializers/devise.rb | 2 | ||||
-rw-r--r-- | config/initializers/makara.rb | 2 | ||||
-rw-r--r-- | config/initializers/session_store.rb | 6 | ||||
-rw-r--r-- | config/locales/en.yml | 12 | ||||
-rw-r--r-- | config/locales/ja.yml | 10 | ||||
-rw-r--r-- | config/locales/simple_form.en.yml | 1 | ||||
-rw-r--r-- | config/locales/simple_form.ja.yml | 1 | ||||
-rw-r--r-- | config/routes.rb | 2 | ||||
-rw-r--r-- | config/webpack/development.js | 2 | ||||
-rw-r--r-- | config/webpack/production.js | 2 | ||||
-rw-r--r-- | config/webpack/shared.js | 3 | ||||
-rw-r--r-- | config/webpack/tests.js | 2 |
13 files changed, 42 insertions, 5 deletions
diff --git a/config/application.rb b/config/application.rb index ad6cf82d7..bf467d6c3 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,6 +22,8 @@ require_relative '../lib/mastodon/version' require_relative '../lib/devise/two_factor_ldap_authenticatable' require_relative '../lib/devise/two_factor_pam_authenticatable' require_relative '../lib/chewy/strategy/custom_sidekiq' +require_relative '../lib/webpacker/manifest_extensions' +require_relative '../lib/webpacker/helper_extensions' Dotenv::Railtie.load diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 59e69ad37..ef612e177 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -10,6 +10,7 @@ Warden::Manager.after_set_user except: :fetch do |user, warden| expires: 1.year.from_now, httponly: true, secure: (Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true'), + same_site: :lax, } end @@ -20,6 +21,7 @@ Warden::Manager.after_fetch do |user, warden| expires: 1.year.from_now, httponly: true, secure: (Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true'), + same_site: :lax, } else warden.logout diff --git a/config/initializers/makara.rb b/config/initializers/makara.rb new file mode 100644 index 000000000..dc88fa63c --- /dev/null +++ b/config/initializers/makara.rb @@ -0,0 +1,2 @@ +Makara::Cookie::DEFAULT_OPTIONS[:same_site] = :lax +Makara::Cookie::DEFAULT_OPTIONS[:secure] = Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 3dc0edd6f..e5d1be4c6 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,7 @@ # Be sure to restart your server when you modify this file. -Rails.application.config.session_store :cookie_store, key: '_mastodon_session', secure: (Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true') +Rails.application.config.session_store :cookie_store, { + key: '_mastodon_session', + secure: (Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true'), + same_site: :lax, +} diff --git a/config/locales/en.yml b/config/locales/en.yml index 084006a2a..047ba36ac 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -188,6 +188,8 @@ en: search: Search search_same_email_domain: Other users with the same e-mail domain search_same_ip: Other users with the same IP + sensitive: Sensitive + sensitized: marked as sensitive shared_inbox_url: Shared inbox URL show: created_reports: Made reports @@ -202,6 +204,7 @@ en: time_in_queue: Waiting in queue %{time} title: Accounts unconfirmed_email: Unconfirmed email + undo_sensitized: Undo sensitive undo_silenced: Undo silence undo_suspension: Undo suspension unsilenced_msg: Successfully unlimited %{username}'s account @@ -243,9 +246,11 @@ en: reopen_report: Reopen Report reset_password_user: Reset Password resolve_report: Resolve Report + sensitive_account: Mark the media in your account as sensitive silence_account: Silence Account suspend_account: Suspend Account unassigned_report: Unassign Report + unsensitive_account: Unmark the media in your account as sensitive unsilence_account: Unsilence Account unsuspend_account: Unsuspend Account update_announcement: Update Announcement @@ -281,9 +286,11 @@ en: reopen_report: "%{name} reopened report %{target}" reset_password_user: "%{name} reset password of user %{target}" resolve_report: "%{name} resolved report %{target}" + sensitive_account: "%{name} marked %{target}'s media as sensitive" silence_account: "%{name} silenced %{target}'s account" suspend_account: "%{name} suspended %{target}'s account" unassigned_report: "%{name} unassigned report %{target}" + unsensitive_account: "%{name} unmarked %{target}'s media as sensitive" unsilence_account: "%{name} unsilenced %{target}'s account" unsuspend_account: "%{name} unsuspended %{target}'s account" update_announcement: "%{name} updated announcement %{target}" @@ -1203,6 +1210,8 @@ en: other: "%{count} votes" vote: Vote show_more: Show more + show_newer: Show newer + show_older: Show older show_thread: Show thread sign_in_to_participate: Sign in to participate in the conversation title: '%{name}: "%{quote}"' @@ -1339,6 +1348,7 @@ en: warning: explanation: disable: You can no longer login to your account or use it in any other way, but your profile and other data remains intact. + sensitive: Your uploaded media files and linked media will be treated as sensitive. silence: You can still use your account but only people who are already following you will see your toots on this server, and you may be excluded from various public listings. However, others may still manually follow you. suspend: You can no longer use your account, and your profile and other data are no longer accessible. You can still login to request a backup of your data until the data is fully removed, but we will retain some data to prevent you from evading the suspension. get_in_touch: You can reply to this e-mail to get in touch with the staff of %{instance}. @@ -1347,11 +1357,13 @@ en: subject: disable: Your account %{acct} has been frozen none: Warning for %{acct} + sensitive: Your account %{acct} posting media has been marked as sensitive silence: Your account %{acct} has been limited suspend: Your account %{acct} has been suspended title: disable: Account frozen none: Warning + sensitive: Your media has been marked as sensitive silence: Account limited suspend: Account suspended welcome: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index fb6255546..fd9ec9427 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -172,6 +172,8 @@ ja: search: 検索 search_same_email_domain: 同じドメインのメールアドレスを使用しているユーザー search_same_ip: 同じ IP のユーザーを検索 + sensitive: 閲覧注意 + sensitized: 閲覧注意済み shared_inbox_url: Shared inbox URL show: created_reports: このアカウントで作られた通報 @@ -184,6 +186,7 @@ ja: time_in_queue: "%{time} 待ち" title: アカウント unconfirmed_email: 確認待ちのメールアドレス + undo_sensitized: 閲覧注意から戻す undo_silenced: サイレンスから戻す undo_suspension: 停止から戻す unsubscribe: 購読の解除 @@ -220,9 +223,11 @@ ja: reopen_report: 通報を再度開く reset_password_user: パスワードをリセット resolve_report: 通報を解決済みにする + sensitive_account: アカウントのメディアを閲覧注意にマーク silence_account: アカウントをサイレンス suspend_account: アカウントを停止 unassigned_report: 通報の担当を解除 + unsensitive_account: アカウントのメディアの閲覧注意マークを解除 unsilence_account: アカウントのサイレンスを解除 unsuspend_account: アカウントの停止を解除 update_announcement: お知らせを更新 @@ -256,9 +261,11 @@ ja: reopen_report: "%{name} さんが通報 %{target} を再び開きました" reset_password_user: "%{name} さんが %{target} さんのパスワードをリセットしました" resolve_report: "%{name} さんが通報 %{target} を解決済みにしました" + sensitive_account: "%{name} さんが %{target} さんのメディアを閲覧注意にマークしました" silence_account: "%{name} さんが %{target} さんをサイレンスにしました" suspend_account: "%{name} さんが %{target} さんを停止しました" unassigned_report: "%{name} さんが通報 %{target} の担当を外しました" + unsensitive_account: "%{name} さんが %{target} さんのメディアの閲覧注意を解除しました" unsilence_account: "%{name} さんが %{target} さんのサイレンスを解除しました" unsuspend_account: "%{name} さんが %{target} さんの停止を解除しました" update_announcement: "%{name} さんがお知らせ %{target} を更新しました" @@ -1271,6 +1278,7 @@ ja: warning: explanation: disable: アカウントが凍結されている間、データはそのまま残りますが、凍結が解除されるまでは何の操作もできません。 + sensitive: あなたのアップロードしたメディアファイルとリンク先のメディアは、閲覧注意として扱われます。 silence: あなたのアカウントは制限されていますが、あなたをフォローしているユーザーのみ、このサーバー上の投稿を見ることができます。そしてあなたは様々な公開リストから除外されるかもしれません。ただし、他のユーザーは手動であなたをフォローすることができます。 suspend: あなたのアカウントは停止されています。あなたの投稿とアップロードされたメディアファイルは、このサーバーとあなたのフォロワーが参加していたサーバーから完全に削除されました。 get_in_touch: このメールに返信することで %{instance} のスタッフと連絡を取ることができます。 @@ -1279,11 +1287,13 @@ ja: subject: disable: あなたのアカウント %{acct} は凍結されました none: "%{acct} に対する警告" + sensitive: あなたのアカウント %{acct} の投稿メディアは閲覧注意とマークされました silence: あなたのアカウント %{acct} はサイレンスにされました suspend: あなたのアカウント %{acct} は停止されました title: disable: アカウントが凍結されました none: 警告 + sensitive: あなたのメディアが閲覧注意とマークされました silence: アカウントがサイレンスにされました suspend: アカウントが停止されました welcome: diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index b69487953..46a4759a8 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -100,6 +100,7 @@ en: types: disable: Freeze none: Send a warning + sensitive: Sensitive silence: Limit suspend: Suspend warning_preset_id: Use a warning preset diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml index bbc0b5fd7..00f469b87 100644 --- a/config/locales/simple_form.ja.yml +++ b/config/locales/simple_form.ja.yml @@ -91,6 +91,7 @@ ja: types: disable: ログインを無効化 none: 何もしない + sensitive: 閲覧注意 silence: サイレンス suspend: 停止しアカウントのデータを恒久的に削除する warning_preset_id: プリセット警告文を使用 diff --git a/config/routes.rb b/config/routes.rb index 327dcc58c..e78a2c4d0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -238,6 +238,7 @@ Rails.application.routes.draw do resources :accounts, only: [:index, :show, :destroy] do member do post :enable + post :unsensitive post :unsilence post :unsuspend post :redownload @@ -480,6 +481,7 @@ Rails.application.routes.draw do resources :accounts, only: [:index, :show, :destroy] do member do post :enable + post :unsensitive post :unsilence post :unsuspend post :approve diff --git a/config/webpack/development.js b/config/webpack/development.js index 774ecbc07..c3cf1b655 100644 --- a/config/webpack/development.js +++ b/config/webpack/development.js @@ -1,6 +1,6 @@ // Note: You must restart bin/webpack-dev-server for changes to take effect -const merge = require('webpack-merge'); +const { merge } = require('webpack-merge'); const sharedConfig = require('./shared'); const { settings, output } = require('./configuration'); diff --git a/config/webpack/production.js b/config/webpack/production.js index f2f216422..f1d0dabae 100644 --- a/config/webpack/production.js +++ b/config/webpack/production.js @@ -2,7 +2,7 @@ const path = require('path'); const { URL } = require('url'); -const merge = require('webpack-merge'); +const { merge } = require('webpack-merge'); const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); const OfflinePlugin = require('offline-plugin'); const TerserPlugin = require('terser-webpack-plugin'); diff --git a/config/webpack/shared.js b/config/webpack/shared.js index 11c321c58..ce08ac206 100644 --- a/config/webpack/shared.js +++ b/config/webpack/shared.js @@ -104,7 +104,8 @@ module.exports = { chunkFilename: 'css/[name]-[contenthash:8].chunk.css', }), new AssetsManifestPlugin({ - integrity: false, + integrity: true, + integrityHashes: ['sha256'], entrypoints: true, writeToDisk: true, publicPath: true, diff --git a/config/webpack/tests.js b/config/webpack/tests.js index 8b56eb92f..f9d39f1b8 100644 --- a/config/webpack/tests.js +++ b/config/webpack/tests.js @@ -1,6 +1,6 @@ // Note: You must restart bin/webpack-dev-server for changes to take effect -const merge = require('webpack-merge'); +const { merge } = require('webpack-merge'); const sharedConfig = require('./shared.js'); module.exports = merge(sharedConfig, { |