From 1de6c52545681345e9515b5df7dc0a7e228be098 Mon Sep 17 00:00:00 2001 From: m4sk1n Date: Tue, 19 Sep 2017 23:25:17 +0200 Subject: i18n: Update Polish translation (#5015) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Mikołajczak --- config/locales/pl.yml | 15 +++++++++++++++ config/locales/simple_form.pl.yml | 2 ++ 2 files changed, 17 insertions(+) (limited to 'config') diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 4dbbd7cb1..91754429e 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -62,6 +62,7 @@ pl: followers: Śledzący followers_url: Adres śledzących follows: Śledzeni + inbox: Adres skrzynki ip: Adres IP location: all: Wszystkie @@ -105,6 +106,18 @@ pl: unsubscribe: Przestań subskrybować username: Nazwa użytkownika web: Sieć + custom_emojis: + created_msg: Pomyślnie utworzono emoji! + delete: Usuń + destroyed_msg: Pomyślnie usunięto emoji! + emoji: Emoji + image_hint: Plik PNG ważący do 50KB + new: + title: Dodaj nowe niestandardowe emoji + shortcode: Shortcode + shortcode_hint: Co najmniej 2 znaki, tylko znaki alfanumeryczne i podkreślniki + title: Niestandardowe emoji + upload: Wyślij domain_blocks: add_new: Dodaj nową created_msg: Blokada domen jest przetwarzana @@ -449,6 +462,8 @@ pl: settings: Ustawienia two_factor_authentication: Uwierzytelnianie dwuetapowe your_apps: Twoje aplikacje + themes: + default: Mastodon statuses: open_in_web: Otwórz w przeglądarce over_character_limit: limit %{max} znaków przekroczony diff --git a/config/locales/simple_form.pl.yml b/config/locales/simple_form.pl.yml index e2eba3dd8..d5de2dcd3 100644 --- a/config/locales/simple_form.pl.yml +++ b/config/locales/simple_form.pl.yml @@ -17,6 +17,7 @@ pl: one: Pozostał 1 znak. other: Pozostało %{count} znaków setting_noindex: Wpływa na widoczność strony profilu i Twoich wpisów + setting_theme: Zmienia wygląd Mastodona po zalogowaniu z dowolnego urządzenia. imports: data: Plik CSV wyeksportowany z innej instancji Mastodona sessions: @@ -47,6 +48,7 @@ pl: setting_delete_modal: Pytaj o potwierdzenie przed usunięciem wpisu setting_noindex: Nie indeksuj mojego profilu w wyszukiwarkach internetowych setting_system_font_ui: Używaj domyślnej czcionki systemu + setting_theme: Motyw strony setting_unfollow_modal: Pytaj o potwierdzenie przed cofnięciem śledzenia severity: Priorytet type: Typ importu -- cgit From 33c39784e48032beb937175243b223de53d905d9 Mon Sep 17 00:00:00 2001 From: mayaeh Date: Wed, 20 Sep 2017 21:57:59 +0900 Subject: Add japanese translations for custom emoji. (#5007) * Add japanese translations for custom emoji. * Remove spaces. * Change destroyed_msg. * Revert "Change destroyed_msg." --- config/locales/ja.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'config') diff --git a/config/locales/ja.yml b/config/locales/ja.yml index f7170f6a3..86878e522 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -108,6 +108,18 @@ ja: unsubscribe: 購読の解除 username: ユーザー名 web: Web + custom_emojis: + created_msg: 絵文字の作成に成功しました + delete: 削除 + destroyed_msg: 絵文字の削除に成功しました + emoji: 絵文字 + image_hint: 50KBまでのPNG画像を利用できます + new: + title: 新規カスタム絵文字の追加 + shortcode: ショートコード + shortcode_hint: 2文字以上の半角英数字とアンダースコアのみ利用できます + title: カスタム絵文字 + upload: アップロード domain_blocks: add_new: 新規追加 created_msg: ドメインブロック処理を完了しました -- cgit From 1607bb445a4bedb1cc34e6772e0f14981e393ed9 Mon Sep 17 00:00:00 2001 From: JeanGauthier <32121978+JeanGauthier@users.noreply.github.com> Date: Wed, 20 Sep 2017 15:00:54 +0200 Subject: l10n Occitan: theme site, custom emoji, Oauth, newcomers follow admins, ... (#5023) * Oauto code string * Theme, custom emoji and more * Site theme * added two spaces wierdly gone away * Update oc.yml Changes adviced --- config/locales/doorkeeper.oc.yml | 4 ++-- config/locales/oc.yml | 25 +++++++++++++++++++++++++ config/locales/simple_form.oc.yml | 2 ++ 3 files changed, 29 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/locales/doorkeeper.oc.yml b/config/locales/doorkeeper.oc.yml index 6069b77ad..1ec1b69e8 100644 --- a/config/locales/doorkeeper.oc.yml +++ b/config/locales/doorkeeper.oc.yml @@ -6,7 +6,7 @@ oc: name: Nom redirect_uri: URL de redireccion scopes: Encastres - website: Aplicacion web + website: Site de l’aplicacion errors: models: doorkeeper/application: @@ -63,7 +63,7 @@ oc: prompt: L’aplicacion %{client_name} demanda l’accès al vòstre compte. title: Cal l’autorizacion show: - title: Copy this authorization code and paste it to the application. + title: Copiatz lo còdi d’autorizacion e pegatz-lo dins l’aplicacion. authorized_applications: buttons: revoke: Revocar diff --git a/config/locales/oc.yml b/config/locales/oc.yml index 5d9506132..8f3119c69 100644 --- a/config/locales/oc.yml +++ b/config/locales/oc.yml @@ -60,6 +60,7 @@ oc: email: Corrièl feed_url: Flux URL followers: Seguidors + followers_url: URL dels seguidors follows: Abonaments inbox_url: URL de recepcion ip: IP @@ -92,6 +93,7 @@ oc: reset_password: Reïnicializar lo senhal resubscribe: Se tornar abonar salmon_url: URL Salmon + shared_inbox_url: URL de recepcion partejada search: Cercar show: created_reports: Rapòrts creat per aqueste compte @@ -106,6 +108,18 @@ oc: unsubscribe: Se desabonar username: Nom d’utilizaire web: Web + custom_emojis: + created_msg: Emoji ben creat ! + delete: Suprimir + destroyed_msg: Emojo ben suprimit ! + emoji: Emoji + image_hint: PNG cap a 50Ko + new: + title: Ajustar un nòu emoji personal + shortcode: Acorchi + shortcode_hint: Almens 2 caractèrs, solament alfanumerics e jonhent bas + title: Emojis personals + upload: Enviar domain_blocks: add_new: N’ajustar un nòu created_msg: Domeni blocat es a èsser tractat @@ -141,6 +155,8 @@ oc: instances: account_count: Comptes coneguts domain_name: Domeni + reset: Reïnicializar + search: Cercar title: Instàncias conegudas reports: action_taken_by: Mesura menada per @@ -167,6 +183,9 @@ oc: unresolved: Pas resolguts view: Veire settings: + bootstrap_timeline_accounts: + desc_html: Separatz los noms d’utilizaire amb de virgula. Pas que los comptes locals e pas clavats foncionaràn. Se lo camp es void los admins seràn selecionats. + title: Per defaut los nouvenguts sègon contact_information: email: Picatz una adreça de corrièl username: Picatz un nom d’utilizaire @@ -190,6 +209,9 @@ oc: desc_html: Afichada sus la pagina de las condicions d’utilizacion
Podètz utilizar de balisas HTML title: Politica de confidencialitat del site site_title: Títol del site + thumbnail: + desc_html: Servís pels apercebuts via OpenGraph e las API. Talha de 1200x630px recomandada. + title: Miniatura de l’instància timeline_preview: desc_html: Mostrar lo flux public sus la pagina d’acuèlh title: Apercebut flux public @@ -517,10 +539,13 @@ oc: settings: Paramètres two_factor_authentication: Autentificacion en dos temps your_apps: Vòstras aplicacions + themes: + default: Mastodon statuses: open_in_web: Dobrir sul web over_character_limit: limit de %{max} caractèrs passat pin_errors: + limit: Tròp de tuts penjats ownership: Se pòt pas penjar lo tut de qualqu’un mai private: Se pòt pas penjar los tuts pas publics reblog: Se pòt pas penjar un tut partejat diff --git a/config/locales/simple_form.oc.yml b/config/locales/simple_form.oc.yml index 442a7d4b6..b07aa5b37 100644 --- a/config/locales/simple_form.oc.yml +++ b/config/locales/simple_form.oc.yml @@ -13,6 +13,7 @@ oc: one: Demòra encara 1 caractèr other: Demòran encara %{count} caractèrs setting_noindex: Aquò es destinat a vòstre perfil public e vòstra pagina d’estatuts + setting_theme: Aquò càmbia lo tèma grafic de Mastodon quand sètz connectat qualque siaque lo periferic. imports: data: Fichièr CSV exportat d’una autra instància Mastodon sessions: @@ -44,6 +45,7 @@ oc: setting_noindex: Èsser pas indexat pels motors de recèrca setting_system_font_ui: Utilizar la policia Font del sisèma setting_unfollow_modal: Afichar una confirmacion abans de quitar de sègre qualqu’un + setting_theme: Tèma del site severity: Severitat type: Tip d’impòrt username: Nom d’utilizaire -- cgit From 7b8ecde32d732e830e628a2d713c1bd7ab69b9cf Mon Sep 17 00:00:00 2001 From: mayaeh Date: Wed, 20 Sep 2017 23:09:57 +0900 Subject: Add Japanese translations for multiple themes, custom emoji (#5026) * Add Japanese translations for multiple themes * Change Japanese translation for custom emoji's created_msg. --- config/locales/ja.yml | 4 +++- config/locales/simple_form.ja.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 86878e522..cbb9bd35b 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -109,7 +109,7 @@ ja: username: ユーザー名 web: Web custom_emojis: - created_msg: 絵文字の作成に成功しました + created_msg: 絵文字の追加に成功しました delete: 削除 destroyed_msg: 絵文字の削除に成功しました emoji: 絵文字 @@ -460,6 +460,8 @@ ja: settings: 設定 two_factor_authentication: 二段階認証 your_apps: アプリ + themes: + default: Mastodon statuses: open_in_web: Webで開く over_character_limit: 上限は %{max}文字までです diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml index 70389e948..0c4d2cdba 100644 --- a/config/locales/simple_form.ja.yml +++ b/config/locales/simple_form.ja.yml @@ -9,6 +9,7 @@ ja: locked: フォロワーを手動で承認する必要があります。 note: あと%{count}文字入力できます。 setting_noindex: 公開プロフィールおよび各投稿ページに影響します + setting_theme: 任意のデバイスからログインしている時の外観に影響します。 imports: data: 他の Mastodon インスタンスからエクスポートしたCSVファイルを選択して下さい sessions: @@ -40,6 +41,7 @@ ja: setting_noindex: 検索エンジンによるインデックスを拒否する setting_system_font_ui: システムのデフォルトフォントを使う setting_unfollow_modal: フォロー解除する前に確認ダイアログを表示する + setting_theme: サイトテーマ severity: 重大性 type: インポートする項目 username: ユーザー名 -- cgit From f41e70ca382d9ac158368eddc40783357b81b42c Mon Sep 17 00:00:00 2001 From: Lynx Kotoura Date: Thu, 21 Sep 2017 01:56:28 +0900 Subject: Better Japanese translations (#5030) --- config/locales/devise.ja.yml | 2 +- config/locales/doorkeeper.ja.yml | 4 ++-- config/locales/ja.yml | 26 +++++++++++++------------- config/locales/simple_form.ja.yml | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'config') diff --git a/config/locales/devise.ja.yml b/config/locales/devise.ja.yml index 2001abe96..aa333920e 100644 --- a/config/locales/devise.ja.yml +++ b/config/locales/devise.ja.yml @@ -11,7 +11,7 @@ ja: invalid: "%{authentication_keys}かパスワードが誤っています。" last_attempt: あと1回失敗するとアカウントがロックされます。 locked: アカウントはロックされました。 - not_found_in_database: "%{authentication_keys}かパスワードが誤っています" + not_found_in_database: "%{authentication_keys}かパスワードが誤っています。" timeout: セッションの有効期限が切れました。続行するには再度ログインしてください。 unauthenticated: 続行するにはログインするか、アカウントを作成してください。 unconfirmed: 続行するにはメールアドレスを確認する必要があります。 diff --git a/config/locales/doorkeeper.ja.yml b/config/locales/doorkeeper.ja.yml index 0b670fda4..1f145eaa3 100644 --- a/config/locales/doorkeeper.ja.yml +++ b/config/locales/doorkeeper.ja.yml @@ -25,14 +25,14 @@ ja: edit: 編集 submit: 送信 confirmations: - destroy: 本当に削除しますか? + destroy: 本当に削除しますか? edit: title: アプリの編集 form: error: フォームにエラーが無いか確認してください。 help: native_redirect_uri: ローカルテストに %{native_redirect_uri} を使用 - redirect_uri: 一行に一つのURLを入力してください + redirect_uri: 一行に一つのURLを入力してください。 scopes: アクセス権は半角スペースで区切ることができます。 空白のままにするとデフォルトを使用します。 index: application: アプリ diff --git a/config/locales/ja.yml b/config/locales/ja.yml index cbb9bd35b..be9e355ef 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -50,7 +50,7 @@ ja: unfollow: フォロー解除 admin: accounts: - are_you_sure: 本当に実行しますか? + are_you_sure: 本当に実行しますか? confirm: 確認 confirmed: 確認済み disable_two_factor_authentication: 二段階認証を無効にする @@ -113,11 +113,11 @@ ja: delete: 削除 destroyed_msg: 絵文字の削除に成功しました emoji: 絵文字 - image_hint: 50KBまでのPNG画像を利用できます + image_hint: 50KBまでのPNG画像を利用できます。 new: title: 新規カスタム絵文字の追加 shortcode: ショートコード - shortcode_hint: 2文字以上の半角英数字とアンダースコアのみ利用できます + shortcode_hint: 2文字以上の半角英数字とアンダーバーのみ利用できます。 title: カスタム絵文字 upload: アップロード domain_blocks: @@ -191,7 +191,7 @@ ja: username: 連絡先のユーザー名 registrations: closed_message: - desc_html: 新規登録を停止しているときにフロントページに表示されます。HTMLタグが使えます + desc_html: 新規登録を停止しているときにフロントページに表示されます。HTMLタグが使えます。 title: 新規登録停止時のメッセージ deletion: desc_html: 誰でも自分のアカウントを削除できるようにします @@ -203,10 +203,10 @@ ja: desc_html: フロントページへの表示と meta タグに使用される紹介文です。HTMLタグ、特に<a><em>が使えます。 title: インスタンスの説明 site_description_extended: - desc_html: あなたのインスタンスにおける行動規範やルール、ガイドライン、そのほかの記述をする際に最適な場所です。HTMLタグが使えます + desc_html: あなたのインスタンスにおける行動規範やルール、ガイドライン、そのほかの記述をする際に最適な場所です。HTMLタグが使えます。 title: カスタム詳細説明 site_terms: - desc_html: あなたは独自のプライバシーポリシーや利用規約、そのほかの法的根拠を書くことができます。HTMLタグが使えます + desc_html: あなたは独自のプライバシーポリシーや利用規約、そのほかの法的根拠を書くことができます。HTMLタグが使えます。 title: カスタム利用規約 site_title: インスタンスの名前 thumbnail: @@ -273,7 +273,7 @@ ja: error: 残念ながら、リモートアカウント情報の取得中にエラーが発生しました。 follow: フォロー follow_request: 'あなたは以下のアカウントにフォローリクエストを送信しました:' - following: '成功! あなたは現在以下のアカウントをフォローしています:' + following: '成功! あなたは現在以下のアカウントをフォローしています:' post_follow: close: またはこのウィンドウを閉じます return: ユーザーのプロフィールに戻る @@ -302,7 +302,7 @@ ja: warning_html: 削除が保証されるのはこのインスタンス上のコンテンツのみです。他のインスタンス等、外部に広く共有されたコンテンツについては痕跡が残ることがあります。また、現在接続できないサーバーや、あなたの更新を受け取らなくなったサーバーに対しては、削除は反映されません。 warning_title: 共有されたコンテンツについて errors: - '403': このページを表示する権限がありません + '403': このページを表示する権限がありません。 '404': お探しのページは見つかりませんでした。 '410': お探しのページはもう存在しません。 '422': @@ -333,11 +333,11 @@ ja: powered_by: powered by %{link} save_changes: 変更を保存 validation_errors: - one: エラーが発生しました。以下のエラーを確認してください - other: エラーが発生しました。以下の%{count}個のエラーを確認してください + one: エラーが発生しました。以下のエラーを確認してください。 + other: エラーが発生しました。以下の%{count}個のエラーを確認してください。 imports: preface: 他のインスタンスでエクスポートされたファイルから、フォロー/ブロックした情報をこのインスタンス上のアカウントにインポートできます。 - success: ファイルは正常にアップロードされ、現在処理中です。しばらくしてから確認してください + success: ファイルは正常にアップロードされ、現在処理中です。しばらくしてから確認してください。 types: blocking: ブロックしたアカウントリスト following: フォロー中のアカウントリスト @@ -366,7 +366,7 @@ ja: body: "%{name} さんにフォローされています" subject: "%{name} さんにフォローされています" follow_request: - body: "%{name} さんがあなたにフォローをリクエストしました。" + body: "%{name} さんがあなたにフォローをリクエストしました" subject: "%{name} さんからのフォローリクエスト" mention: body: "%{name} さんから返信がありました:" @@ -557,7 +557,7 @@ ja: formats: default: "%Y年%m月%d日 %H:%M" two_factor_authentication: - code_hint: 確認するには認証アプリで表示されたコードを入力してください + code_hint: 確認するには認証アプリで表示されたコードを入力してください。 description_html: "二段階認証を有効にするとログイン時、電話でコードを受け取る必要があります。" disable: 無効 enable: 有効 diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml index 0c4d2cdba..0e1b48cf0 100644 --- a/config/locales/simple_form.ja.yml +++ b/config/locales/simple_form.ja.yml @@ -6,12 +6,12 @@ ja: avatar: 2MBまでのPNGやGIF、JPGが利用可能です。120x120pxまで縮小されます。 display_name: あと%{count}文字入力できます。 header: 2MBまでのPNGやGIF、JPGが利用可能です。 700x335pxまで縮小されます。 - locked: フォロワーを手動で承認する必要があります。 + locked: フォロワーを手動で承認する必要があります note: あと%{count}文字入力できます。 setting_noindex: 公開プロフィールおよび各投稿ページに影響します - setting_theme: 任意のデバイスからログインしている時の外観に影響します。 + setting_theme: ログインしている全てのデバイスで適用されるデザインです。 imports: - data: 他の Mastodon インスタンスからエクスポートしたCSVファイルを選択して下さい + data: 他の Mastodon インスタンスからエクスポートしたCSVファイルを選択して下さい。 sessions: otp: 携帯電話に表示された2段階認証コードを入力するか、生成したリカバリーコードを使用してください。 user: -- cgit From d68df88d4e3da89cdc572d802ac69589dac76be4 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 20 Sep 2017 19:08:20 +0200 Subject: Disable private status federation over OStatus (#5027) --- config/initializers/ostatus.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/ostatus.rb b/config/initializers/ostatus.rb index c00aba0de..f28eaec1c 100644 --- a/config/initializers/ostatus.rb +++ b/config/initializers/ostatus.rb @@ -18,7 +18,7 @@ Rails.application.configure do config.action_mailer.default_url_options = { host: web_host, protocol: https ? 'https://' : 'http://', trailing_slash: false } config.x.streaming_api_base_url = 'ws://localhost:4000' - config.x.use_ostatus_privacy = true + config.x.use_ostatus_privacy = false if Rails.env.production? config.x.streaming_api_base_url = ENV.fetch('STREAMING_API_BASE_URL') { "ws#{https ? 's' : ''}://#{web_host}" } -- cgit From 8fcfcddc8fc3d36a5b1daa1f74e69512fc66d565 Mon Sep 17 00:00:00 2001 From: Lynx Kotoura Date: Thu, 21 Sep 2017 02:41:35 +0900 Subject: Fix theme translations alphabetically (#5031) --- config/locales/en.yml | 4 ++-- config/locales/ja.yml | 4 ++-- config/locales/oc.yml | 4 ++-- config/locales/pl.yml | 4 ++-- config/locales/simple_form.en.yml | 2 +- config/locales/simple_form.ja.yml | 2 +- config/locales/simple_form.oc.yml | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) (limited to 'config') diff --git a/config/locales/en.yml b/config/locales/en.yml index 0f3812aff..13280303c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -461,8 +461,6 @@ en: settings: Settings two_factor_authentication: Two-factor Authentication your_apps: Your applications - themes: - default: Mastodon statuses: open_in_web: Open in web over_character_limit: character limit of %{max} exceeded @@ -554,6 +552,8 @@ en:

Originally adapted from the Discourse privacy policy.

title: "%{instance} Terms of Service and Privacy Policy" + themes: + default: Mastodon time: formats: default: "%b %d, %Y, %H:%M" diff --git a/config/locales/ja.yml b/config/locales/ja.yml index be9e355ef..5ffc09ab9 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -460,8 +460,6 @@ ja: settings: 設定 two_factor_authentication: 二段階認証 your_apps: アプリ - themes: - default: Mastodon statuses: open_in_web: Webで開く over_character_limit: 上限は %{max}文字までです @@ -553,6 +551,8 @@ ja:

オリジナルの出典 Discourse privacy policy.

title: "%{instance} 利用規約・プライバシーポリシー" + themes: + default: Mastodon time: formats: default: "%Y年%m月%d日 %H:%M" diff --git a/config/locales/oc.yml b/config/locales/oc.yml index 8f3119c69..584f4c609 100644 --- a/config/locales/oc.yml +++ b/config/locales/oc.yml @@ -539,8 +539,6 @@ oc: settings: Paramètres two_factor_authentication: Autentificacion en dos temps your_apps: Vòstras aplicacions - themes: - default: Mastodon statuses: open_in_web: Dobrir sul web over_character_limit: limit de %{max} caractèrs passat @@ -632,6 +630,8 @@ oc:

Prima adaptacion de la politica de confidencialitat de Discourse.

title: Condicions d’utilizacion e politica de confidencialitat de %{instance} + themes: + default: Mastodon time: formats: default: Lo %d %b de %Y a %Ho%M diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 91754429e..8254e3293 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -462,8 +462,6 @@ pl: settings: Ustawienia two_factor_authentication: Uwierzytelnianie dwuetapowe your_apps: Twoje aplikacje - themes: - default: Mastodon statuses: open_in_web: Otwórz w przeglądarce over_character_limit: limit %{max} znaków przekroczony @@ -555,6 +553,8 @@ pl:

Tekst bazuje na polityce prywatności Discourse.

title: Zasady korzystania i polityka prywatności %{instance} + themes: + default: Mastodon time: formats: default: "%b %d, %Y, %H:%M" diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index c535a22fe..6f8b88898 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -44,8 +44,8 @@ en: setting_delete_modal: Show confirmation dialog before deleting a toot setting_noindex: Opt-out of search engine indexing setting_system_font_ui: Use system's default font - setting_unfollow_modal: Show confirmation dialog before unfollowing someone setting_theme: Site theme + setting_unfollow_modal: Show confirmation dialog before unfollowing someone severity: Severity type: Import type username: Username diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml index 0e1b48cf0..17b35ba8f 100644 --- a/config/locales/simple_form.ja.yml +++ b/config/locales/simple_form.ja.yml @@ -40,8 +40,8 @@ ja: setting_delete_modal: トゥートを削除する前に確認ダイアログを表示する setting_noindex: 検索エンジンによるインデックスを拒否する setting_system_font_ui: システムのデフォルトフォントを使う - setting_unfollow_modal: フォロー解除する前に確認ダイアログを表示する setting_theme: サイトテーマ + setting_unfollow_modal: フォロー解除する前に確認ダイアログを表示する severity: 重大性 type: インポートする項目 username: ユーザー名 diff --git a/config/locales/simple_form.oc.yml b/config/locales/simple_form.oc.yml index b07aa5b37..d45f98e66 100644 --- a/config/locales/simple_form.oc.yml +++ b/config/locales/simple_form.oc.yml @@ -44,8 +44,8 @@ oc: setting_delete_modal: Afichar una fenèstra de confirmacion abans de suprimir un estatut setting_noindex: Èsser pas indexat pels motors de recèrca setting_system_font_ui: Utilizar la policia Font del sisèma - setting_unfollow_modal: Afichar una confirmacion abans de quitar de sègre qualqu’un setting_theme: Tèma del site + setting_unfollow_modal: Afichar una confirmacion abans de quitar de sègre qualqu’un severity: Severitat type: Tip d’impòrt username: Nom d’utilizaire -- cgit From 293972f716476933df2b665ad755cafe4d29d82d Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 23 Sep 2017 01:57:23 +0200 Subject: New API: GET /api/v1/custom_emojis to get a server's custom emojis (#5051) --- app/controllers/admin/custom_emojis_controller.rb | 2 +- app/controllers/api/v1/custom_emojis_controller.rb | 9 +++++++++ app/models/custom_emoji.rb | 2 ++ app/serializers/rest/custom_emoji_serializer.rb | 11 +++++++++++ app/serializers/rest/status_serializer.rb | 12 +----------- config/routes.rb | 1 + .../api/v1/custom_emojis_controller_spec.rb | 18 ++++++++++++++++++ 7 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 app/controllers/api/v1/custom_emojis_controller.rb create mode 100644 app/serializers/rest/custom_emoji_serializer.rb create mode 100644 spec/controllers/api/v1/custom_emojis_controller_spec.rb (limited to 'config') diff --git a/app/controllers/admin/custom_emojis_controller.rb b/app/controllers/admin/custom_emojis_controller.rb index 572ad1ac2..d70514d9a 100644 --- a/app/controllers/admin/custom_emojis_controller.rb +++ b/app/controllers/admin/custom_emojis_controller.rb @@ -3,7 +3,7 @@ module Admin class CustomEmojisController < BaseController def index - @custom_emojis = CustomEmoji.where(domain: nil) + @custom_emojis = CustomEmoji.local end def new diff --git a/app/controllers/api/v1/custom_emojis_controller.rb b/app/controllers/api/v1/custom_emojis_controller.rb new file mode 100644 index 000000000..4dd77fb55 --- /dev/null +++ b/app/controllers/api/v1/custom_emojis_controller.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class Api::V1::CustomEmojisController < Api::BaseController + respond_to :json + + def index + render json: CustomEmoji.local, each_serializer: REST::CustomEmojiSerializer + end +end diff --git a/app/models/custom_emoji.rb b/app/models/custom_emoji.rb index f4d3b16a0..aff9f8dfa 100644 --- a/app/models/custom_emoji.rb +++ b/app/models/custom_emoji.rb @@ -26,6 +26,8 @@ class CustomEmoji < ApplicationRecord validates_attachment :image, content_type: { content_type: 'image/png' }, presence: true, size: { in: 0..50.kilobytes } validates :shortcode, uniqueness: { scope: :domain }, format: { with: /\A#{SHORTCODE_RE_FRAGMENT}\z/ }, length: { minimum: 2 } + scope :local, -> { where(domain: nil) } + include Remotable class << self diff --git a/app/serializers/rest/custom_emoji_serializer.rb b/app/serializers/rest/custom_emoji_serializer.rb new file mode 100644 index 000000000..b744dd4ec --- /dev/null +++ b/app/serializers/rest/custom_emoji_serializer.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class REST::CustomEmojiSerializer < ActiveModel::Serializer + include RoutingHelper + + attributes :shortcode, :url + + def url + full_asset_url(object.image.url) + end +end diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb index e0fd1c77e..ef3c325ba 100644 --- a/app/serializers/rest/status_serializer.rb +++ b/app/serializers/rest/status_serializer.rb @@ -17,7 +17,7 @@ class REST::StatusSerializer < ActiveModel::Serializer has_many :media_attachments, serializer: REST::MediaAttachmentSerializer has_many :mentions has_many :tags - has_many :emojis + has_many :emojis, serializer: REST::CustomEmojiSerializer def id object.id.to_s @@ -119,14 +119,4 @@ class REST::StatusSerializer < ActiveModel::Serializer tag_url(object) end end - - class CustomEmojiSerializer < ActiveModel::Serializer - include RoutingHelper - - attributes :shortcode, :url - - def url - full_asset_url(object.image.url) - end - end end diff --git a/config/routes.rb b/config/routes.rb index d38f5308a..cb7e84d7b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -188,6 +188,7 @@ Rails.application.routes.draw do end resources :streaming, only: [:index] + resources :custom_emojis, only: [:index] get '/search', to: 'search#index', as: :search diff --git a/spec/controllers/api/v1/custom_emojis_controller_spec.rb b/spec/controllers/api/v1/custom_emojis_controller_spec.rb new file mode 100644 index 000000000..9f3522812 --- /dev/null +++ b/spec/controllers/api/v1/custom_emojis_controller_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe Api::V1::CustomEmojisController, type: :controller do + render_views + + describe 'GET #index' do + before do + Fabricate(:custom_emoji) + get :index + end + + it 'returns http success' do + expect(response).to have_http_status(:success) + end + end +end -- cgit From b982d549f440cfebadd5dc8d300a506df213bfee Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 25 Sep 2017 02:11:14 +0200 Subject: Add strong_migrations gem to warn when creating unsafe migrations (#5078) --- Gemfile | 1 + Gemfile.lock | 3 +++ config/initializers/strong_migrations.rb | 3 +++ 3 files changed, 7 insertions(+) create mode 100644 config/initializers/strong_migrations.rb (limited to 'config') diff --git a/Gemfile b/Gemfile index 4f4861913..6c31e8932 100644 --- a/Gemfile +++ b/Gemfile @@ -105,6 +105,7 @@ group :development do gem 'brakeman', '~> 3.6', require: false gem 'bundler-audit', '~> 0.5', require: false gem 'scss_lint', '~> 0.53', require: false + gem 'strong_migrations' gem 'capistrano', '~> 3.8' gem 'capistrano-rails', '~> 1.2' diff --git a/Gemfile.lock b/Gemfile.lock index 97db3aa9a..b29d32400 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -482,6 +482,8 @@ GEM net-scp (>= 1.1.2) net-ssh (>= 2.8.0) statsd-instrument (2.1.4) + strong_migrations (0.1.9) + activerecord (>= 3.2.0) temple (0.8.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) @@ -614,6 +616,7 @@ DEPENDENCIES simplecov (~> 0.14) sprockets-rails (~> 3.2) statsd-instrument (~> 2.1) + strong_migrations twitter-text (~> 1.14) tzinfo-data (~> 1.2017) uglifier (~> 3.2) diff --git a/config/initializers/strong_migrations.rb b/config/initializers/strong_migrations.rb new file mode 100644 index 000000000..3d7beac9f --- /dev/null +++ b/config/initializers/strong_migrations.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +StrongMigrations.start_after = 20170924022025 if Rails.env.development? -- cgit From 2c8e3fbbfbe26fb78418324ef14caf13ab207623 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 25 Sep 2017 04:04:04 +0200 Subject: Generate 500.html with assets:precompile, remove loading from Google Fonts (#5067) --- .gitignore | 1 + app/javascript/styles/basics.scss | 21 +++++++++++++++++++ app/views/errors/500.html.haml | 5 +++++ app/views/layouts/error.html.haml | 28 +++---------------------- config/i18n-tasks.yml | 1 + config/locales/en.yml | 1 + lib/tasks/assets.rake | 8 ++++++++ public/500.html | 43 --------------------------------------- 8 files changed, 40 insertions(+), 68 deletions(-) create mode 100644 app/views/errors/500.html.haml create mode 100644 lib/tasks/assets.rake delete mode 100644 public/500.html (limited to 'config') diff --git a/.gitignore b/.gitignore index 38ebc934f..2f5f1e71a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ public/system public/assets public/packs public/packs-test +public/500.html .env .env.production node_modules/ diff --git a/app/javascript/styles/basics.scss b/app/javascript/styles/basics.scss index c5f98750c..48652a035 100644 --- a/app/javascript/styles/basics.scss +++ b/app/javascript/styles/basics.scss @@ -62,6 +62,27 @@ body { height: 100%; padding: 0; } + + &.error { + text-align: center; + color: $ui-primary-color; + padding: 20px; + + .dialog img { + display: block; + margin: 20px auto; + margin-top: 50px; + max-width: 600px; + width: 100%; + height: auto; + } + + .dialog h1 { + font-size: 20px; + line-height: 28px; + font-weight: 400; + } + } } button { diff --git a/app/views/errors/500.html.haml b/app/views/errors/500.html.haml new file mode 100644 index 000000000..e124be551 --- /dev/null +++ b/app/views/errors/500.html.haml @@ -0,0 +1,5 @@ +- content_for :page_title do + = t('errors.500') + +- content_for :content do + = t('errors.500') diff --git a/app/views/layouts/error.html.haml b/app/views/layouts/error.html.haml index 08b94af54..0b5f908ae 100644 --- a/app/views/layouts/error.html.haml +++ b/app/views/layouts/error.html.haml @@ -5,31 +5,9 @@ %meta{ charset: 'utf-8' }/ %title= yield :page_title %meta{ content: 'width=device-width,initial-scale=1', name: 'viewport' }/ - %link{ href: 'https://fonts.googleapis.com/css?family=Roboto:400', rel: 'stylesheet' }/ - :css - body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; - background: #282c37; - color: #9baec8; - text-align: center; - margin: 0; - padding: 20px; - } - - .dialog img { - display: block; - margin: 20px auto; - margin-top: 50px; - max-width: 600px; - width: 100%; - height: auto; - } - - .dialog h1 { - font: 20px/28px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; - font-weight: 400; - } - %body + = stylesheet_pack_tag 'common', media: 'all' + = stylesheet_pack_tag Setting.default_settings['theme'], media: 'all' + %body.error .dialog %img{ alt: 'Mastodon', src: '/oops.png' }/ %div diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index b51cf46df..b35e5c09a 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -45,6 +45,7 @@ ignore_missing: - 'sessions.{browsers,platforms}.*' - 'terms.body_html' - 'application_mailer.salutation' + - 'errors.500' ignore_unused: - 'activemodel.errors.*' - 'activerecord.attributes.*' diff --git a/config/locales/en.yml b/config/locales/en.yml index 13280303c..cc440e1b0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -310,6 +310,7 @@ en: content: Security verification failed. Are you blocking cookies? title: Security verification failed '429': Throttled + '500': We're sorry, but something went wrong. noscript_html: To use the Mastodon web application, please enable JavaScript. Alternatively, try one of the native apps for Mastodon for your platform. exports: blocks: You block diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake new file mode 100644 index 000000000..cd0a3bd2b --- /dev/null +++ b/lib/tasks/assets.rake @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +if Rake::Task.task_defined?('assets:precompile') + Rake::Task['assets:precompile'].enhance do + html = ApplicationController.render('errors/500', layout: 'error') + File.write(Rails.root.join('public', '500.html'), html) + end +end diff --git a/public/500.html b/public/500.html deleted file mode 100644 index d085d490b..000000000 --- a/public/500.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - We're sorry, but something went wrong - - - - - - -
- Mastodon - -
-

We're sorry, but something went wrong.

-
-
- - -- cgit From 3b60832214fdd9d8b5fd01e9a177a6dde5259907 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 25 Sep 2017 23:05:54 +0200 Subject: New error page graphic. Other error page improvements (#5099) - 500.html generated with admin-set default locale if set - Error page `` includes Mastodon site title - 500 title changed to "This page is not correct" (ref: <https://www.youtube.com/watch?v=2VCAP_seh1A>) - 500 content appended with "on our end" to make clear it's not user's fault --- app/javascript/styles/basics.scss | 5 ++--- app/views/errors/500.html.haml | 4 ++-- app/views/layouts/error.html.haml | 4 ++-- config/locales/en.yml | 4 +++- lib/tasks/assets.rake | 7 ++++--- public/oops.gif | Bin 0 -> 95633 bytes public/oops.png | Bin 120305 -> 0 bytes 7 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 public/oops.gif delete mode 100644 public/oops.png (limited to 'config') diff --git a/app/javascript/styles/basics.scss b/app/javascript/styles/basics.scss index 48652a035..96f0023c3 100644 --- a/app/javascript/styles/basics.scss +++ b/app/javascript/styles/basics.scss @@ -70,9 +70,8 @@ body { .dialog img { display: block; - margin: 20px auto; - margin-top: 50px; - max-width: 600px; + margin: 0 auto; + max-width: 470px; width: 100%; height: auto; } diff --git a/app/views/errors/500.html.haml b/app/views/errors/500.html.haml index e124be551..6244ff209 100644 --- a/app/views/errors/500.html.haml +++ b/app/views/errors/500.html.haml @@ -1,5 +1,5 @@ - content_for :page_title do - = t('errors.500') + = t('errors.500.title') - content_for :content do - = t('errors.500') + = t('errors.500.content') diff --git a/app/views/layouts/error.html.haml b/app/views/layouts/error.html.haml index 0b5f908ae..31f322096 100644 --- a/app/views/layouts/error.html.haml +++ b/app/views/layouts/error.html.haml @@ -3,12 +3,12 @@ %head %meta{ content: 'text/html; charset=UTF-8', 'http-equiv' => 'Content-Type' }/ %meta{ charset: 'utf-8' }/ - %title= yield :page_title + %title= safe_join([yield(:page_title), title], ' - ') %meta{ content: 'width=device-width,initial-scale=1', name: 'viewport' }/ = stylesheet_pack_tag 'common', media: 'all' = stylesheet_pack_tag Setting.default_settings['theme'], media: 'all' %body.error .dialog - %img{ alt: 'Mastodon', src: '/oops.png' }/ + %img{ alt: title, src: '/oops.gif' }/ %div %h1= yield :content diff --git a/config/locales/en.yml b/config/locales/en.yml index cc440e1b0..f87d8532c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -310,7 +310,9 @@ en: content: Security verification failed. Are you blocking cookies? title: Security verification failed '429': Throttled - '500': We're sorry, but something went wrong. + '500': + content: We're sorry, but something went wrong on our end. + title: This page is not correct noscript_html: To use the Mastodon web application, please enable JavaScript. Alternatively, try one of the <a href="https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/Apps.md">native apps</a> for Mastodon for your platform. exports: blocks: You block diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index ad7c6ba90..2ef72fdef 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -3,15 +3,16 @@ namespace :assets do desc 'Generate 500.html' task :generate_500 do - html = ApplicationController.render('errors/500', layout: 'error') - File.write(Rails.root.join('public', '500.html'), html) + I18n.with_locale(ENV['DEFAULT_LOCALE'] || I18n.default_locale) do + html = ApplicationController.render('errors/500', layout: 'error') + File.write(Rails.root.join('public', '500.html'), html) + end end end if Rake::Task.task_defined?('assets:precompile') Rake::Task['assets:precompile'].enhance do Webpacker::Manifest.load - Rake::Task['assets:generate_500'].invoke end end diff --git a/public/oops.gif b/public/oops.gif new file mode 100644 index 000000000..ad19c4e10 Binary files /dev/null and b/public/oops.gif differ diff --git a/public/oops.png b/public/oops.png deleted file mode 100644 index 0abddad3e..000000000 Binary files a/public/oops.png and /dev/null differ -- cgit From e528114c53e23c39dd013d39b829ad50f620015b Mon Sep 17 00:00:00 2001 From: Eugen Rochko <eugen@zeonfederated.com> Date: Tue, 26 Sep 2017 01:06:27 +0200 Subject: Follow-up to #4582 and #5027, removing dead code (#5101) --- app/services/process_mentions_service.rb | 2 +- app/workers/pubsubhubbub/distribution_worker.rb | 28 +++------------- config/initializers/ostatus.rb | 1 - .../pubsubhubbub/distribution_worker_spec.rb | 39 +--------------------- 4 files changed, 7 insertions(+), 63 deletions(-) (limited to 'config') diff --git a/app/services/process_mentions_service.rb b/app/services/process_mentions_service.rb index f123bf869..1c3eea369 100644 --- a/app/services/process_mentions_service.rb +++ b/app/services/process_mentions_service.rb @@ -39,7 +39,7 @@ class ProcessMentionsService < BaseService if mentioned_account.local? NotifyService.new.call(mentioned_account, mention) - elsif mentioned_account.ostatus? && (Rails.configuration.x.use_ostatus_privacy || !status.stream_entry.hidden?) + elsif mentioned_account.ostatus? && !status.stream_entry.hidden? NotificationWorker.perform_async(stream_entry_to_xml(status.stream_entry), status.account_id, mentioned_account.id) elsif mentioned_account.activitypub? ActivityPub::DeliveryWorker.perform_async(build_json(mention.status), mention.status.account_id, mentioned_account.inbox_url) diff --git a/app/workers/pubsubhubbub/distribution_worker.rb b/app/workers/pubsubhubbub/distribution_worker.rb index 524f6849f..fed5e917d 100644 --- a/app/workers/pubsubhubbub/distribution_worker.rb +++ b/app/workers/pubsubhubbub/distribution_worker.rb @@ -6,45 +6,27 @@ class Pubsubhubbub::DistributionWorker sidekiq_options queue: 'push' def perform(stream_entry_ids) - stream_entries = StreamEntry.where(id: stream_entry_ids).includes(:status).reject { |e| e.status.nil? || e.status.direct_visibility? } + stream_entries = StreamEntry.where(id: stream_entry_ids).includes(:status).reject { |e| e.status.nil? || e.status.hidden? } return if stream_entries.empty? @account = stream_entries.first.account @subscriptions = active_subscriptions.to_a - distribute_public!(stream_entries.reject(&:hidden?)) - distribute_hidden!(stream_entries.select(&:hidden?)) if Rails.configuration.x.use_ostatus_privacy + distribute_public!(stream_entries) end private def distribute_public!(stream_entries) - return if stream_entries.empty? - @payload = OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.feed(@account, stream_entries)) - Pubsubhubbub::DeliveryWorker.push_bulk(@subscriptions) do |subscription| - [subscription.id, @payload] - end - end - - def distribute_hidden!(stream_entries) - return if stream_entries.empty? - - @payload = OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.feed(@account, stream_entries)) - @domains = @account.followers.domains - - Pubsubhubbub::DeliveryWorker.push_bulk(@subscriptions.select { |s| allowed_to_receive?(s.callback_url, s.domain) }) do |subscription| - [subscription.id, @payload] + Pubsubhubbub::DeliveryWorker.push_bulk(@subscriptions) do |subscription_id| + [subscription_id, @payload] end end def active_subscriptions - Subscription.where(account: @account).active.select('id, callback_url, domain') - end - - def allowed_to_receive?(callback_url, domain) - (!domain.nil? && @domains.include?(domain)) || @domains.include?(Addressable::URI.parse(callback_url).host) + Subscription.where(account: @account).active.pluck(:id) end end diff --git a/config/initializers/ostatus.rb b/config/initializers/ostatus.rb index f28eaec1c..ba96fda22 100644 --- a/config/initializers/ostatus.rb +++ b/config/initializers/ostatus.rb @@ -18,7 +18,6 @@ Rails.application.configure do config.action_mailer.default_url_options = { host: web_host, protocol: https ? 'https://' : 'http://', trailing_slash: false } config.x.streaming_api_base_url = 'ws://localhost:4000' - config.x.use_ostatus_privacy = false if Rails.env.production? config.x.streaming_api_base_url = ENV.fetch('STREAMING_API_BASE_URL') { "ws#{https ? 's' : ''}://#{web_host}" } diff --git a/spec/workers/pubsubhubbub/distribution_worker_spec.rb b/spec/workers/pubsubhubbub/distribution_worker_spec.rb index 5c22e7fa8..584485079 100644 --- a/spec/workers/pubsubhubbub/distribution_worker_spec.rb +++ b/spec/workers/pubsubhubbub/distribution_worker_spec.rb @@ -18,48 +18,11 @@ describe Pubsubhubbub::DistributionWorker do it 'delivers payload to all subscriptions' do allow(Pubsubhubbub::DeliveryWorker).to receive(:push_bulk) subject.perform(status.stream_entry.id) - expect(Pubsubhubbub::DeliveryWorker).to have_received(:push_bulk).with([anonymous_subscription, subscription_with_follower]) - end - end - - context 'when OStatus privacy is used' do - around do |example| - before_val = Rails.configuration.x.use_ostatus_privacy - Rails.configuration.x.use_ostatus_privacy = true - example.run - Rails.configuration.x.use_ostatus_privacy = before_val - end - - describe 'with private status' do - let(:status) { Fabricate(:status, account: alice, text: 'Hello', visibility: :private) } - - it 'delivers payload only to subscriptions with followers' do - allow(Pubsubhubbub::DeliveryWorker).to receive(:push_bulk) - subject.perform(status.stream_entry.id) - expect(Pubsubhubbub::DeliveryWorker).to have_received(:push_bulk).with([subscription_with_follower]) - expect(Pubsubhubbub::DeliveryWorker).to_not have_received(:push_bulk).with([anonymous_subscription]) - end - end - - describe 'with direct status' do - let(:status) { Fabricate(:status, account: alice, text: 'Hello', visibility: :direct) } - - it 'does not deliver payload' do - allow(Pubsubhubbub::DeliveryWorker).to receive(:push_bulk) - subject.perform(status.stream_entry.id) - expect(Pubsubhubbub::DeliveryWorker).to_not have_received(:push_bulk) - end + expect(Pubsubhubbub::DeliveryWorker).to have_received(:push_bulk).with([anonymous_subscription.id, subscription_with_follower.id]) end end context 'when OStatus privacy is not used' do - around do |example| - before_val = Rails.configuration.x.use_ostatus_privacy - Rails.configuration.x.use_ostatus_privacy = false - example.run - Rails.configuration.x.use_ostatus_privacy = before_val - end - describe 'with private status' do let(:status) { Fabricate(:status, account: alice, text: 'Hello', visibility: :private) } -- cgit From 9d53a38a44f3a7b7685dbaa0bc9e607928d8043e Mon Sep 17 00:00:00 2001 From: m4sk1n <me@m4sk.in> Date: Tue, 26 Sep 2017 07:19:25 +0200 Subject: i18n: Update Polish translation (#5106) * i18n: Update Polish translation * i18n: Update Polish translation --- config/locales/doorkeeper.pl.yml | 2 +- config/locales/pl.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/locales/doorkeeper.pl.yml b/config/locales/doorkeeper.pl.yml index 824a6be90..fa4324e4d 100644 --- a/config/locales/doorkeeper.pl.yml +++ b/config/locales/doorkeeper.pl.yml @@ -63,7 +63,7 @@ pl: prompt: Aplikacja %{client_name} prosi o dostęp do Twojego konta title: Wymagana jest autoryzacja show: - title: Copy this authorization code and paste it to the application. + title: Skopiuj kod uwierzytelniający i wklej go w aplikacji. authorized_applications: buttons: revoke: Unieważnij diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 8254e3293..9bf57e38b 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -307,6 +307,9 @@ pl: content: Sprawdzanie bezpieczeństwa nie powiodło się. Czy blokujesz pliki cookie? title: Sprawdzanie bezpieczeństwa nie powiodło się '429': Uduszono + '500': + content: Przepraszamy, coś poszło nie tak… + title: Ta strona jest nieprawidłowa noscript_html: Aby korzystać z aplikacji Mastodon, włącz JavaScript. Możesz też skorzystać z jednej z <a href="https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/Apps.md">natywnych aplikacji</a> obsługującej Twoje urządzenie. exports: blocks: Zablokowani -- cgit From 901fc48aaec8c6c5f1ae3c210c701abce3c03c7c Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi <ykzts@desire.sh> Date: Wed, 27 Sep 2017 21:41:54 +0900 Subject: Upgrade Webpacker to version 3.0.1 (#5122) --- Gemfile | 2 +- Gemfile.lock | 8 +++++--- Procfile.dev | 2 +- bin/webpack | 7 +++---- bin/webpack-dev-server | 47 ++++++++++++++++++++++++++++++++++++----------- config/webpacker.yml | 22 ++++++++++++++++++++-- lib/tasks/assets.rake | 2 +- 7 files changed, 67 insertions(+), 23 deletions(-) (limited to 'config') diff --git a/Gemfile b/Gemfile index 248171680..09b3b8eff 100644 --- a/Gemfile +++ b/Gemfile @@ -67,7 +67,7 @@ gem 'sprockets-rails', '~> 3.2', require: 'sprockets/railtie' gem 'statsd-instrument', '~> 2.1' gem 'twitter-text', '~> 1.14' gem 'tzinfo-data', '~> 1.2017' -gem 'webpacker', '~> 2.0' +gem 'webpacker', '~> 3.0' gem 'webpush' gem 'json-ld-preloaded', '~> 2.2.1' diff --git a/Gemfile.lock b/Gemfile.lock index 89ee34cb6..73419fd28 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -335,6 +335,8 @@ GEM rack-cors (0.4.1) rack-protection (2.0.0) rack + rack-proxy (0.6.2) + rack rack-test (0.7.0) rack (>= 1.0, < 3) rack-timeout (0.4.2) @@ -510,9 +512,9 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff - webpacker (2.0) + webpacker (3.0.1) activesupport (>= 4.2) - multi_json (~> 1.2) + rack-proxy (>= 0.6.1) railties (>= 4.2) webpush (0.3.2) hkdf (~> 0.2) @@ -621,7 +623,7 @@ DEPENDENCIES tzinfo-data (~> 1.2017) uglifier (~> 3.2) webmock (~> 3.0) - webpacker (~> 2.0) + webpacker (~> 3.0) webpush RUBY VERSION diff --git a/Procfile.dev b/Procfile.dev index 9084b4263..e75a491c7 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,4 +1,4 @@ web: PORT=3000 bundle exec puma -C config/puma.rb sidekiq: PORT=3000 bundle exec sidekiq stream: PORT=4000 yarn run start -webpack: ./bin/webpack-dev-server --host 0.0.0.0 +webpack: ./bin/webpack-dev-server --listen-host 0.0.0.0 diff --git a/bin/webpack b/bin/webpack index 867550eb8..528233a78 100755 --- a/bin/webpack +++ b/bin/webpack @@ -2,7 +2,6 @@ $stdout.sync = true require "shellwords" -require "yaml" ENV["RAILS_ENV"] ||= "development" RAILS_ENV = ENV["RAILS_ENV"] @@ -20,9 +19,9 @@ unless File.exist?(WEBPACK_CONFIG) exit! end -newenv = { "NODE_PATH" => NODE_MODULES_PATH.shellescape } -cmdline = ["yarn", "run", "webpack", "--", "--config", WEBPACK_CONFIG] + ARGV +env = { "NODE_PATH" => NODE_MODULES_PATH.shellescape } +cmd = [ "#{NODE_MODULES_PATH}/.bin/webpack", "--config", WEBPACK_CONFIG ] + ARGV Dir.chdir(APP_PATH) do - exec newenv, *cmdline + exec env, *cmd end diff --git a/bin/webpack-dev-server b/bin/webpack-dev-server index 0beec3175..c9672f663 100755 --- a/bin/webpack-dev-server +++ b/bin/webpack-dev-server @@ -3,6 +3,7 @@ $stdout.sync = true require "shellwords" require "yaml" +require "socket" ENV["RAILS_ENV"] ||= "development" RAILS_ENV = ENV["RAILS_ENV"] @@ -13,7 +14,9 @@ NODE_ENV = ENV["NODE_ENV"] APP_PATH = File.expand_path("../", __dir__) CONFIG_FILE = File.join(APP_PATH, "config/webpacker.yml") NODE_MODULES_PATH = File.join(APP_PATH, "node_modules") -WEBPACK_CONFIG = File.join(APP_PATH, "config/webpack/development.js") +WEBPACK_CONFIG = File.join(APP_PATH, "config/webpack/#{NODE_ENV}.js") + +DEFAULT_LISTEN_HOST_ADDR = NODE_ENV == 'development' ? 'localhost' : '0.0.0.0' def args(key) index = ARGV.index(key) @@ -21,23 +24,45 @@ def args(key) end begin - dev_server = YAML.load_file(CONFIG_FILE)["development"]["dev_server"] + dev_server = YAML.load_file(CONFIG_FILE)[RAILS_ENV]["dev_server"] - DEV_SERVER_HOST = "http#{"s" if args('--https') || dev_server["https"]}://#{dev_server["host"]}:#{args('--port') || dev_server["port"]}" + HOSTNAME = args('--host') || dev_server["host"] + PORT = args('--port') || dev_server["port"] + HTTPS = ARGV.include?('--https') || dev_server["https"] + DEV_SERVER_ADDR = "http#{"s" if HTTPS}://#{HOSTNAME}:#{PORT}" + LISTEN_HOST_ADDR = args('--listen-host') || DEFAULT_LISTEN_HOST_ADDR rescue Errno::ENOENT, NoMethodError - puts "Webpack dev_server configuration not found in #{CONFIG_FILE}." - puts "Please run bundle exec rails webpacker:install to install webpacker" + $stdout.puts "Webpack dev_server configuration not found in #{CONFIG_FILE}." + $stdout.puts "Please run bundle exec rails webpacker:install to install webpacker" + exit! +end + +begin + server = TCPServer.new(LISTEN_HOST_ADDR, PORT) + server.close + +rescue Errno::EADDRINUSE + $stdout.puts "Another program is running on port #{PORT}. Set a new port in #{CONFIG_FILE} for dev_server" exit! end -newenv = { - "NODE_PATH" => NODE_MODULES_PATH.shellescape, - "ASSET_HOST" => DEV_SERVER_HOST.shellescape -}.freeze +# Delete supplied host, port and listen-host CLI arguments +["--host", "--port", "--listen-host"].each do |arg| + ARGV.delete(args(arg)) + ARGV.delete(arg) +end + +env = { "NODE_PATH" => NODE_MODULES_PATH.shellescape } -cmdline = ["yarn", "run", "webpack-dev-server", "--", "--progress", "--color", "--config", WEBPACK_CONFIG] + ARGV +cmd = [ + "#{NODE_MODULES_PATH}/.bin/webpack-dev-server", "--progress", "--color", + "--config", WEBPACK_CONFIG, + "--host", LISTEN_HOST_ADDR, + "--public", "#{HOSTNAME}:#{PORT}", + "--port", PORT.to_s +] + ARGV Dir.chdir(APP_PATH) do - exec newenv, *cmdline + exec env, *cmd end diff --git a/config/webpacker.yml b/config/webpacker.yml index aa429a1dd..8d8470651 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -4,6 +4,15 @@ default: &default source_path: app/javascript source_entry_path: packs public_output_path: packs + cache_path: tmp/cache/webpacker + + # Additional paths webpack should lookup modules + # ['app/assets', 'engine/foo/app/assets'] + resolved_paths: [] + + # Reload manifest.json on all requests so we reload latest compiled packs + cache_manifest: false + extensions: - .js - .sass @@ -17,16 +26,25 @@ default: &default development: <<: *default + compile: true dev_server: - host: 127.0.0.1 - port: 8080 + host: localhost + port: 3035 + hmr: false https: false test: <<: *default + # Compile test packs to a separate directory public_output_path: packs-test production: <<: *default + + # Production depends on precompilation of packs prior to booting for performance. + compile: false + + # Cache manifest.json for performance + cache_manifest: true diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index 92d5aea80..44896afc7 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -16,7 +16,7 @@ end if Rake::Task.task_defined?('assets:precompile') Rake::Task['assets:precompile'].enhance do - Webpacker::Manifest.load + Webpacker.manifest.refresh Rake::Task['assets:generate_static_pages'].invoke end end -- cgit From db3ed498b08d1ff3b1ca16d326a51abef28b9184 Mon Sep 17 00:00:00 2001 From: Eugen Rochko <eugen@zeonfederated.com> Date: Wed, 27 Sep 2017 23:42:49 +0200 Subject: When OAuth password verification fails, return 401 instead of redirect (#5111) Call to warden.authenticate! in resource_owner_from_credentials would make the request redirect to sign-in path, which is a bad response for apps. Now bad credentials just return nil, which leads to HTTP 401 from Doorkeeper. Also, accounts with enabled 2FA cannot be logged into this way. --- config/initializers/doorkeeper.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'config') diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index 689e2ac4a..074f8c410 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -7,15 +7,14 @@ Doorkeeper.configure do current_user || redirect_to(new_user_session_url) end - resource_owner_from_credentials do |routes| - request.params[:user] = { email: request.params[:username], password: request.params[:password] } - request.env["devise.allow_params_authentication"] = true - request.env["warden"].authenticate!(scope: :user) + resource_owner_from_credentials do |_routes| + user = User.find_by(email: request.params[:username]) + user if !user&.otp_required_for_login? && user&.valid_password?(request.params[:password]) end # If you want to restrict access to the web interface for adding oauth authorized applications, you need to declare the block below. admin_authenticator do - (current_user && current_user.admin?) || redirect_to(new_user_session_url) + current_user&.admin? || redirect_to(new_user_session_url) end # Authorization Code expiration time (default 10 minutes). -- cgit