diff --git a/Gemfile b/Gemfile
index f94c33fa5e..f32c47baae 100644
--- a/Gemfile
+++ b/Gemfile
@@ -64,6 +64,8 @@ gem 'mini_magick'
gem 'mongo', '~> 2.2', '>= 2.2.5'
+gem "newrelic_rpm", "~> 6.7.0.359"
+
# Oauth client for google / youtube
gem "omniauth-google-oauth2", "~> 0.5.2"
@@ -185,11 +187,6 @@ group :test do
gem "rails-controller-testing"
end
-group :production do
- # App monitoring
- gem "newrelic_rpm", "~> 3.16"
-end
-
group :development, :test do
# Create a temporary table-backed ActiveRecord model
gem 'temping'
diff --git a/Gemfile.lock b/Gemfile.lock
index e9c33e4a93..d7d8a92bb9 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -138,8 +138,7 @@ GEM
selenium-webdriver
case_transform (0.2)
activesupport
- childprocess (1.0.1)
- rake (< 13.0)
+ childprocess (3.0.0)
chromedriver-helper (2.1.1)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
@@ -259,7 +258,7 @@ GEM
multipart-post (2.1.1)
mustermann (1.0.3)
netrc (0.11.0)
- newrelic_rpm (3.18.1.330)
+ newrelic_rpm (6.7.0.359)
nio4r (2.4.0)
nokogiri (1.10.4)
mini_portile2 (~> 2.4.0)
@@ -367,7 +366,7 @@ GEM
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
- rake (12.3.3)
+ rake (13.0.0)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
@@ -401,7 +400,7 @@ GEM
rubocop (>= 0.58.0)
ruby-progressbar (1.10.1)
ruby_http_client (3.3.0)
- rubyzip (1.2.3)
+ rubyzip (2.0.0)
rufus-scheduler (3.6.0)
fugit (~> 1.1, >= 1.1.6)
safe_yaml (1.0.5)
@@ -425,9 +424,9 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
- selenium-webdriver (3.142.3)
- childprocess (>= 0.5, < 2.0)
- rubyzip (~> 1.2, >= 1.2.2)
+ selenium-webdriver (3.142.6)
+ childprocess (>= 0.5, < 4.0)
+ rubyzip (>= 1.2.2)
sendgrid-ruby (6.0.0)
ruby_http_client (~> 3.3.0)
sentry-raven (2.9.0)
@@ -559,7 +558,7 @@ DEPENDENCIES
minitest-rails-capybara (~> 3.0.1)
mocha
mongo (~> 2.2, >= 2.2.5)
- newrelic_rpm (~> 3.16)
+ newrelic_rpm (~> 6.7.0.359)
nokogiri
omniauth-github
omniauth-google-oauth2 (~> 0.5.2)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 97e1ce5f45..c732f6d2f5 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -14,6 +14,8 @@ class ApplicationController < ActionController::Base
before_action :set_paper_trail_whodunnit
before_action :no_cache
+ newrelic_ignore_enduser
+
rescue_from Ability::AdminNotOnIPWhitelistError do |e|
render file: "admin/errors/whitelist.html", layout: false
end
diff --git a/app/controllers/channels_controller.rb b/app/controllers/channels_controller.rb
index 742f7ab558..9bd6d689ea 100644
--- a/app/controllers/channels_controller.rb
+++ b/app/controllers/channels_controller.rb
@@ -34,7 +34,7 @@ def verification_status
respond_to do |format|
format.json {
render(json: { status: channel_verification_status(current_channel),
- details: channel_verification_details(current_channel).nil? ? nil : channel_verification_details(current_channel).upcase_first },
+ details: failed_verification_details(current_channel).nil? ? nil : failed_verification_details(current_channel).upcase_first },
status: 200)
}
end
diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb
index db0f85111b..21a624973e 100644
--- a/app/controllers/errors_controller.rb
+++ b/app/controllers/errors_controller.rb
@@ -23,21 +23,11 @@ def error_500
def render_page
@status = status
- respond_to do |format|
- format.all do
- render(
- nothing: true,
- status: @status
- )
- end
- format.html do
- render(
- layout: "error",
- status: @status,
- template: "errors/shared"
- )
- end
- end
+ render(
+ layout: "error",
+ status: @status,
+ template: "errors/shared"
+ )
end
def status
diff --git a/app/helpers/channels_helper.rb b/app/helpers/channels_helper.rb
index f27a33236c..29f4ae294e 100644
--- a/app/helpers/channels_helper.rb
+++ b/app/helpers/channels_helper.rb
@@ -62,8 +62,7 @@ def channel_verification_status(channel)
end
end
- def channel_verification_details(channel)
- return if channel.verified? || channel.details_type != "SiteChannelDetails"
+ def failed_verification_details(channel)
case channel.verification_details
when "domain_not_found"
I18n.t("helpers.channels.verification_failure_explanation.domain_not_found")
diff --git a/app/helpers/publishers_helper.rb b/app/helpers/publishers_helper.rb
index 36c2b03ec0..8509b35608 100644
--- a/app/helpers/publishers_helper.rb
+++ b/app/helpers/publishers_helper.rb
@@ -14,7 +14,7 @@ def publishers_meta_tags
charset: "utf-8",
og: {
title: :title,
- image: image_url("open-graph-preview.png", host: root_url),
+ image: image_url("open-graph-preview.png"),
description: t("shared.app_description"),
url: request.url,
type: "website",
diff --git a/app/jobs/create_uphold_channel_card_job.rb b/app/jobs/create_uphold_channel_card_job.rb
index a354f14f45..4f18d35e23 100644
--- a/app/jobs/create_uphold_channel_card_job.rb
+++ b/app/jobs/create_uphold_channel_card_job.rb
@@ -23,6 +23,8 @@ def perform(uphold_connection_id:, channel_id:)
upfc.update(
address: get_address(uphold_connection, card_id),
card_id: card_id,
+ # It's possible a channel can be removed, so this covers re-linking an existing UCFC to the re-added channel.
+ channel_id: channel_id,
uphold_id: uphold_connection.uphold_id
)
end
diff --git a/app/views/layouts/full-width.html.slim b/app/views/layouts/full-width.html.slim
deleted file mode 100644
index 0f64659357..0000000000
--- a/app/views/layouts/full-width.html.slim
+++ /dev/null
@@ -1 +0,0 @@
-= render(template: "layouts/application")
diff --git a/app/views/publishers/_channel.html.slim b/app/views/publishers/_channel.html.slim
index b040f006f5..e41ec0bd6c 100644
--- a/app/views/publishers/_channel.html.slim
+++ b/app/views/publishers/_channel.html.slim
@@ -51,7 +51,7 @@
span.verification-failed--what-happened=t("helpers.channels.verification_failure_what_happened")
span.verification-failed--explanation
span.verification-failed-explanation--content
- = channel_verification_details(channel).upcase_first
+ = failed_verification_details(channel).upcase_first
.ml-2
= link_to(t(".try_again"), channel_next_step_path(channel), class: "btn btn-primary try-again")
diff --git a/app/views/site_channels/_verification_failed_modal.html.slim b/app/views/site_channels/_verification_failed_modal.html.slim
index db36c30f81..45803e1030 100644
--- a/app/views/site_channels/_verification_failed_modal.html.slim
+++ b/app/views/site_channels/_verification_failed_modal.html.slim
@@ -3,9 +3,9 @@
= render "application/icon_circled_x"
h4= t(".headline")
p
- =t(".leadin", domain: current_channel.details.brave_publisher_id)
- =channel_verification_details(current_channel)
- =failed_verification_call_to_action(current_channel)
+ = t(".leadin", domain: current_channel.details.brave_publisher_id)
+ = failed_verification_details(current_channel)
+ = failed_verification_call_to_action(current_channel)
- if should_display_verification_token?(current_channel)
textarea.color-orange.form-control.form-control--code#value readonly="true"
= site_channel_verification_dns_record(current_channel)
@@ -24,4 +24,4 @@
"data-piwik-name": "Clicked", \
"data-piwik-value": "SiteChannelFlow" \
)
- = link_to t(".close"), "#", class: "js-deny btn btn-outline-primary"
\ No newline at end of file
+ = link_to t(".close"), "#", class: "js-deny btn btn-outline-primary"
diff --git a/config/locales/views/publishers/security/ja.yml b/config/locales/views/publishers/security/ja.yml
new file mode 100644
index 0000000000..7696032c74
--- /dev/null
+++ b/config/locales/views/publishers/security/ja.yml
@@ -0,0 +1,60 @@
+ja:
+ publishers:
+ security:
+ prompt:
+ heading: アカウントのセキュリティを高めましょう
+ subheading: 2段階認証の設定をしてください
+ intro: 自分以外による不正なログインを防止するため、二要素認証の設定を推奨しています
+ skip: スキップ
+ setup: 二要素認証を設定する
+ index:
+ heading: 二要素認証
+ intro: 二要素認証(2FA)とはBrave Paymentにログインする際、メールアドレスとパスワードに加えて、他の形式の情報の入力を必要とすることで、セキュリティを強化する機能です。(アカウント保護の観点で設定を推奨しています)
+ enabled_yes: 有効
+ enabled_no: 無効
+ totp:
+ heading: 二要素認証用スマートフォンアプリ
+ intro: |
+ 二要素認証利用時にログインに必要なコードを生成するスマートフォンアプリです。
+ enabled: 二要素認証アプリの設定済
+ disabled: 二要素認証アプリが未設定
+ disabled_without_fallback_html: |
+ 推奨: セキュリティリスクを下げるため、必ずAuthenticatorを二要素認証用に設定してください。
+ reconfigure: 再設定
+ button: 設定する
+ destroy: 無効化する
+ confirm_disable:
+ header: Authenticatorを無効化しますか?
+ intro: "残りの二要素認証方法 : "
+ none: なし
+ no_totp_warning: |
+ Authenticatorアプリは万が一物理的なセキュリティキーを紛失した際の、
+ 予備の手段として最適です。
+ no_2fa_warning_html: |
+ Authenticatorアプリを無効化すると、アカウントに設定された
+ 二要素認証が直ちに無効になります。
+ final_confirmation: |
+ 本当にAuthenticatorアプリを無効にしますか?
+ deny: 無効にしない
+ confirm: いますぐ無効にする
+ name_default: 匿名キー
+ u2f:
+ heading: 物理的なセキュリティキー
+ intro: |
+ 二要素認証を行える小型のハードウェアデバイスです。
+ 認証コードを入力する代わりに、コンピューターのUSBに接続し認証を行います。
+ (認証標準であるFIDO U2Fに対応している必要があります。)
+ intro_warning: |
+ 現在セキュリティキーはBrave、Chrome、Operaに対応しています。
+ browser:
+ heading: ブラウザが対応していません。
+ content_html: セキュリティキーを設定するには、最新の Brave 、Google Chrome strong>または Opera に更新する必要があります。将来的にはより多くのブラウザがサポートを開始する予定です。今後更新があればお知らせ致します。
+ device:
+ tooltip: テスト済みのセキュリティキー
+ heading: テスト済みのセキュリティキー
+ content_html: |
+ 次の製品はテストされ、動作が確認されています :
+ - YubiKey
+ - Ledger Blue
+ disabled: セキュリティキーが設定されていません
+ button: セキュリティキーを追加する
diff --git a/config/locales/views/publishers/settings/ja.yml b/config/locales/views/publishers/settings/ja.yml
new file mode 100644
index 0000000000..2831ac428f
--- /dev/null
+++ b/config/locales/views/publishers/settings/ja.yml
@@ -0,0 +1,18 @@
+ja:
+ publishers:
+ settings:
+ index:
+ header: アカウント設定
+ extended_login:
+ intro: ログイン状態を30日維持する
+ delete_account:
+ heading: アカウント削除
+ intro: あなたのチャンネルとすべてのアカウント関連情報は、データベースおよび接続されているプロバイダーから完全に削除されます。 これは、元に戻すことはできません。
+ button: アカウントを削除する
+ prompt:
+ header: "アカウントを削除してもよろしいですか?"
+ final_confirmation: 完全に完了するまで数分かかります。
+ deny: いいえ、アカウントをそのままにしてください
+ confirm: はい、アカウントを削除してください
+ update:
+ alert: アカウント設定が更新されました
diff --git a/config/locales/views/u2f_registrations/ja.yml b/config/locales/views/u2f_registrations/ja.yml
new file mode 100644
index 0000000000..075670fb05
--- /dev/null
+++ b/config/locales/views/u2f_registrations/ja.yml
@@ -0,0 +1,44 @@
+ja:
+ u2f_registrations:
+ new:
+ heading: セキュリティキーを登録する
+ name_placeholder: キーに設定するニックネーム
+ submit_value: 追加
+ waiting_heading: セキュリティキーが挿入されるのを待っています...
+ waiting_description: |
+ 新しいハードウェアキーをコンピューターに挿入し、点滅しているときにボタンを押してください。
+ u2f-unavailable: |
+ お使いのブラウザは、Braveがサポートする二要素認証プラットフォームであるU2Fをサポートしていないようです。YubiKeyなど、U2F互換デバイスを登録するには、Brave、Chrome、またはOperaの最新バージョンを使用してください。
+ u2f-error:
+ bad-request: |
+ Braveによる登録リクエスト時に予期しないエラーが発生しました。
+ このページをリロードして、再度と登録してみてください。
+ (BAD_REQUEST)
+ configuration-unsupported: |
+ クライアント構成がサポートされていません。 (CONFIGURATION_UNSUPPORTED)
+ device-ineligible: |
+ 提示されたセキュリティキーは登録できません。
+ トークンが既に登録されている可能性があります。 (DEVICE_INELIGIBLE)
+ other-error: |
+ There was an unexpected error registering your security key. Re-attempting
+ registration may resolve this issue. (OTHER_ERROR)
+ timeout: |
+ セキュリティキーが登録要求への応答待機時に、予期しないタイムアウトが発生しました。
+ 再度登録を開始し、点滅している間にセキュリティキーを有効にしてください。 (TIMEOUT)
+ implementation-incomplete: |
+ セキュリティキーを挿入して登録を再試行してください。
+ 一部のブラウザは、このプロトコルへの対応が不完全です。
+ Brave、Google Chrome、またはOperaの最新版を使用してください。
+ (IMPLEMENTATION_INCOMPLETE)
+ u2f_registration:
+ name_default: "匿名キー"
+ confirm_disable:
+ header: "セキュリティキーを削除しますか?"
+ intro: "残りの二要素認証手段:"
+ remaining_totp: 二要素認証用スマートフォンアプリ
+ none: なし
+ no_2fa_warning_html: |
+ Authenticatorアプリを無効化すると、アカウントに設定された 二要素認証が直ちに無効になります。
+ final_confirmation: "本当にAuthenticatorアプリを無効にしますか?"
+ deny: 無効にしない
+ confirm: いますぐ無効にする
diff --git a/test/controllers/channels_controller_test.rb b/test/controllers/channels_controller_test.rb
index d1cbd7f4d8..c4d3f38cbe 100644
--- a/test/controllers/channels_controller_test.rb
+++ b/test/controllers/channels_controller_test.rb
@@ -106,7 +106,7 @@ class ChannelsControllerTest < ActionDispatch::IntegrationTest
assert_response 200
assert_match(
'{"status":"verified",' +
- '"details":null}',
+ '"details":"Of an unknown reason. "}',
response.body)
end
end
diff --git a/test/helpers/channels_helper_test.rb b/test/helpers/channels_helper_test.rb
index 4f9f948125..a467694be4 100644
--- a/test/helpers/channels_helper_test.rb
+++ b/test/helpers/channels_helper_test.rb
@@ -14,41 +14,38 @@ class PublishersHelperTest < ActionView::TestCase
assert_equal 'verified', channel_verification_status(channel)
end
- test "channel_verification_details" do
+ test "failed_verification_details" do
channel = channels(:new_site)
channel.verification_failed!
- assert_equal t("helpers.channels.verification_failure_explanation.generic"), channel_verification_details(channel)
+ assert_equal t("helpers.channels.verification_failure_explanation.generic"), failed_verification_details(channel)
channel.verification_failed!("domain_not_found")
- assert_equal t("helpers.channels.verification_failure_explanation.domain_not_found"), channel_verification_details(channel)
+ assert_equal t("helpers.channels.verification_failure_explanation.domain_not_found"), failed_verification_details(channel)
channel.verification_failed!("connection_failed")
assert_equal t("helpers.channels.verification_failure_explanation.connection_failed", domain: channel.details.brave_publisher_id),
- channel_verification_details(channel)
+ failed_verification_details(channel)
channel.verification_failed!("too_many_redirects")
- assert_equal t("helpers.channels.verification_failure_explanation.too_many_redirects"), channel_verification_details(channel)
+ assert_equal t("helpers.channels.verification_failure_explanation.too_many_redirects"), failed_verification_details(channel)
channel.verification_failed!("no_txt_records")
- assert_equal t("helpers.channels.verification_failure_explanation.no_txt_records"), channel_verification_details(channel)
+ assert_equal t("helpers.channels.verification_failure_explanation.no_txt_records"), failed_verification_details(channel)
channel.verification_failed!("token_incorrect_dns")
- assert_equal t("helpers.channels.verification_failure_explanation.token_incorrect_dns"), channel_verification_details(channel)
+ assert_equal t("helpers.channels.verification_failure_explanation.token_incorrect_dns"), failed_verification_details(channel)
channel.verification_failed!("token_not_found_dns")
- assert_equal t("helpers.channels.verification_failure_explanation.token_not_found_dns"), channel_verification_details(channel)
+ assert_equal t("helpers.channels.verification_failure_explanation.token_not_found_dns"), failed_verification_details(channel)
channel.verification_failed!("token_not_found_public_file")
- assert_equal t("helpers.channels.verification_failure_explanation.token_not_found_public_file"), channel_verification_details(channel)
+ assert_equal t("helpers.channels.verification_failure_explanation.token_not_found_public_file"), failed_verification_details(channel)
channel.verification_failed!("no_https")
- assert_equal t("helpers.channels.verification_failure_explanation.no_https"), channel_verification_details(channel)
+ assert_equal t("helpers.channels.verification_failure_explanation.no_https"), failed_verification_details(channel)
channel.verification_succeeded!(false)
- assert_nil channel_verification_details(channel)
-
- channel.verification_succeeded!(true)
- assert_nil channel_verification_details(channel)
+ assert_equal t("helpers.channels.verification_failure_explanation.generic"), failed_verification_details(channel)
end
end