diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-07 17:47:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-07 17:47:00 +0300 |
commit | 08086ff522742c28a6b10e9b2ed71f0af6633e5b (patch) | |
tree | 5a4fde8b23140cb4edf04b24854b53f87085dd42 /app | |
parent | 8f3fbbf0d56091ad87158f61bf2a4e96a7f937e3 (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-ee
Diffstat (limited to 'app')
-rw-r--r-- | app/services/spam/akismet_service.rb | 8 | ||||
-rw-r--r-- | app/views/devise/sessions/_new_base.html.haml | 2 | ||||
-rw-r--r-- | app/views/devise/shared/_signup_box.html.haml | 4 | ||||
-rw-r--r-- | app/views/groups/_new_group_fields.html.haml | 2 | ||||
-rw-r--r-- | app/views/notify/ssh_key_expired_email.html.haml | 2 | ||||
-rw-r--r-- | app/views/notify/ssh_key_expired_email.text.erb | 2 | ||||
-rw-r--r-- | app/views/notify/ssh_key_expiring_soon.text.erb | 2 | ||||
-rw-r--r-- | app/views/notify/ssh_key_expiring_soon_email.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/_recaptcha_form.html.haml | 2 |
9 files changed, 15 insertions, 11 deletions
diff --git a/app/services/spam/akismet_service.rb b/app/services/spam/akismet_service.rb index 4e56972ccd5..e9843497dd7 100644 --- a/app/services/spam/akismet_service.rb +++ b/app/services/spam/akismet_service.rb @@ -20,14 +20,18 @@ module Spam created_at: DateTime.current, author: owner_name, author_email: owner_email, - referer: options[:referer] + referrer: options[:referer] } begin is_spam, is_blatant = akismet_client.check(options[:ip_address], options[:user_agent], params) is_spam || is_blatant + rescue ArgumentError => e + Gitlab::ErrorTracking.track_and_raise_for_dev_exception(e) + false rescue StandardError => e - Gitlab::AppLogger.error("Unable to connect to Akismet: #{e}, skipping check") + Gitlab::ErrorTracking.track_exception(e) + Gitlab::AppLogger.error("Error during Akismet spam check, flagging as not spam: #{e}") false end end diff --git a/app/views/devise/sessions/_new_base.html.haml b/app/views/devise/sessions/_new_base.html.haml index 98af69d43b7..82c0df354d4 100644 --- a/app/views/devise/sessions/_new_base.html.haml +++ b/app/views/devise/sessions/_new_base.html.haml @@ -17,7 +17,7 @@ = link_to _('Forgot your password?'), new_password_path(:user) %div - if captcha_enabled? || captcha_on_login_required? - = recaptcha_tags + = recaptcha_tags nonce: content_security_policy_nonce .submit-container.move-submit-down = f.submit _('Sign in'), class: 'gl-button btn btn-confirm', data: { qa_selector: 'sign_in_button' } diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index 56f74916d8f..1b410f0b671 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -11,7 +11,7 @@ .devise-errors = render 'devise/shared/error_messages', resource: resource - if Gitlab::CurrentSettings.invisible_captcha_enabled - = invisible_captcha + = invisible_captcha nonce: true .name.form-row .col.form-group = f.label :first_name, _('First name'), for: 'new_user_first_name', class: 'label-bold' @@ -34,7 +34,7 @@ %p.gl-field-hint.text-secondary= s_('SignUp|Minimum length is %{minimum_password_length} characters.') % { minimum_password_length: @minimum_password_length } %div - if show_recaptcha_sign_up? - = recaptcha_tags + = recaptcha_tags nonce: content_security_policy_nonce .submit-container = f.submit button_text, class: 'btn gl-button btn-confirm', data: { qa_selector: 'new_user_register_button' } = render 'devise/shared/terms_of_service_notice', button_text: button_text diff --git a/app/views/groups/_new_group_fields.html.haml b/app/views/groups/_new_group_fields.html.haml index fd0a7af30ed..fbf9438718e 100644 --- a/app/views/groups/_new_group_fields.html.haml +++ b/app/views/groups/_new_group_fields.html.haml @@ -20,7 +20,7 @@ - if captcha_required? .row.recaptcha .col-sm-4 - = recaptcha_tags + = recaptcha_tags nonce: content_security_policy_nonce .row .form-actions.col-sm-12 = f.submit _('Create group'), class: "btn gl-button btn-confirm" diff --git a/app/views/notify/ssh_key_expired_email.html.haml b/app/views/notify/ssh_key_expired_email.html.haml index 21138bb0113..651bdac7acb 100644 --- a/app/views/notify/ssh_key_expired_email.html.haml +++ b/app/views/notify/ssh_key_expired_email.html.haml @@ -1,7 +1,7 @@ %p = _('Hi %{username}!') % { username: sanitize_name(@user.name) } %p - = _('Your SSH keys with the following fingerprints has expired:') + = _('Your SSH keys with the following fingerprints have expired. Expired SSH keys will not be usable in future versions of GitLab:') %table %tbody - @fingerprints.each do |fingerprint| diff --git a/app/views/notify/ssh_key_expired_email.text.erb b/app/views/notify/ssh_key_expired_email.text.erb index 77b76084606..aa6e79d59b8 100644 --- a/app/views/notify/ssh_key_expired_email.text.erb +++ b/app/views/notify/ssh_key_expired_email.text.erb @@ -1,6 +1,6 @@ <%= _('Hi %{username}!') % { username: sanitize_name(@user.name) } %> -<%= _('Your SSH keys with the following fingerprints has expired:') %> +<%= _('Your SSH keys with the following fingerprints have expired. Expired SSH keys will not be usable in future versions of GitLab:') %> <% @fingerprints.each do |fingerprint| %> - <%= fingerprint %> diff --git a/app/views/notify/ssh_key_expiring_soon.text.erb b/app/views/notify/ssh_key_expiring_soon.text.erb index 2a7c0cafe83..ff6feb87662 100644 --- a/app/views/notify/ssh_key_expiring_soon.text.erb +++ b/app/views/notify/ssh_key_expiring_soon.text.erb @@ -1,6 +1,6 @@ <%= _('Hi %{username}!') % { username: sanitize_name(@user.name) } %> -<%= _('Your SSH keys with the following fingerprints are scheduled to expire soon:') %> +<%= _('Your SSH keys with the following fingerprints are scheduled to expire soon. Expired SSH keys will not be usable in future versions of GitLab:') %> <% @fingerprints.each do |fingerprint| %> - <%= fingerprint %> diff --git a/app/views/notify/ssh_key_expiring_soon_email.html.haml b/app/views/notify/ssh_key_expiring_soon_email.html.haml index f4aee9c5fde..924165ecf3d 100644 --- a/app/views/notify/ssh_key_expiring_soon_email.html.haml +++ b/app/views/notify/ssh_key_expiring_soon_email.html.haml @@ -1,7 +1,7 @@ %p = _('Hi %{username}!') % { username: sanitize_name(@user.name) } %p - = _('Your SSH keys with the following fingerprints are scheduled to expire soon:') + = _('Your SSH keys with the following fingerprints are scheduled to expire soon. Expired SSH keys will not be usable in future versions of GitLab:') %table %tbody - @fingerprints.each do |fingerprint| diff --git a/app/views/shared/_recaptcha_form.html.haml b/app/views/shared/_recaptcha_form.html.haml index 5c5fc714aea..ae0a22fd255 100644 --- a/app/views/shared/_recaptcha_form.html.haml +++ b/app/views/shared/_recaptcha_form.html.haml @@ -10,7 +10,7 @@ = hidden_field(resource_name, field, value: value) = hidden_field_tag(:spam_log_id, spammable.spam_log.id) -# The reCAPTCHA response value will be returned in the 'g-recaptcha-response' field - = recaptcha_tags script: script, callback: 'recaptchaDialogCallback' unless Rails.env.test? + = recaptcha_tags script: script, callback: 'recaptchaDialogCallback', nonce: content_security_policy_nonce unless Rails.env.test? -# Fake the 'g-recaptcha-response' field in the test environment, so that the feature spec -# can get to the (mocked) SpamVerdictService check. = hidden_field_tag('g-recaptcha-response', 'abc123') if Rails.env.test? |