diff options
Diffstat (limited to 'app/views/admin/application_settings')
20 files changed, 217 insertions, 83 deletions
diff --git a/app/views/admin/application_settings/_ci_cd.html.haml b/app/views/admin/application_settings/_ci_cd.html.haml index ee97a678aaa..fea116bd419 100644 --- a/app/views/admin/application_settings/_ci_cd.html.haml +++ b/app/views/admin/application_settings/_ci_cd.html.haml @@ -41,7 +41,7 @@ = f.label :default_artifacts_expire_in, _('Default artifacts expiration'), class: 'label-bold' = f.text_field :default_artifacts_expire_in, class: 'form-control gl-form-input' .form-text.text-muted - = html_escape(_("The default expiration time for job artifacts. 0 for unlimited. The default unit is in seconds, but you can use other units, for example %{code_open}4 mins 2 sec%{code_close}, %{code_open}2h42min%{code_close}.")) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } + = html_escape(_("Set the default expiration time for job artifacts in all projects. Set to %{code_open}0%{code_close} to never expire artifacts by default. If no unit is written, it defaults to seconds. For example, these are all equivalent: %{code_open}3600%{code_close}, %{code_open}60 minutes%{code_close}, or %{code_open}one hour%{code_close}.")) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } = link_to _('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'default-artifacts-expiration') .form-group .form-check diff --git a/app/views/admin/application_settings/_eks.html.haml b/app/views/admin/application_settings/_eks.html.haml index c44bad132bd..c83e28d7f0b 100644 --- a/app/views/admin/application_settings/_eks.html.haml +++ b/app/views/admin/application_settings/_eks.html.haml @@ -17,20 +17,20 @@ .form-check = f.check_box :eks_integration_enabled, class: 'form-check-input' = f.label :eks_integration_enabled, class: 'form-check-label' do - Enable Amazon EKS integration + = _('Enable Amazon EKS integration') .form-group - = f.label :eks_account_id, 'Account ID', class: 'label-bold' + = f.label :eks_account_id, _('Account ID'), class: 'label-bold' = f.text_field :eks_account_id, class: 'form-control gl-form-input' .form-group - = f.label :eks_access_key_id, 'Access key ID', class: 'label-bold' + = f.label :eks_access_key_id, _('Access key ID'), class: 'label-bold' = f.text_field :eks_access_key_id, class: 'form-control gl-form-input' .form-text.text-muted = _('AWS Access Key. Only required if not using role instance credentials') .form-group - = f.label :eks_secret_access_key, 'Secret access key', class: 'label-bold' + = f.label :eks_secret_access_key, _('Secret access key'), class: 'label-bold' = f.password_field :eks_secret_access_key, autocomplete: 'off', class: 'form-control gl-form-input' .form-text.text-muted = _('AWS Secret Access Key. Only required if not using role instance credentials') - = f.submit 'Save changes', class: "gl-button btn btn-confirm" + = f.submit _('Save changes'), class: "gl-button btn btn-confirm" diff --git a/app/views/admin/application_settings/_email.html.haml b/app/views/admin/application_settings/_email.html.haml index 1c35250644d..073c0bf619d 100644 --- a/app/views/admin/application_settings/_email.html.haml +++ b/app/views/admin/application_settings/_email.html.haml @@ -33,4 +33,12 @@ .form-text.text-muted = _('Send emails to help guide new users through the onboarding process.') + .form-group + .form-check + = f.check_box :user_deactivation_emails_enabled, class: 'form-check-input' + = f.label :user_deactivation_emails_enabled, class: 'form-check-label' do + = _('Enable user deactivation emails') + .form-text.text-muted + = _('Send emails to users upon account deactivation.') + = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_external_authorization_service_form.html.haml b/app/views/admin/application_settings/_external_authorization_service_form.html.haml index abd182027b1..23484eaec32 100644 --- a/app/views/admin/application_settings/_external_authorization_service_form.html.haml +++ b/app/views/admin/application_settings/_external_authorization_service_form.html.haml @@ -47,4 +47,4 @@ .form-group = f.label :external_authorization_service_default_label, _('Default classification label'), class: 'label-bold' = f.text_field :external_authorization_service_default_label, class: 'form-control gl-form-input' - = f.submit 'Save changes', class: "gl-button btn btn-confirm" + = f.submit _('Save changes'), class: "gl-button btn btn-confirm" diff --git a/app/views/admin/application_settings/_files_limits.html.haml b/app/views/admin/application_settings/_files_limits.html.haml new file mode 100644 index 00000000000..9cd12fa1caa --- /dev/null +++ b/app/views/admin/application_settings/_files_limits.html.haml @@ -0,0 +1,34 @@ += gitlab_ui_form_for @application_setting, url: network_admin_application_settings_path(anchor: 'js-files-limits-settings'), html: { class: 'fieldset-form' } do |f| + = form_errors(@application_setting) + + %fieldset + %legend.h5.gl-border-none + = _('Unauthenticated API request rate limit') + .form-group + = f.gitlab_ui_checkbox_component :throttle_unauthenticated_files_api_enabled, + _('Enable unauthenticated API request rate limit'), + help_text: _('Helps reduce request volume (e.g. from crawlers or abusive bots)'), + checkbox_options: { data: { qa_selector: 'throttle_unauthenticated_files_api_checkbox' } } + .form-group + = f.label :throttle_unauthenticated_files_api_requests_per_period, 'Max unauthenticated API requests per period per IP', class: 'label-bold' + = f.number_field :throttle_unauthenticated_files_api_requests_per_period, class: 'form-control gl-form-input' + .form-group + = f.label :throttle_unauthenticated_files_api_period_in_seconds, 'Unauthenticated API rate limit period in seconds', class: 'label-bold' + = f.number_field :throttle_unauthenticated_files_api_period_in_seconds, class: 'form-control gl-form-input' + + %fieldset + %legend.h5.gl-border-none + = _('Authenticated API request rate limit') + .form-group + = f.gitlab_ui_checkbox_component :throttle_authenticated_files_api_enabled, + _('Enable authenticated API request rate limit'), + help_text: _('Helps reduce request volume (e.g. from crawlers or abusive bots)'), + checkbox_options: { data: { qa_selector: 'throttle_authenticated_files_api_checkbox' } } + .form-group + = f.label :throttle_authenticated_files_api_requests_per_period, 'Max authenticated API requests per period per user', class: 'label-bold' + = f.number_field :throttle_authenticated_files_api_requests_per_period, class: 'form-control gl-form-input' + .form-group + = f.label :throttle_authenticated_files_api_period_in_seconds, 'Authenticated API rate limit period in seconds', class: 'label-bold' + = f.number_field :throttle_authenticated_files_api_period_in_seconds, class: 'form-control gl-form-input' + + = f.submit 'Save changes', class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_floc.html.haml b/app/views/admin/application_settings/_floc.html.haml index 398064f9730..52833b5cfc2 100644 --- a/app/views/admin/application_settings/_floc.html.haml +++ b/app/views/admin/application_settings/_floc.html.haml @@ -19,4 +19,4 @@ .form-check = f.check_box :floc_enabled, class: 'form-check-input' = f.label :floc_enabled, s_('FloC|Enable FloC (Federated Learning of Cohorts)'), class: 'form-check-label' - = f.submit s_('Save changes'), class: 'gl-button btn btn-confirm' + = f.submit _('Save changes'), class: 'gl-button btn btn-confirm' diff --git a/app/views/admin/application_settings/_git_lfs_limits.html.haml b/app/views/admin/application_settings/_git_lfs_limits.html.haml new file mode 100644 index 00000000000..de5a2ceaa3d --- /dev/null +++ b/app/views/admin/application_settings/_git_lfs_limits.html.haml @@ -0,0 +1,21 @@ += form_for @application_setting, url: network_admin_application_settings_path(anchor: 'js-git-lfs-limits-settings'), html: { class: 'fieldset-form' } do |f| + = form_errors(@application_setting) + + %fieldset + %h5 + = _('Authenticated Git LFS request rate limit') + .form-group + .form-check + = f.check_box :throttle_authenticated_git_lfs_enabled, class: 'form-check-input', data: { qa_selector: 'throttle_authenticated_git_lfs_checkbox' } + = f.label :throttle_authenticated_git_lfs_enabled, class: 'form-check-label gl-font-weight-bold' do + = _('Enable authenticated Git LFS request rate limit') + %span.form-text.gl-text-gray-600 + = _('Helps reduce request volume (for example, from crawlers or abusive bots)') + .form-group + = f.label :throttle_authenticated_git_lfs_requests_per_period, _('Max authenticated Git LFS requests per period per user'), class: 'gl-font-weight-bold' + = f.number_field :throttle_authenticated_git_lfs_requests_per_period, class: 'form-control gl-form-input' + .form-group + = f.label :throttle_authenticated_git_lfs_period_in_seconds, _('Authenticated Git LFS rate limit period in seconds'), class: 'gl-font-weight-bold' + = f.number_field :throttle_authenticated_git_lfs_period_in_seconds, class: 'form-control gl-form-input' + + = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_gitpod.html.haml b/app/views/admin/application_settings/_gitpod.html.haml index c08b41e8c55..8f99a07b87c 100644 --- a/app/views/admin/application_settings/_gitpod.html.haml +++ b/app/views/admin/application_settings/_gitpod.html.haml @@ -27,4 +27,4 @@ = s_('Gitpod|The URL to your Gitpod instance configured to read your GitLab projects, such as https://gitpod.example.com.') - link_start = '<a href="%{url}">'.html_safe % { url: help_page_path('integration/gitpod', anchor: 'enable-gitpod-in-your-user-settings') } = s_('Gitpod|To use the integration, each user must also enable Gitpod on their GitLab account. %{link_start}How do I enable it?%{link_end} ').html_safe % { link_start: link_start, link_end: '</a>'.html_safe } - = f.submit s_('Save changes'), class: 'gl-button btn btn-confirm' + = f.submit _('Save changes'), class: 'gl-button btn btn-confirm' diff --git a/app/views/admin/application_settings/_import_export_limits.html.haml b/app/views/admin/application_settings/_import_export_limits.html.haml index 820c11279d5..bc4a1577f90 100644 --- a/app/views/admin/application_settings/_import_export_limits.html.haml +++ b/app/views/admin/application_settings/_import_export_limits.html.haml @@ -2,33 +2,37 @@ = form_errors(@application_setting) %fieldset + = html_escape(_("Set any rate limit to %{code_open}0%{code_close} to disable the limit.")) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } + + + %fieldset .form-group - = f.label :project_import_limit, _('Max Project Import requests per minute per user'), class: 'label-bold' + = f.label :project_import_limit, _('Maximum project import requests per minute'), class: 'label-bold' = f.number_field :project_import_limit, class: 'form-control gl-form-input' %fieldset .form-group - = f.label :project_export_limit, _('Max Project Export requests per minute per user'), class: 'label-bold' + = f.label :project_export_limit, _('Maximum project export requests per minute'), class: 'label-bold' = f.number_field :project_export_limit, class: 'form-control gl-form-input' %fieldset .form-group - = f.label :project_download_export_limit, _('Max Project Export Download requests per minute per user'), class: 'label-bold' + = f.label :project_download_export_limit, _('Maximum project export download requests per minute'), class: 'label-bold' = f.number_field :project_download_export_limit, class: 'form-control gl-form-input' %fieldset .form-group - = f.label :group_import_limit, _('Max Group Import requests per minute per user'), class: 'label-bold' + = f.label :group_import_limit, _('Maximum group import requests per minute'), class: 'label-bold' = f.number_field :group_import_limit, class: 'form-control gl-form-input' %fieldset .form-group - = f.label :group_export_limit, _('Max Group Export requests per minute per user'), class: 'label-bold' + = f.label :group_export_limit, _('Maximum group export requests per minute'), class: 'label-bold' = f.number_field :group_export_limit, class: 'form-control gl-form-input' %fieldset .form-group - = f.label :group_download_export_limit, _('Max Group Export Download requests per minute per user'), class: 'label-bold' + = f.label :group_download_export_limit, _('Maximum group export download requests per minute'), class: 'label-bold' = f.number_field :group_download_export_limit, class: 'form-control gl-form-input' - = f.submit 'Save changes', class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } + = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_initial_branch_name.html.haml b/app/views/admin/application_settings/_initial_branch_name.html.haml index 34c40892467..8832bc02056 100644 --- a/app/views/admin/application_settings/_initial_branch_name.html.haml +++ b/app/views/admin/application_settings/_initial_branch_name.html.haml @@ -1,4 +1,4 @@ -= form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-default-branch-name'), html: { class: 'fieldset-form' } do |f| += form_for @application_setting, url: repository_admin_application_settings_path(anchor: 'js-default-branch-name'), html: { class: 'fieldset-form' } do |f| = form_errors(@application_setting) - fallback_branch_name = "<code>#{Gitlab::DefaultBranch.value}</code>" diff --git a/app/views/admin/application_settings/_ip_limits.html.haml b/app/views/admin/application_settings/_ip_limits.html.haml index e584aaf9880..4362ae9cb9b 100644 --- a/app/views/admin/application_settings/_ip_limits.html.haml +++ b/app/views/admin/application_settings/_ip_limits.html.haml @@ -1,60 +1,69 @@ -= form_for @application_setting, url: network_admin_application_settings_path(anchor: 'js-ip-limits-settings'), html: { class: 'fieldset-form' } do |f| += gitlab_ui_form_for @application_setting, url: network_admin_application_settings_path(anchor: 'js-ip-limits-settings'), html: { class: 'fieldset-form' } do |f| = form_errors(@application_setting) %fieldset - %h5 - = _('Unauthenticated request rate limit') + = _("Rate limits can help reduce request volume (like from crawlers or abusive bots).") + + %fieldset + .form-group + = f.gitlab_ui_checkbox_component :throttle_unauthenticated_api_enabled, + _("Enable unauthenticated API request rate limit"), + checkbox_options: { data: { qa_selector: 'throttle_unauthenticated_api_checkbox' } }, + label_options: { class: 'label-bold' } .form-group - .form-check - = f.check_box :throttle_unauthenticated_enabled, class: 'form-check-input', data: { qa_selector: 'throttle_unauthenticated_checkbox' } - = f.label :throttle_unauthenticated_enabled, class: 'form-check-label label-bold' do - = _("Enable unauthenticated request rate limit") - %span.form-text.text-muted - = _("Helps reduce request volume (e.g. from crawlers or abusive bots)") + = f.label :throttle_unauthenticated_api_requests_per_period, _('Maximum unauthenticated API requests per rate limit period per IP'), class: 'label-bold' + = f.number_field :throttle_unauthenticated_api_requests_per_period, class: 'form-control gl-form-input' .form-group - = f.label :throttle_unauthenticated_requests_per_period, _('Max unauthenticated requests per period per IP'), class: 'label-bold' + = f.label :throttle_unauthenticated_api_period_in_seconds, _('Unauthenticated API rate limit period in seconds'), class: 'label-bold' + = f.number_field :throttle_unauthenticated_api_period_in_seconds, class: 'form-control gl-form-input' + + %fieldset + .form-group + = f.gitlab_ui_checkbox_component :throttle_unauthenticated_enabled, + _("Enable unauthenticated web request rate limit"), + checkbox_options: { data: { qa_selector: 'throttle_unauthenticated_web_checkbox' } }, + label_options: { class: 'label-bold' } + .form-group + = f.label :throttle_unauthenticated_requests_per_period, _('Maximum unauthenticated web requests per rate limit period per IP'), class: 'label-bold' = f.number_field :throttle_unauthenticated_requests_per_period, class: 'form-control gl-form-input' .form-group - = f.label :throttle_unauthenticated_period_in_seconds, _('Unauthenticated rate limit period in seconds'), class: 'label-bold' + = f.label :throttle_unauthenticated_period_in_seconds, _('Unauthenticated web rate limit period in seconds'), class: 'label-bold' = f.number_field :throttle_unauthenticated_period_in_seconds, class: 'form-control gl-form-input' - %hr - %h5 - = _('Authenticated API request rate limit') - .form-group - .form-check - = f.check_box :throttle_authenticated_api_enabled, class: 'form-check-input', data: { qa_selector: 'throttle_authenticated_api_checkbox' } - = f.label :throttle_authenticated_api_enabled, class: 'form-check-label label-bold' do - = _("Enable authenticated API request rate limit") - %span.form-text.text-muted - = _("Helps reduce request volume (e.g. from crawlers or abusive bots)") - .form-group - = f.label :throttle_authenticated_api_requests_per_period, _('Max authenticated API requests per period per user'), class: 'label-bold' + + %fieldset + .form-group + = f.gitlab_ui_checkbox_component :throttle_authenticated_api_enabled, + _("Enable authenticated API request rate limit"), + checkbox_options: { data: { qa_selector: 'throttle_authenticated_api_checkbox' }}, + label_options: { class: 'label-bold' } + .form-group + = f.label :throttle_authenticated_api_requests_per_period, _('Maximum authenticated API requests per rate limit period per user'), class: 'label-bold' = f.number_field :throttle_authenticated_api_requests_per_period, class: 'form-control gl-form-input' .form-group = f.label :throttle_authenticated_api_period_in_seconds, _('Authenticated API rate limit period in seconds'), class: 'label-bold' = f.number_field :throttle_authenticated_api_period_in_seconds, class: 'form-control gl-form-input' - %hr - %h5 - = _('Authenticated web request rate limit') - .form-group - .form-check - = f.check_box :throttle_authenticated_web_enabled, class: 'form-check-input', data: { qa_selector: 'throttle_authenticated_web_checkbox' } - = f.label :throttle_authenticated_web_enabled, class: 'form-check-label label-bold' do - Enable authenticated web request rate limit - %span.form-text.text-muted - Helps reduce request volume (e.g. from crawlers or abusive bots) - .form-group - = f.label :throttle_authenticated_web_requests_per_period, _('Max authenticated web requests per period per user'), class: 'label-bold' + + %fieldset + .form-group + = f.gitlab_ui_checkbox_component :throttle_authenticated_web_enabled, + _("Enable authenticated web request rate limit"), + checkbox_options: { data: { qa_selector: 'throttle_authenticated_web_checkbox' } }, + label_options: { class: 'label-bold' } + .form-group + = f.label :throttle_authenticated_web_requests_per_period, _('Maximum authenticated web requests per rate limit period per user'), class: 'label-bold' = f.number_field :throttle_authenticated_web_requests_per_period, class: 'form-control gl-form-input' .form-group = f.label :throttle_authenticated_web_period_in_seconds, _('Authenticated web rate limit period in seconds'), class: 'label-bold' = f.number_field :throttle_authenticated_web_period_in_seconds, class: 'form-control gl-form-input' - %hr - %h5 + + %fieldset + %legend.h5.gl-border-none = _('Response text') .form-group = f.label :rate_limiting_response_text, class: 'label-bold' do - = _('A plain-text response to show to clients that hit the rate limit.') + = _('Plain-text response to send to clients that hit a rate limit') = f.text_area :rate_limiting_response_text, placeholder: ::Gitlab::Throttle::DEFAULT_RATE_LIMITING_RESPONSE_TEXT, class: 'form-control gl-form-input', rows: 5 + .form-text.text-muted + = html_escape(_("If blank, defaults to %{code_open}Retry later%{code_close}.")) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_issue_limits.html.haml b/app/views/admin/application_settings/_issue_limits.html.haml index 0e1ba8c9c88..663e1485749 100644 --- a/app/views/admin/application_settings/_issue_limits.html.haml +++ b/app/views/admin/application_settings/_issue_limits.html.haml @@ -6,4 +6,4 @@ = f.label :issues_create_limit, 'Max requests per minute per user', class: 'label-bold' = f.number_field :issues_create_limit, class: 'form-control gl-form-input' - = f.submit 'Save changes', class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } + = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_mailgun.html.haml b/app/views/admin/application_settings/_mailgun.html.haml index 6204f7df5dc..40b4d5cac6d 100644 --- a/app/views/admin/application_settings/_mailgun.html.haml +++ b/app/views/admin/application_settings/_mailgun.html.haml @@ -1,5 +1,3 @@ -- return unless Feature.enabled?(:mailgun_events_receiver) - - expanded = integration_expanded?('mailgun_') %section.settings.as-mailgun.no-animate#js-mailgun-settings{ class: ('expanded' if expanded) } .settings-header diff --git a/app/views/admin/application_settings/_note_limits.html.haml b/app/views/admin/application_settings/_note_limits.html.haml index d50b3395d8f..eb6122f244a 100644 --- a/app/views/admin/application_settings/_note_limits.html.haml +++ b/app/views/admin/application_settings/_note_limits.html.haml @@ -3,10 +3,13 @@ %fieldset .form-group - = f.label :notes_create_limit, _('Max requests per minute per user'), class: 'label-bold' + = f.label :notes_create_limit, _('Maximum requests per minute'), class: 'label-bold' = f.number_field :notes_create_limit, class: 'form-control gl-form-input' .form-group - = f.label :notes_create_limit_allowlist, _('List of users to be excluded from the limit'), class: 'label-bold' + = f.label :notes_create_limit_allowlist, _('Users to exclude from the rate limit'), class: 'label-bold' = f.text_area :notes_create_limit_allowlist_raw, placeholder: 'username1, username2', class: 'form-control gl-form-input', rows: 5 + .form-text.text-muted + = _('Comma-separated list of users allowed to exceed the rate limit.') + = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_outbound.html.haml b/app/views/admin/application_settings/_outbound.html.haml index d8d105293a1..142a3fbfbd0 100644 --- a/app/views/admin/application_settings/_outbound.html.haml +++ b/app/views/admin/application_settings/_outbound.html.haml @@ -27,4 +27,4 @@ %span.form-text.text-muted = _('Resolves IP addresses once and uses them to submit requests') - = f.submit 'Save changes', class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } + = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_package_registry_limits.html.haml b/app/views/admin/application_settings/_package_registry_limits.html.haml index b1dfd04c55e..8769171c9e0 100644 --- a/app/views/admin/application_settings/_package_registry_limits.html.haml +++ b/app/views/admin/application_settings/_package_registry_limits.html.haml @@ -2,36 +2,31 @@ = form_errors(@application_setting) %fieldset - %h5 - = _('Unauthenticated API request rate limit') + = _("The package registry rate limits can help reduce request volume (like from crawlers or abusive bots).") + + %fieldset .form-group .form-check = f.check_box :throttle_unauthenticated_packages_api_enabled, class: 'form-check-input', data: { qa_selector: 'throttle_unauthenticated_packages_api_checkbox' } = f.label :throttle_unauthenticated_packages_api_enabled, class: 'form-check-label label-bold' do = _('Enable unauthenticated API request rate limit') - %span.form-text.text-muted - = _('Helps reduce request volume (e.g. from crawlers or abusive bots)') .form-group - = f.label :throttle_unauthenticated_packages_api_requests_per_period, 'Max unauthenticated API requests per period per IP', class: 'label-bold' + = f.label :throttle_unauthenticated_packages_api_requests_per_period, _('Maximum unauthenticated API requests per rate limit period per IP'), class: 'label-bold' = f.number_field :throttle_unauthenticated_packages_api_requests_per_period, class: 'form-control gl-form-input' .form-group - = f.label :throttle_unauthenticated_packages_api_period_in_seconds, 'Unauthenticated API rate limit period in seconds', class: 'label-bold' + = f.label :throttle_unauthenticated_packages_api_period_in_seconds, _('Unauthenticated API rate limit period in seconds'), class: 'label-bold' = f.number_field :throttle_unauthenticated_packages_api_period_in_seconds, class: 'form-control gl-form-input' %hr - %h5 - = _('Authenticated API request rate limit') .form-group .form-check = f.check_box :throttle_authenticated_packages_api_enabled, class: 'form-check-input', data: { qa_selector: 'throttle_authenticated_packages_api_checkbox' } = f.label :throttle_authenticated_packages_api_enabled, class: 'form-check-label label-bold' do = _('Enable authenticated API request rate limit') - %span.form-text.text-muted - = _('Helps reduce request volume (e.g. from crawlers or abusive bots)') .form-group - = f.label :throttle_authenticated_packages_api_requests_per_period, 'Max authenticated API requests per period per user', class: 'label-bold' + = f.label :throttle_authenticated_packages_api_requests_per_period, _('Maximum authenticated API requests per rate limit period per user'), class: 'label-bold' = f.number_field :throttle_authenticated_packages_api_requests_per_period, class: 'form-control gl-form-input' .form-group - = f.label :throttle_authenticated_packages_api_period_in_seconds, 'Authenticated API rate limit period in seconds', class: 'label-bold' + = f.label :throttle_authenticated_packages_api_period_in_seconds, _('Authenticated API rate limit period in seconds'), class: 'label-bold' = f.number_field :throttle_authenticated_packages_api_period_in_seconds, class: 'form-control gl-form-input' - = f.submit 'Save changes', class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } + = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_protected_paths.html.haml b/app/views/admin/application_settings/_protected_paths.html.haml index faa675f211d..04b42f42014 100644 --- a/app/views/admin/application_settings/_protected_paths.html.haml +++ b/app/views/admin/application_settings/_protected_paths.html.haml @@ -28,4 +28,4 @@ = _('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' + = f.submit _('Save changes'), class: 'gl-button btn btn-confirm' diff --git a/app/views/admin/application_settings/_sidekiq_job_limits.html.haml b/app/views/admin/application_settings/_sidekiq_job_limits.html.haml new file mode 100644 index 00000000000..eaf4bbf4702 --- /dev/null +++ b/app/views/admin/application_settings/_sidekiq_job_limits.html.haml @@ -0,0 +1,21 @@ += form_for @application_setting, url: preferences_admin_application_settings_path(anchor: 'js-sidekiq-job-limits-settings'), html: { class: 'fieldset-form' } do |f| + = form_errors(@application_setting) + + %fieldset + .form-group + = f.label :sidekiq_job_limiter_mode, _('Limiting mode'), class: 'label-bold' + = f.select :sidekiq_job_limiter_mode, sidekiq_job_limiter_modes_for_select, {}, class: 'form-control' + .form-text.text-muted + = sidekiq_job_limiter_mode_help_text + .form-group + = f.label :sidekiq_job_limiter_compression_threshold_bytes, _('Sidekiq job compression threshold (bytes)'), class: 'label-bold' + = f.number_field :sidekiq_job_limiter_compression_threshold_bytes, class: 'form-control gl-form-input' + .form-text.text-muted + = _('Threshold in bytes at which to compress Sidekiq job arguments.') + .form-group + = f.label :sidekiq_job_limiter_limit_bytes, _('Sidekiq job size limit (bytes)'), class: 'label-bold' + = f.number_field :sidekiq_job_limiter_limit_bytes, class: 'form-control gl-form-input' + .form-text.text-muted + = _("Threshold in bytes at which to reject Sidekiq jobs. Set this to 0 to if you don't want to limit Sidekiq jobs.") + + = f.submit _('Save changes'), class: "gl-button btn btn-confirm" diff --git a/app/views/admin/application_settings/network.html.haml b/app/views/admin/application_settings/network.html.haml index 0e9dcb23dcb..8dff2bc36cb 100644 --- a/app/views/admin/application_settings/network.html.haml +++ b/app/views/admin/application_settings/network.html.haml @@ -16,24 +16,49 @@ %section.settings.as-ip-limits.no-animate#js-ip-limits-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'ip_limits_content' } } .settings-header %h4 - = _('User and IP Rate Limits') + = _('User and IP rate limits') %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded_by_default? ? _('Collapse') : _('Expand') %p - = _('Configure limits for web and API requests.') + = _('Set limits for web and API requests.') + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/user_and_ip_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'ip_limits' %section.settings.as-packages-limits.no-animate#js-packages-limits-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'packages_limits_content' } } .settings-header %h4 - = _('Package Registry Rate Limits') + = _('Package registry rate limits') %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded_by_default? ? _('Collapse') : _('Expand') %p - = _('Configure specific limits for Packages API requests that supersede the general user and IP rate limits.') + = _('Set rate limits for package registry API requests that supersede the general user and IP rate limits.') + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/package_registry_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'package_registry_limits' +- if Feature.enabled?(:files_api_throttling, default_enabled: :yaml) + %section.settings.as-files-limits.no-animate#js-files-limits-settings{ class: ('expanded' if expanded_by_default?), data: { testid: 'files-limits-settings' } } + .settings-header + %h4 + = _('Files API Rate Limits') + %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Configure specific limits for Files API requests that supersede the general user and IP rate limits.') + .settings-content + = render 'files_limits' + +%section.settings.as-git-lfs-limits.no-animate#js-git-lfs-limits-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'git_lfs_limits_content' } } + .settings-header + %h4 + = _('Git LFS Rate Limits') + %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Configure specific limits for Git LFS requests that supersede the general user and IP rate limits.') + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/git_lfs_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' + .settings-content + = render 'git_lfs_limits' %section.settings.as-outbound.no-animate#js-outbound-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'outbound_requests_content' } } .settings-header @@ -76,22 +101,24 @@ %section.settings.as-note-limits.no-animate#js-note-limits-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 - = _('Notes Rate Limits') + = _('Notes rate limit') %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded_by_default? ? _('Collapse') : _('Expand') %p - = _('Configure limit for notes created per minute by web and API requests.') + = _('Set the per-user rate limit for notes created by web or API requests.') + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/rate_limit_on_notes_creation.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'note_limits' %section.settings.as-import-export-limits.no-animate#js-import-export-limits-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 - = _('Import/Export Rate Limits') + = _('Import and export rate limits') %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded_by_default? ? _('Collapse') : _('Expand') %p - = _('Configure limits for Project/Group Import/Export.') + = _('Set per-user rate limits for imports and exports of projects and groups.') + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/import_export_rate_limits.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'import_export_limits' diff --git a/app/views/admin/application_settings/preferences.html.haml b/app/views/admin/application_settings/preferences.html.haml index 9711c335802..af4bfd28a01 100644 --- a/app/views/admin/application_settings/preferences.html.haml +++ b/app/views/admin/application_settings/preferences.html.haml @@ -82,3 +82,17 @@ = _('Configure the default first day of the week and time tracking units.') .settings-content = render 'localization' + +%section.settings.as-sidekiq-job-limits.no-animate#js-sidekiq-job-limits-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Sidekiq job size limits') + %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Limit the size of Sidekiq jobs stored in Redis.') + %span + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/sidekiq_job_limits.md'), target: '_blank', rel: 'noopener noreferrer' + + .settings-content + = render 'sidekiq_job_limits' |