summaryrefslogtreecommitdiff
path: root/app/views/admin/application_settings/_protected_paths.html.haml
blob: 04b42f420145c89d8c0c95a7bfeb819bcda92177 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
= form_for @application_setting, url: network_admin_application_settings_path(anchor: 'js-protected-paths-settings'), html: { class: 'fieldset-form' } do |f|
  = form_errors(@application_setting)

  %fieldset
    - if omnibus_protected_paths_throttle?
      .bs-callout.bs-callout-danger
        - relative_url_link = 'https://docs.gitlab.com/ee/user/admin_area/settings/protected_paths.html#migrate-settings-from-gitlab-123-and-earlier'
        - relative_url_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: relative_url_link }
        = _("Omnibus Protected Paths throttle is active, and takes priority over these settings. From 12.4, Omnibus throttle is deprecated and will be removed in a future release. Please read the %{relative_url_link_start}Migrating Protected Paths documentation%{relative_url_link_end}.").html_safe % { relative_url_link_start: relative_url_link_start, relative_url_link_end: '</a>'.html_safe }

    .form-group
      .form-check
        = f.check_box :throttle_protected_paths_enabled, class: 'form-check-input'
        = f.label :throttle_protected_paths_enabled, class: 'form-check-label' do
          = _('Enable protected paths rate limit')
        %span.form-text.text-muted
          = _('Helps reduce request volume for protected paths')
    .form-group
      = f.label :throttle_protected_paths_requests_per_period, 'Max requests per period per user', class: 'label-bold'
      = f.number_field :throttle_protected_paths_requests_per_period, class: 'form-control gl-form-input'
    .form-group
      = f.label :throttle_protected_paths_period_in_seconds, 'Rate limit period in seconds', class: 'label-bold'
      = f.number_field :throttle_protected_paths_period_in_seconds, class: 'form-control gl-form-input'
    .form-group
      = f.label :protected_paths, class: 'label-bold' do
        - relative_url_link = 'https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-a-relative-url-for-gitlab'
        - relative_url_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: relative_url_link }
        = _('All paths are relative to the GitLab URL. Do not include %{relative_url_link_start}relative URL%{relative_url_link_end}.').html_safe % { relative_url_link_start: relative_url_link_start, relative_url_link_end: '</a>'.html_safe }
      = f.text_area :protected_paths_raw, placeholder: '/users/sign_in,/users/password', class: 'form-control gl-form-input', rows: 10

  = f.submit _('Save changes'), class: 'gl-button btn btn-confirm'