Commit 26342bf0 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'master' into fl-eslint-vue-house-keeping

* master:
  Restoring user v3 endpoint
  Resolve "Use one column form layout on Admin Area Settings page"
  Resolve "Participants tooltip is cutoff when too close to the window edge"
  Fix group member filter layout
  Align nav bar items
  Fix labels too large
  Added with_statsoption for GET /projects/:id/repository/commits
  Fixed IDE jobs empty state showing when loading
  Fixes Microsoft Teams notifications for pipeline events
  Migrate compare_source_branch to use only Gitaly
  Clean up stale Prometheus metrics in before_exec unicorn hook
  Remove top padding from .col-form-label
parents b97e7cd3 4666ef68
...@@ -122,6 +122,7 @@ export default { ...@@ -122,6 +122,7 @@ export default {
@scroll="scrollBuildLog" @scroll="scrollBuildLog"
> >
<code <code
v-show="!detailJob.isLoading"
class="bash" class="bash"
v-html="jobOutput" v-html="jobOutput"
> >
......
...@@ -85,6 +85,8 @@ export default { ...@@ -85,6 +85,8 @@ export default {
<template> <template>
<img <img
v-tooltip v-tooltip
class="avatar"
data-boundary="window"
:class="{ :class="{
lazy: lazy, lazy: lazy,
[avatarSizeClass]: true, [avatarSizeClass]: true,
......
...@@ -94,6 +94,7 @@ hr { ...@@ -94,6 +94,7 @@ hr {
} }
.form-group.row .col-form-label { .form-group.row .col-form-label {
padding-top: 0;
// Bootstrap 4 aligns labels to the left // Bootstrap 4 aligns labels to the left
// for horizontal forms // for horizontal forms
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
......
...@@ -268,6 +268,8 @@ ...@@ -268,6 +268,8 @@
.navbar-sub-nav, .navbar-sub-nav,
.navbar-nav { .navbar-nav {
align-items: center;
> li { > li {
> a:hover, > a:hover,
> a:focus { > a:focus {
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
} }
.color-label { .color-label {
padding: $gl-padding-4 $grid-size; padding: 0 $grid-size;
line-height: 16px; line-height: 16px;
border-radius: $label-border-radius; border-radius: $label-border-radius;
color: $white-light; color: $white-light;
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
} }
} }
} }
.color-label {
padding: $gl-padding-4 $grid-size;
}
} }
.prioritized-labels { .prioritized-labels {
......
...@@ -121,10 +121,6 @@ ...@@ -121,10 +121,6 @@
background: transparent; background: transparent;
border: 0; border: 0;
outline: 0; outline: 0;
@include media-breakpoint-up(sm) {
right: 160px;
}
} }
.flex-project-members-panel { .flex-project-members-panel {
......
...@@ -26,13 +26,18 @@ module ChatMessage ...@@ -26,13 +26,18 @@ module ChatMessage
end end
end end
def pretext def summary
return message if markdown return message if markdown
format(message) format(message)
end end
def pretext
summary
end
def fallback def fallback
format(message)
end end
def attachments def attachments
......
...@@ -23,10 +23,6 @@ module ChatMessage ...@@ -23,10 +23,6 @@ module ChatMessage
'' ''
end end
def fallback
format(message)
end
def attachments def attachments
return message if markdown return message if markdown
......
...@@ -44,7 +44,7 @@ class MicrosoftTeamsService < ChatNotificationService ...@@ -44,7 +44,7 @@ class MicrosoftTeamsService < ChatNotificationService
def notify(message, opts) def notify(message, opts)
MicrosoftTeams::Notifier.new(webhook).ping( MicrosoftTeams::Notifier.new(webhook).ping(
title: message.project_name, title: message.project_name,
pretext: message.pretext, summary: message.summary,
activity: message.activity, activity: message.activity,
attachments: message.attachments attachments: message.attachments
) )
......
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
= f.label :admin_notification_email, 'Abuse reports notification email', class: 'col-form-label col-sm-2' = f.label :admin_notification_email, 'Abuse reports notification email', class: 'label-light'
.col-sm-10 = f.text_field :admin_notification_email, class: 'form-control'
= f.text_field :admin_notification_email, class: 'form-control' .form-text.text-muted
.form-text.text-muted Abuse reports will be sent to this address if it is set. Abuse reports are always available in the admin area.
Abuse reports will be sent to this address if it is set. Abuse reports are always available in the admin area.
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,38 +2,32 @@ ...@@ -2,38 +2,32 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :gravatar_enabled, class: 'form-check-input'
= f.check_box :gravatar_enabled, class: 'form-check-input' = f.label :gravatar_enabled, class: 'form-check-label' do
= f.label :gravatar_enabled, class: 'form-check-label' do Gravatar enabled
Gravatar enabled .form-group
.form-group.row = f.label :default_projects_limit, class: 'label-light'
= f.label :default_projects_limit, class: 'col-form-label col-sm-2' = f.number_field :default_projects_limit, class: 'form-control'
.col-sm-10 .form-group
= f.number_field :default_projects_limit, class: 'form-control' = f.label :max_attachment_size, 'Maximum attachment size (MB)', class: 'label-light'
.form-group.row = f.number_field :max_attachment_size, class: 'form-control'
= f.label :max_attachment_size, 'Maximum attachment size (MB)', class: 'col-form-label col-sm-2' .form-group
.col-sm-10 = f.label :session_expire_delay, 'Session duration (minutes)', class: 'label-light'
= f.number_field :max_attachment_size, class: 'form-control' = f.number_field :session_expire_delay, class: 'form-control'
.form-group.row %span.form-text.text-muted#session_expire_delay_help_block GitLab restart is required to apply changes
= f.label :session_expire_delay, 'Session duration (minutes)', class: 'col-form-label col-sm-2' .form-group
.col-sm-10 = f.label :user_oauth_applications, 'User OAuth applications', class: 'label-light'
= f.number_field :session_expire_delay, class: 'form-control' .form-check
%span.form-text.text-muted#session_expire_delay_help_block GitLab restart is required to apply changes = f.check_box :user_oauth_applications, class: 'form-check-input'
.form-group.row = f.label :user_oauth_applications, class: 'form-check-label' do
= f.label :user_oauth_applications, 'User OAuth applications', class: 'col-form-label col-sm-2' Allow users to register any application to use GitLab as an OAuth provider
.col-sm-10 .form-group
.form-check = f.label :user_default_external, 'New users set to external', class: 'label-light'
= f.check_box :user_oauth_applications, class: 'form-check-input' .form-check
= f.label :user_oauth_applications, class: 'form-check-label' do = f.check_box :user_default_external, class: 'form-check-input'
Allow users to register any application to use GitLab as an OAuth provider = f.label :user_default_external, class: 'form-check-label' do
.form-group.row Newly registered users will by default be external
= f.label :user_default_external, 'New users set to external', class: 'col-form-label col-sm-2'
.col-sm-10
.form-check
= f.check_box :user_default_external, class: 'form-check-input'
= f.label :user_default_external, class: 'form-check-label' do
Newly registered users will by default be external
= f.submit 'Save changes', class: 'btn btn-success' = f.submit 'Save changes', class: 'btn btn-success'
...@@ -6,25 +6,22 @@ ...@@ -6,25 +6,22 @@
These settings require a These settings require a
= link_to 'restart', help_page_path('administration/restart_gitlab') = link_to 'restart', help_page_path('administration/restart_gitlab')
to take effect. to take effect.
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :sidekiq_throttling_enabled, class: 'form-check-input'
= f.check_box :sidekiq_throttling_enabled, class: 'form-check-input' = f.label :sidekiq_throttling_enabled, class: 'form-check-label' do
= f.label :sidekiq_throttling_enabled, class: 'form-check-label' do Enable Sidekiq Job Throttling
Enable Sidekiq Job Throttling
.form-text.text-muted
Limit the amount of resources slow running jobs are assigned.
.form-group.row
= f.label :sidekiq_throttling_queues, 'Sidekiq queues to throttle', class: 'col-form-label col-sm-2'
.col-sm-10
= f.select :sidekiq_throttling_queues, sidekiq_queue_options_for_select, { include_hidden: false }, multiple: true, class: 'select2 select-wide', data: { field: 'sidekiq_throttling_queues' }
.form-text.text-muted .form-text.text-muted
Choose which queues you wish to throttle. Limit the amount of resources slow running jobs are assigned.
.form-group.row .form-group
= f.label :sidekiq_throttling_factor, 'Throttling Factor', class: 'col-form-label col-sm-2' = f.label :sidekiq_throttling_queues, 'Sidekiq queues to throttle', class: 'label-light'
.col-sm-10 = f.select :sidekiq_throttling_queues, sidekiq_queue_options_for_select, { include_hidden: false }, multiple: true, class: 'select2 select-wide', data: { field: 'sidekiq_throttling_queues' }
= f.number_field :sidekiq_throttling_factor, class: 'form-control', min: '0.01', max: '0.99', step: '0.01' .form-text.text-muted
.form-text.text-muted Choose which queues you wish to throttle.
The factor by which the queues should be throttled. A value between 0.0 and 1.0, exclusive. .form-group
= f.label :sidekiq_throttling_factor, 'Throttling Factor', class: 'label-light'
= f.number_field :sidekiq_throttling_factor, class: 'form-control', min: '0.01', max: '0.99', step: '0.01'
.form-text.text-muted
The factor by which the queues should be throttled. A value between 0.0 and 1.0, exclusive.
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,46 +2,40 @@ ...@@ -2,46 +2,40 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :auto_devops_enabled, class: 'form-check-input'
= f.check_box :auto_devops_enabled, class: 'form-check-input' = f.label :auto_devops_enabled, class: 'form-check-label' do
= f.label :auto_devops_enabled, class: 'form-check-label' do Enabled Auto DevOps for projects by default
Enabled Auto DevOps for projects by default .form-text.text-muted
.form-text.text-muted It will automatically build, test, and deploy applications based on a predefined CI/CD configuration
It will automatically build, test, and deploy applications based on a predefined CI/CD configuration = link_to icon('question-circle'), help_page_path('topics/autodevops/index.md')
= link_to icon('question-circle'), help_page_path('topics/autodevops/index.md') .form-group
.form-group.row = f.label :auto_devops_domain, class: 'label-light'
= f.label :auto_devops_domain, class: 'col-form-label col-sm-2' = f.text_field :auto_devops_domain, class: 'form-control', placeholder: 'domain.com'
.col-sm-10 .form-text.text-muted
= f.text_field :auto_devops_domain, class: 'form-control', placeholder: 'domain.com' = s_("AdminSettings|Specify a domain to use by default for every project's Auto Review Apps and Auto Deploy stages.")
.form-text.text-muted .form-group
= s_("AdminSettings|Specify a domain to use by default for every project's Auto Review Apps and Auto Deploy stages.") .form-check
.form-group.row = f.check_box :shared_runners_enabled, class: 'form-check-input'
.offset-sm-2.col-sm-10 = f.label :shared_runners_enabled, class: 'form-check-label' do
.form-check Enable shared runners for new projects
= f.check_box :shared_runners_enabled, class: 'form-check-input' .form-group
= f.label :shared_runners_enabled, class: 'form-check-label' do = f.label :shared_runners_text, class: 'label-light'
Enable shared runners for new projects = f.text_area :shared_runners_text, class: 'form-control', rows: 4
.form-group.row .form-text.text-muted Markdown enabled
= f.label :shared_runners_text, class: 'col-form-label col-sm-2' .form-group
.col-sm-10 = f.label :max_artifacts_size, 'Maximum artifacts size (MB)', class: 'label-light'
= f.text_area :shared_runners_text, class: 'form-control', rows: 4 = f.number_field :max_artifacts_size, class: 'form-control'
.form-text.text-muted Markdown enabled .form-text.text-muted
.form-group.row Set the maximum file size for each job's artifacts
= f.label :max_artifacts_size, 'Maximum artifacts size (MB)', class: 'col-form-label col-sm-2' = link_to icon('question-circle'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'maximum-artifacts-size')
.col-sm-10 .form-group
= f.number_field :max_artifacts_size, class: 'form-control' = f.label :default_artifacts_expire_in, 'Default artifacts expiration', class: 'label-light'
.form-text.text-muted = f.text_field :default_artifacts_expire_in, class: 'form-control'
Set the maximum file size for each job's artifacts .form-text.text-muted
= link_to icon('question-circle'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'maximum-artifacts-size') Set the default expiration time for each job's artifacts.
.form-group.row 0 for unlimited.
= f.label :default_artifacts_expire_in, 'Default artifacts expiration', class: 'col-form-label col-sm-2' = link_to icon('question-circle'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'default-artifacts-expiration')
.col-sm-10
= f.text_field :default_artifacts_expire_in, class: 'form-control'
.form-text.text-muted
Set the default expiration time for each job's artifacts.
0 for unlimited.
= link_to icon('question-circle'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'default-artifacts-expiration')
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,25 +2,23 @@ ...@@ -2,25 +2,23 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :email_author_in_body, class: 'form-check-input'
= f.check_box :email_author_in_body, class: 'form-check-input' = f.label :email_author_in_body, class: 'form-check-label' do
= f.label :email_author_in_body, class: 'form-check-label' do Include author name in notification email body
Include author name in notification email body .form-text.text-muted
.form-text.text-muted Some email servers do not support overriding the email sender name.
Some email servers do not support overriding the email sender name. Enable this option to include the name of the author of the issue,
Enable this option to include the name of the author of the issue, merge request or comment in the email body instead.
merge request or comment in the email body instead. .form-group
.form-group.row .form-check
.offset-sm-2.col-sm-10 = f.check_box :html_emails_enabled, class: 'form-check-input'
.form-check = f.label :html_emails_enabled, class: 'form-check-label' do
= f.check_box :html_emails_enabled, class: 'form-check-input' Enable HTML emails
= f.label :html_emails_enabled, class: 'form-check-label' do .form-text.text-muted
Enable HTML emails By default GitLab sends emails in HTML and plain text formats so mail
.form-text.text-muted clients can choose what format to use. Disable this option if you only
By default GitLab sends emails in HTML and plain text formats so mail want to send emails in plain text format.
clients can choose what format to use. Disable this option if you only
want to send emails in plain text format.
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,26 +2,23 @@ ...@@ -2,26 +2,23 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
= f.label :gitaly_timeout_default, 'Default Timeout Period', class: 'col-form-label col-sm-2' = f.label :gitaly_timeout_default, 'Default Timeout Period', class: 'label-light'
.col-sm-10 = f.number_field :gitaly_timeout_default, class: 'form-control'
= f.number_field :gitaly_timeout_default, class: 'form-control' .form-text.text-muted
.form-text.text-muted Timeout for Gitaly calls from the GitLab application (in seconds). This timeout is not enforced
Timeout for Gitaly calls from the GitLab application (in seconds). This timeout is not enforced for git fetch/push operations or Sidekiq jobs.
for git fetch/push operations or Sidekiq jobs. .form-group
.form-group.row = f.label :gitaly_timeout_fast, 'Fast Timeout Period', class: 'label-light'
= f.label :gitaly_timeout_fast, 'Fast Timeout Period', class: 'col-form-label col-sm-2' = f.number_field :gitaly_timeout_fast, class: 'form-control'
.col-sm-10 .form-text.text-muted
= f.number_field :gitaly_timeout_fast, class: 'form-control' Fast operation timeout (in seconds). Some Gitaly operations are expected to be fast.
.form-text.text-muted If they exceed this threshold, there may be a problem with a storage shard and 'failing fast'
Fast operation timeout (in seconds). Some Gitaly operations are expected to be fast. can help maintain the stability of the GitLab instance.
If they exceed this threshold, there may be a problem with a storage shard and 'failing fast' .form-group
can help maintain the stability of the GitLab instance. = f.label :gitaly_timeout_medium, 'Medium Timeout Period', class: 'label-light'
.form-group.row = f.number_field :gitaly_timeout_medium, class: 'form-control'
= f.label :gitaly_timeout_medium, 'Medium Timeout Period', class: 'col-form-label col-sm-2' .form-text.text-muted
.col-sm-10 Medium operation timeout (in seconds). This should be a value between the Fast and the Default timeout.
= f.number_field :gitaly_timeout_medium, class: 'form-control'
.form-text.text-muted
Medium operation timeout (in seconds). This should be a value between the Fast and the Default timeout.
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,21 +2,18 @@ ...@@ -2,21 +2,18 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
= f.label :help_page_text, class: 'col-form-label col-sm-2' = f.label :help_page_text, class: 'label-light'
.col-sm-10 = f.text_area :help_page_text, class: 'form-control', rows: 4
= f.text_area :help_page_text, class: 'form-control', rows: 4 .form-text.text-muted Markdown enabled
.form-text.text-muted Markdown enabled .form-group
.form-group.row .form-check
.offset-sm-2.col-sm-10 = f.check_box :help_page_hide_commercial_content, class: 'form-check-input'
.form-check = f.label :help_page_hide_commercial_content, class: 'form-check-label' do
= f.check_box :help_page_hide_commercial_content, class: 'form-check-input' Hide marketing-related entries from help
= f.label :help_page_hide_commercial_content, class: 'form-check-label' do .form-group
Hide marketing-related entries from help = f.label :help_page_support_url, 'Support page URL', class: 'label-light'
.form-group.row = f.text_field :help_page_support_url, class: 'form-control', placeholder: 'http://company.example.com/getting-help', :'aria-describedby' => 'support_help_block'
= f.label :help_page_support_url, 'Support page URL', class: 'col-form-label col-sm-2' %span.form-text.text-muted#support_help_block Alternate support URL for help page
.col-sm-10
= f.text_field :help_page_support_url, class: 'form-control', placeholder: 'http://company.example.com/getting-help', :'aria-describedby' => 'support_help_block'
%span.form-text.text-muted#support_help_block Alternate support URL for help page
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -8,61 +8,53 @@ ...@@ -8,61 +8,53 @@
= link_to 'restart', help_page_path('administration/restart_gitlab') = link_to 'restart', help_page_path('administration/restart_gitlab')
to take effect. to take effect.
= link_to icon('question-circle'), help_page_path('administration/monitoring/performance/introduction') = link_to icon('question-circle'), help_page_path('administration/monitoring/performance/introduction')
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :metrics_enabled, class: 'form-check-input'
= f.check_box :metrics_enabled, class: 'form-check-input' = f.label :metrics_enabled, class: 'form-check-label' do
= f.label :metrics_enabled, class: 'form-check-label' do Enable InfluxDB Metrics
Enable InfluxDB Metrics .form-group
.form-group.row = f.label :metrics_host, 'InfluxDB host', class: 'label-light'
= f.label :metrics_host, 'InfluxDB host', class: 'col-form-label col-sm-2' = f.text_field :metrics_host, class: 'form-control', placeholder: 'influxdb.example.com'
.col-sm-10 .form-group
= f.text_field :metrics_host, class: 'form-control', placeholder: 'influxdb.example.com' = f.label :metrics_port, 'InfluxDB port', class: 'label-light'
.form-group.row = f.text_field :metrics_port, class: 'form-control', placeholder: '8089'
= f.label :metrics_port, 'InfluxDB port', class: 'col-form-label col-sm-2' .form-text.text-muted
.col-sm-10 The UDP port to use for connecting to InfluxDB. InfluxDB requires that
= f.text_field :metrics_port, class: 'form-control', placeholder: '8089' your server configuration specifies a database to store data in when
.form-text.text-muted sending messages to this port, without it metrics data will not be
The UDP port to use for connecting to InfluxDB. InfluxDB requires that saved.
your server configuration specifies a database to store data in when .form-group
sending messages to this port, without it metrics data will not be = f.label :metrics_pool_size, 'Connection pool size', class: 'label-light'
saved. = f.number_field :metrics_pool_size, class: 'form-control'
.form-group.row .form-text.text-muted
= f.label :metrics_pool_size, 'Connection pool size', class: 'col-form-label col-sm-2' The amount of InfluxDB connections to open. Connections are opened
.col-sm-10 lazily. Users using multi-threaded application servers should ensure
= f.number_field :metrics_pool_size, class: 'form-control' enough connections are available (at minimum the amount of application
.form-text.text-muted server threads).
The amount of InfluxDB connections to open. Connections are opened .form-group
lazily. Users using multi-threaded application servers should ensure = f.label :metrics_timeout, 'Connection timeout', class: 'label-light'
enough connections are available (at minimum the amount of application = f.number_field :metrics_timeout, class: 'form-control'
server threads). .form-text.text-muted
.form-group.row The amount of seconds after which an InfluxDB connection will time
= f.label :metrics_timeout, 'Connection timeout', class: 'col-form-label col-sm-2' out.
.col-sm-10 .form-group
= f.number_field :metrics_timeout, class: 'form-control' = f.label :metrics_method_call_threshold, 'Method Call Threshold (ms)', class: 'label-light'
.form-text.text-muted = f.number_field :metrics_method_call_threshold, class: 'form-control'
The amount of seconds after which an InfluxDB connection will time .form-text.text-muted
out. A method call is only tracked when it takes longer to complete than
.form-group.row the given amount of milliseconds.
= f.label :metrics_method_call_threshold, 'Method Call Threshold (ms)', class: 'col-form-label col-sm-2' .form-group
.col-sm-10 = f.label :metrics_sample_interval, 'Sampler Interval (sec)', class: 'label-light'
= f.number_field :metrics_method_call_threshold, class: 'form-control' = f.number_field :metrics_sample_interval, class: 'form-control'
.form-text.text-muted .form-text.text-muted
A method call is only tracked when it takes longer to complete than The sampling interval in seconds. Sampled data includes memory usage,
the given amount of milliseconds. retained Ruby objects, file descriptors and so on.
.form-group.row .form-group
= f.label :metrics_sample_interval, 'Sampler Interval (sec)', class: 'col-form-label col-sm-2' = f.label :metrics_packet_size, 'Metrics per packet', class: 'label-light'
.col-sm-10 = f.number_field :metrics_packet_size, class: 'form-control'
= f.number_field :metrics_sample_interval, class: 'form-control' .form-text.text-muted
.form-text.text-muted The amount of points to store in a single UDP packet. More points
The sampling interval in seconds. Sampled data includes memory usage, results in fewer but larger UDP packets being sent.
retained Ruby objects, file descriptors and so on.
.form-group.row
= f.label :metrics_packet_size, 'Metrics per packet', class: 'col-form-label col-sm-2'
.col-sm-10
= f.number_field :metrics_packet_size, class: 'form-control'
.form-text.text-muted
The amount of points to store in a single UDP packet. More points
results in fewer but larger UDP packets being sent.
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,53 +2,44 @@ ...@@ -2,53 +2,44 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :throttle_unauthenticated_enabled, class: 'form-check-input'
= f.check_box :throttle_unauthenticated_enabled, class: 'form-check-input' = f.label :throttle_unauthenticated_enabled, class: 'form-check-label' do
= f.label :throttle_unauthenticated_enabled, class: 'form-check-label' do Enable unauthenticated request rate limit
Enable unauthenticated request rate limit %span.form-text.text-muted
%span.form-text.text-muted Helps reduce request volume (e.g. from crawlers or abusive bots)
Helps reduce request volume (e.g. from crawlers or abusive bots) .form-group
.form-group.row = f.label :throttle_unauthenticated_requests_per_period, 'Max requests per period per IP', class: 'label-light'
= f.label :throttle_unauthenticated_requests_per_period, 'Max requests per period per IP', class: 'col-form-label col-sm-2' = f.number_field :throttle_unauthenticated_requests_per_period, class: 'form-control'
.col-sm-10 .form-group
= f.number_field :throttle_unauthenticated_requests_per_period, class: 'form-control' = f.label :throttle_unauthenticated_period_in_seconds, 'Rate limit period in seconds', class: 'label-light'
.form-group.row = f.number_field :throttle_unauthenticated_period_in_seconds, class: 'form-control'
= f.label :throttle_unauthenticated_period_in_seconds, 'Rate limit period in seconds', class: 'col-form-label col-sm-2' .form-group
.col-sm-10 .form-check
= f.number_field :throttle_unauthenticated_period_in_seconds, class: 'form-control' = f.check_box :throttle_authenticated_api_enabled, class: 'form-check-input'
.form-group.row = f.label :throttle_authenticated_api_enabled, class: 'form-check-label' do
.offset-sm-2.col-sm-10 Enable authenticated API request rate limit
.form-check %span.form-text.text-muted
= f.check_box :throttle_authenticated_api_enabled, class: 'form-check-input' Helps reduce request volume (e.g. from crawlers or abusive bots)
= f.label :throttle_authenticated_api_enabled, class: 'form-check-label' do .form-group
Enable authenticated API request rate limit = f.label :throttle_authenticated_api_requests_per_period, 'Max requests per period per user', class: 'label-light'
%span.form-text.text-muted = f.number_field :throttle_authenticated_api_requests_per_period, class: 'form-control'
Helps reduce request volume (e.g. from crawlers or abusive bots) .form-group
.form-group.row = f.label :throttle_authenticated_api_period_in_seconds, 'Rate limit period in seconds', class: 'label-light'
= f.label :throttle_authenticated_api_requests_per_period, 'Max requests per period per user', class: 'col-form-label col-sm-2' = f.number_field :throttle_authenticated_api_period_in_seconds, class: 'form-control'
.col-sm-10 .form-group
= f.number_field :throttle_authenticated_api_requests_per_period, class: 'form-control' .form-check
.form-group.row = f.check_box :throttle_authenticated_web_enabled, class: 'form-check-input'
= f.label :throttle_authenticated_api_period_in_seconds, 'Rate limit period in seconds', class: 'col-form-label col-sm-2' = f.label :throttle_authenticated_web_enabled, class: 'form-check-label' do
.col-sm-10 Enable authenticated web request rate limit
= f.number_field :throttle_authenticated_api_period_in_seconds, class: 'form-control' %span.form-text.text-muted
.form-group.row Helps reduce request volume (e.g. from crawlers or abusive bots)
.offset-sm-2.col-sm-10 .form-group
.form-check = f.label :throttle_authenticated_web_requests_per_period, 'Max requests per period per user', class: 'label-light'
= f.check_box :throttle_authenticated_web_enabled, class: 'form-check-input' = f.number_field :throttle_authenticated_web_requests_per_period, class: 'form-control'
= f.label :throttle_authenticated_web_enabled, class: 'form-check-label' do .form-group
Enable authenticated web request rate limit = f.label :throttle_authenticated_web_period_in_seconds, 'Rate limit period in seconds', class: 'label-light'
%span.form-text.text-muted = f.number_field :throttle_authenticated_web_period_in_seconds, class: 'form-control'
Helps reduce request volume (e.g. from crawlers or abusive bots)
.form-group.row
= f.label :throttle_authenticated_web_requests_per_period, 'Max requests per period per user', class: 'col-form-label col-sm-2'
.col-sm-10
= f.number_field :throttle_authenticated_web_requests_per_period, class: 'form-control'
.form-group.row
= f.label :throttle_authenticated_web_period_in_seconds, 'Rate limit period in seconds', class: 'col-form-label col-sm-2'
.col-sm-10
= f.number_field :throttle_authenticated_web_period_in_seconds, class: 'form-control'
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,23 +2,21 @@ ...@@ -2,23 +2,21 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :koding_enabled, class: 'form-check-input'
= f.check_box :koding_enabled, class: 'form-check-input' = f.label :koding_enabled, class: 'form-check-label' do
= f.label :koding_enabled, class: 'form-check-label' do Enable Koding
Enable Koding .form-text.text-muted
.form-text.text-muted Koding integration has been deprecated since GitLab 10.0. If you disable your Koding integration, you will not be able to enable it again.
Koding integration has been deprecated since GitLab 10.0. If you disable your Koding integration, you will not be able to enable it again. .form-group
.form-group.row = f.label :koding_url, 'Koding URL', class: 'label-light'
= f.label :koding_url, 'Koding URL', class: 'col-form-label col-sm-2' = f.text_field :koding_url, class: 'form-control', placeholder: 'http://gitlab.your-koding-instance.com:8090'
.col-sm-10 .form-text.text-muted
= f.text_field :koding_url, class: 'form-control', placeholder: 'http://gitlab.your-koding-instance.com:8090' Koding has integration enabled out of the box for the
.form-text.text-muted %strong gitlab
Koding has integration enabled out of the box for the team, and you need to provide that team's URL here. Learn more in the
%strong gitlab = succeed "." do
team, and you need to provide that team's URL here. Learn more in the = link_to "Koding administration documentation", help_page_path("administration/integration/koding")
= succeed "." do
= link_to "Koding administration documentation", help_page_path("administration/integration/koding")
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,35 +2,31 @@ ...@@ -2,35 +2,31 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :sentry_enabled, class: 'form-check-input'
= f.check_box :sentry_enabled, class: 'form-check-input' = f.label :sentry_enabled, class: 'form-check-label' do
= f.label :sentry_enabled, class: 'form-check-label' do Enable Sentry
Enable Sentry .form-text.text-muted
.form-text.text-muted %p This setting requires a restart to take effect.
%p This setting requires a restart to take effect. Sentry is an error reporting and logging tool which is currently not shipped with GitLab, get it here:
Sentry is an error reporting and logging tool which is currently not shipped with GitLab, get it here: %a{ href: 'https://getsentry.com', target: '_blank', rel: 'noopener noreferrer' } https://getsentry.com
%a{ href: 'https://getsentry.com', target: '_blank', rel: 'noopener noreferrer' } https://getsentry.com
.form-group.row .form-group
= f.label :sentry_dsn, 'Sentry DSN', class: 'col-form-label col-sm-2' = f.label :sentry_dsn, 'Sentry DSN', class: 'label-light'
.col-sm-10 = f.text_field :sentry_dsn, class: 'form-control'
= f.text_field :sentry_dsn, class: 'form-control'
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :clientside_sentry_enabled, class: 'form-check-input'
= f.check_box :clientside_sentry_enabled, class: 'form-check-input' = f.label :clientside_sentry_enabled, class: 'form-check-label' do
= f.label :clientside_sentry_enabled, class: 'form-check-label' do Enable Clientside Sentry
Enable Clientside Sentry .form-text.text-muted
.form-text.text-muted Sentry can also be used for reporting and logging clientside exceptions.
Sentry can also be used for reporting and logging clientside exceptions. %a{ href: 'https://sentry.io/for/javascript/', target: '_blank', rel: 'noopener noreferrer' } https://sentry.io/for/javascript/
%a{ href: 'https://sentry.io/for/javascript/', target: '_blank', rel: 'noopener noreferrer' } https://sentry.io/for/javascript/
.form-group.row .form-group
= f.label :clientside_sentry_dsn, 'Clientside Sentry DSN', class: 'col-form-label col-sm-2' = f.label :clientside_sentry_dsn, 'Clientside Sentry DSN', class: 'label-light'
.col-sm-10 = f.text_field :clientside_sentry_dsn, class: 'form-control'
= f.text_field :clientside_sentry_dsn, class: 'form-control'
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :allow_local_requests_from_hooks_and_services, class: 'form-check-input'
= f.check_box :allow_local_requests_from_hooks_and_services, class: 'form-check-input' = f.label :allow_local_requests_from_hooks_and_services, class: 'form-check-label' do
= f.label :allow_local_requests_from_hooks_and_services, class: 'form-check-label' do Allow requests to the local network from hooks and services
Allow requests to the local network from hooks and services
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,21 +2,19 @@ ...@@ -2,21 +2,19 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
= f.label :max_pages_size, 'Maximum size of pages (MB)', class: 'col-form-label col-sm-2' = f.label :max_pages_size, 'Maximum size of pages (MB)', class: 'label-light'
.col-sm-10 = f.number_field :max_pages_size, class: 'form-control'
= f.number_field :max_pages_size, class: 'form-control' .form-text.text-muted 0 for unlimited
.form-text.text-muted 0 for unlimited .form-group
.form-group.row .form-check
.offset-sm-2.col-sm-10 = f.check_box :pages_domain_verification_enabled, class: 'form-check-input'
.form-check = f.label :pages_domain_verification_enabled, class: 'form-check-label' do
= f.check_box :pages_domain_verification_enabled, class: 'form-check-input' Require users to prove ownership of custom domains
= f.label :pages_domain_verification_enabled, class: 'form-check-label' do .form-text.text-muted
Require users to prove ownership of custom domains Domain verification is an essential security measure for public GitLab
.form-text.text-muted sites. Users are required to demonstrate they control a domain before
Domain verification is an essential security measure for public GitLab it is enabled
sites. Users are required to demonstrate they control a domain before = link_to icon('question-circle'), help_page_path('user/project/pages/getting_started_part_three.md', anchor: 'dns-txt-record')
it is enabled
= link_to icon('question-circle'), help_page_path('user/project/pages/getting_started_part_three.md', anchor: 'dns-txt-record')
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,18 +2,17 @@ ...@@ -2,18 +2,17 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :authorized_keys_enabled, class: 'form-check-input'
= f.check_box :authorized_keys_enabled, class: 'form-check-input' = f.label :authorized_keys_enabled, class: 'form-check-label' do
= f.label :authorized_keys_enabled, class: 'form-check-label' do Write to "authorized_keys" file
Write to "authorized_keys" file .form-text.text-muted
.form-text.text-muted By default, we write to the "authorized_keys" file to support Git
By default, we write to the "authorized_keys" file to support Git over SSH without additional configuration. GitLab can be optimized
over SSH without additional configuration. GitLab can be optimized to authenticate SSH keys via the database file. Only uncheck this
to authenticate SSH keys via the database file. Only uncheck this if you have configured your OpenSSH server to use the
if you have configured your OpenSSH server to use the AuthorizedKeysCommand. Click on the help icon for more details.
AuthorizedKeysCommand. Click on the help icon for more details. = link_to icon('question-circle'), help_page_path('administration/operations/fast_ssh_key_lookup')
= link_to icon('question-circle'), help_page_path('administration/operations/fast_ssh_key_lookup')
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,15 +2,13 @@ ...@@ -2,15 +2,13 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :performance_bar_enabled, class: 'form-check-input'
= f.check_box :performance_bar_enabled, class: 'form-check-input' = f.label :performance_bar_enabled, class: 'form-check-label' do
= f.label :performance_bar_enabled, class: 'form-check-label' do Enable the Performance Bar
Enable the Performance Bar .form-group
.form-group.row = f.label :performance_bar_allowed_group_path, 'Allowed group', class: 'label-light'
= f.label :performance_bar_allowed_group_path, 'Allowed group', class: 'col-form-label col-sm-2' = f.text_field :performance_bar_allowed_group_path, class: 'form-control', placeholder: 'my-org/my-group', value: @application_setting.performance_bar_allowed_group&.full_path
.col-sm-10
= f.text_field :performance_bar_allowed_group_path, class: 'form-control', placeholder: 'my-org/my-group', value: @application_setting.performance_bar_allowed_group&.full_path
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,19 +2,17 @@ ...@@ -2,19 +2,17 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :plantuml_enabled, class: 'form-check-input'
= f.check_box :plantuml_enabled, class: 'form-check-input' = f.label :plantuml_enabled, class: 'form-check-label' do
= f.label :plantuml_enabled, class: 'form-check-label' do Enable PlantUML
Enable PlantUML .form-group
.form-group.row = f.label :plantuml_url, 'PlantUML URL', class: 'label-light'
= f.label :plantuml_url, 'PlantUML URL', class: 'col-form-label col-sm-2' = f.text_field :plantuml_url, class: 'form-control', placeholder: 'http://gitlab.your-plantuml-instance.com:8080'
.col-sm-10 .form-text.text-muted
= f.text_field :plantuml_url, class: 'form-control', placeholder: 'http://gitlab.your-plantuml-instance.com:8080' Allow rendering of
.form-text.text-muted = link_to "PlantUML", "http://plantuml.com"
Allow rendering of diagrams in Asciidoc documents using an external PlantUML service.
= link_to "PlantUML", "http://plantuml.com"
diagrams in Asciidoc documents using an external PlantUML service.
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -11,18 +11,17 @@ ...@@ -11,18 +11,17 @@
= link_to 'restart', help_page_path('administration/restart_gitlab') = link_to 'restart', help_page_path('administration/restart_gitlab')
to take effect. to take effect.
= link_to icon('question-circle'), help_page_path('administration/monitoring/prometheus/index') = link_to icon('question-circle'), help_page_path('administration/monitoring/prometheus/index')
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :prometheus_metrics_enabled, class: 'form-check-input'
= f.check_box :prometheus_metrics_enabled, class: 'form-check-input' = f.label :prometheus_metrics_enabled, class: 'form-check-label' do
= f.label :prometheus_metrics_enabled, class: 'form-check-label' do Enable Prometheus Metrics
Enable Prometheus Metrics - unless Gitlab::Metrics.metrics_folder_present?
- unless Gitlab::Metrics.metrics_folder_present? .form-text.text-muted
.form-text.text-muted %strong.cred WARNING:
%strong.cred WARNING: Environment variable
Environment variable %code prometheus_multiproc_dir
%code prometheus_multiproc_dir does not exist or is not pointing to a valid directory.
does not exist or is not pointing to a valid directory. = link_to icon('question-circle'), help_page_path('administration/monitoring/prometheus/gitlab_metrics', anchor: 'metrics-shared-directory')
= link_to icon('question-circle'), help_page_path('administration/monitoring/prometheus/gitlab_metrics', anchor: 'metrics-shared-directory')
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,18 +2,17 @@ ...@@ -2,18 +2,17 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
= f.label :polling_interval_multiplier, 'Polling interval multiplier', class: 'col-form-label col-sm-2' = f.label :polling_interval_multiplier, 'Polling interval multiplier', class: 'label-light'
.col-sm-10 = f.text_field :polling_interval_multiplier, class: 'form-control'
= f.text_field :polling_interval_multiplier, class: 'form-control' .form-text.text-muted
.form-text.text-muted Change this value to influence how frequently the GitLab UI polls for updates.
Change this value to influence how frequently the GitLab UI polls for updates. If you set the value to 2 all polling intervals are multiplied
If you set the value to 2 all polling intervals are multiplied by 2, which means that polling happens half as frequently.
by 2, which means that polling happens half as frequently. The multiplier can also have a decimal value.
The multiplier can also have a decimal value. The default value (1) is a reasonable choice for the majority of GitLab
The default value (1) is a reasonable choice for the majority of GitLab installations. Set to 0 to completely disable polling.
installations. Set to 0 to completely disable polling. = link_to icon('question-circle'), help_page_path('administration/polling')
= link_to icon('question-circle'), help_page_path('administration/polling')
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
= f.label :container_registry_token_expire_delay, 'Authorization token duration (minutes)', class: 'col-form-label col-sm-2' = f.label :container_registry_token_expire_delay, 'Authorization token duration (minutes)', class: 'label-light'
.col-sm-10 = f.number_field :container_registry_token_expire_delay, class: 'form-control'
= f.number_field :container_registry_token_expire_delay, class: 'form-control'
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -4,59 +4,53 @@ ...@@ -4,59 +4,53 @@
%fieldset %fieldset
.sub-section .sub-section
%h4 Repository checks %h4 Repository checks
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :repository_checks_enabled, class: 'form-check-input'
= f.check_box :repository_checks_enabled, class: 'form-check-input' = f.label :repository_checks_enabled, class: 'form-check-label' do
= f.label :repository_checks_enabled, class: 'form-check-label' do Enable Repository Checks
Enable Repository Checks
.form-text.text-muted
GitLab will periodically run
%a{ href: 'https://git-scm.com/docs/git-fsck', target: 'blank' } 'git fsck'
in all project and wiki repositories to look for silent disk corruption issues.
.form-group.row
.offset-sm-2.col-sm-10
= link_to 'Clear all repository checks', clear_repository_check_states_admin_application_settings_path, data: { confirm: 'This will clear repository check states for ALL projects in the database. This cannot be undone. Are you sure?' }, method: :put, class: "btn btn-sm btn-remove"
.form-text.text-muted .form-text.text-muted
If you got a lot of false alarms from repository checks you can choose to clear all repository check information from the database. GitLab will periodically run
%a{ href: 'https://git-scm.com/docs/git-fsck', target: 'blank' } 'git fsck'
in all project and wiki repositories to look for silent disk corruption issues.
.form-group
= link_to 'Clear all repository checks', clear_repository_check_states_admin_application_settings_path, data: { confirm: 'This will clear repository check states for ALL projects in the database. This cannot be undone. Are you sure?' }, method: :put, class: "btn btn-sm btn-remove"
.form-text.text-muted
If you got a lot of false alarms from repository checks you can choose to clear all repository check information from the database.
.sub-section .sub-section
%h4 Housekeeping %h4 Housekeeping
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :housekeeping_enabled, class: 'form-check-input'
= f.check_box :housekeeping_enabled, class: 'form-check-input' = f.label :housekeeping_enabled, class: 'form-check-label' do
= f.label :housekeeping_enabled, class: 'form-check-label' do Enable automatic repository housekeeping (git repack, git gc)
Enable automatic repository housekeeping (git repack, git gc)
.form-text.text-muted
If you keep automatic housekeeping disabled for a long time Git
repository access on your GitLab server will become slower and your
repositories will use more disk space. We recommend to always leave
this enabled.
.form-check
= f.check_box :housekeeping_bitmaps_enabled, class: 'form-check-input'
= f.label :housekeeping_bitmaps_enabled, class: 'form-check-label' do
Enable Git pack file bitmap creation
.form-text.text-muted
Creating pack file bitmaps makes housekeeping take a little longer but
bitmaps should accelerate 'git clone' performance.
.form-group.row
= f.label :housekeeping_incremental_repack_period, 'Incremental repack period', class: 'col-form-label col-sm-2'
.col-sm-10
= f.number_field :housekeeping_incremental_repack_period, class: 'form-control'
.form-text.text-muted .form-text.text-muted
Number of Git pushes after which an incremental 'git repack' is run. If you keep automatic housekeeping disabled for a long time Git
.form-group.row repository access on your GitLab server will become slower and your
= f.label :housekeeping_full_repack_period, 'Full repack period', class: 'col-form-label col-sm-2' repositories will use more disk space. We recommend to always leave
.col-sm-10 this enabled.
= f.number_field :housekeeping_full_repack_period, class: 'form-control' .form-check
= f.check_box :housekeeping_bitmaps_enabled, class: 'form-check-input'
= f.label :housekeeping_bitmaps_enabled, class: 'form-check-label' do
Enable Git pack file bitmap creation
.form-text.text-muted .form-text.text-muted
Number of Git pushes after which a full 'git repack' is run. Creating pack file bitmaps makes housekeeping take a little longer but
.form-group.row bitmaps should accelerate 'git clone' performance.
= f.label :housekeeping_gc_period, 'Git GC period', class: 'col-form-label col-sm-2' .form-group
.col-sm-10 = f.label :housekeeping_incremental_repack_period, 'Incremental repack period', class: 'label-light'
= f.number_field :housekeeping_gc_period, class: 'form-control' = f.number_field :housekeeping_incremental_repack_period, class: 'form-control'
.form-text.text-muted .form-text.text-muted
Number of Git pushes after which 'git gc' is run. Number of Git pushes after which an incremental 'git repack' is run.
.form-group
= f.label :housekeeping_full_repack_period, 'Full repack period', class: 'label-light'
= f.number_field :housekeeping_full_repack_period, class: 'form-control'
.form-text.text-muted
Number of Git pushes after which a full 'git repack' is run.
.form-group
= f.label :housekeeping_gc_period, 'Git GC period', class: 'label-light'
= f.number_field :housekeeping_gc_period, class: 'form-control'
.form-text.text-muted
Number of Git pushes after which 'git gc' is run.
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,15 +2,14 @@ ...@@ -2,15 +2,14 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
= f.label :mirror_available, 'Enable mirror configuration', class: 'control-label col-sm-4' = f.label :mirror_available, 'Enable mirror configuration', class: 'label-light'
.col-sm-8 .form-check
.form-check = f.check_box :mirror_available, class: 'form-check-input'
= f.check_box :mirror_available, class: 'form-check-input' = f.label :mirror_available, class: 'form-check-label' do
= f.label :mirror_available, class: 'form-check-label' do Allow mirrors to be setup for projects
Allow mirrors to be setup for projects %span.form-text.text-muted
%span.form-text.text-muted If disabled, only admins will be able to setup mirrors in projects.
If disabled, only admins will be able to setup mirrors in projects. = link_to icon('question-circle'), help_page_path('workflow/repository_mirroring')
= link_to icon('question-circle'), help_page_path('workflow/repository_mirroring')
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -3,56 +3,49 @@ ...@@ -3,56 +3,49 @@
%fieldset %fieldset
.sub-section .sub-section
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :hashed_storage_enabled, class: 'form-check-input'
= f.check_box :hashed_storage_enabled, class: 'form-check-input' = f.label :hashed_storage_enabled, class: 'form-check-label' do
= f.label :hashed_storage_enabled, class: 'form-check-label' do Create new projects using hashed storage paths
Create new projects using hashed storage paths
.form-text.text-muted
Enable immutable, hash-based paths and repository names to store repositories on disk. This prevents
repositories from having to be moved or renamed when the Project URL changes and may improve disk I/O performance.
%em (EXPERIMENTAL)
.form-group.row
= f.label :repository_storages, 'Storage paths for new projects', class: 'col-form-label col-sm-2'
.col-sm-10
= f.select :repository_storages, repository_storages_options_for_select(@application_setting.repository_storages),
{include_hidden: false}, multiple: true, class: 'form-control'
.form-text.text-muted .form-text.text-muted
Manage repository storage paths. Learn more in the Enable immutable, hash-based paths and repository names to store repositories on disk. This prevents
= succeed "." do repositories from having to be moved or renamed when the Project URL changes and may improve disk I/O performance.
= link_to "repository storages documentation", help_page_path("administration/repository_storage_paths") %em (EXPERIMENTAL)
.form-group
= f.label :repository_storages, 'Storage paths for new projects', class: 'label-light'
= f.select :repository_storages, repository_storages_options_for_select(@application_setting.repository_storages),
{include_hidden: false}, multiple: true, class: 'form-control'
.form-text.text-muted
Manage repository storage paths. Learn more in the
= succeed "." do
= link_to "repository storages documentation", help_page_path("administration/repository_storage_paths")
.sub-section .sub-section
%h4 Circuit breaker %h4 Circuit breaker
.form-group.row .form-group
= f.label :circuitbreaker_check_interval, _('Check interval'), class: 'col-form-label col-sm-2' = f.label :circuitbreaker_check_interval, _('Check interval'), class: 'label-light'
.col-sm-10 = f.number_field :circuitbreaker_check_interval, class: 'form-control'
= f.number_field :circuitbreaker_check_interval, class: 'form-control' .form-text.text-muted
.form-text.text-muted = circuitbreaker_check_interval_help_text
= circuitbreaker_check_interval_help_text .form-group
.form-group.row = f.label :circuitbreaker_access_retries, _('Number of access attempts'), class: 'label-light'
= f.label :circuitbreaker_access_retries, _('Number of access attempts'), class: 'col-form-label col-sm-2' = f.number_field :circuitbreaker_access_retries, class: 'form-control'
.col-sm-10 .form-text.text-muted
= f.number_field :circuitbreaker_access_retries, class: 'form-control' = circuitbreaker_access_retries_help_text
.form-text.text-muted .form-group
= circuitbreaker_access_retries_help_text = f.label :circuitbreaker_storage_timeout, _('Seconds to wait for a storage access attempt'), class: 'label-light'
.form-group.row = f.number_field :circuitbreaker_storage_timeout, class: 'form-control'
= f.label :circuitbreaker_storage_timeout, _('Seconds to wait for a storage access attempt'), class: 'col-form-label col-sm-2' .form-text.text-muted
.col-sm-10 = circuitbreaker_storage_timeout_help_text
= f.number_field :circuitbreaker_storage_timeout, class: 'form-control' .form-group
.form-text.text-muted = f.label :circuitbreaker_failure_count_threshold, _('Maximum git storage failures'), class: 'label-light'
= circuitbreaker_storage_timeout_help_text = f.number_field :circuitbreaker_failure_count_threshold, class: 'form-control'
.form-group.row .form-text.text-muted
= f.label :circuitbreaker_failure_count_threshold, _('Maximum git storage failures'), class: 'col-form-label col-sm-2' = circuitbreaker_failure_count_help_text
.col-sm-10 .form-group
= f.number_field :circuitbreaker_failure_count_threshold, class: 'form-control' = f.label :circuitbreaker_failure_reset_time, _('Seconds before reseting failure information'), class: 'label-light'
.form-text.text-muted = f.number_field :circuitbreaker_failure_reset_time, class: 'form-control'
= circuitbreaker_failure_count_help_text .form-text.text-muted
.form-group.row = circuitbreaker_failure_reset_time_help_text
= f.label :circuitbreaker_failure_reset_time, _('Seconds before reseting failure information'), class: 'col-form-label col-sm-2'
.col-sm-10
= f.number_field :circuitbreaker_failure_reset_time, class: 'form-control'
.form-text.text-muted
= circuitbreaker_failure_reset_time_help_text
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,59 +2,51 @@ ...@@ -2,59 +2,51 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :password_authentication_enabled_for_web, class: 'form-check-input'
= f.check_box :password_authentication_enabled_for_web, class: 'form-check-input' = f.label :password_authentication_enabled_for_web, class: 'form-check-label' do
= f.label :password_authentication_enabled_for_web, class: 'form-check-label' do Password authentication enabled for web interface
Password authentication enabled for web interface .form-text.text-muted
.form-text.text-muted When disabled, an external authentication provider must be used.
When disabled, an external authentication provider must be used. .form-group
.form-group.row .form-check
.offset-sm-2.col-sm-10 = f.check_box :password_authentication_enabled_for_git, class: 'form-check-input'
.form-check = f.label :password_authentication_enabled_for_git, class: 'form-check-label' do
= f.check_box :password_authentication_enabled_for_git, class: 'form-check-input' Password authentication enabled for Git over HTTP(S)
= f.label :password_authentication_enabled_for_git, class: 'form-check-label' do .form-text.text-muted
Password authentication enabled for Git over HTTP(S) When disabled, a Personal Access Token
.form-text.text-muted - if Gitlab::Auth::LDAP::Config.enabled?
When disabled, a Personal Access Token or LDAP password
- if Gitlab::Auth::LDAP::Config.enabled? must be used to authenticate.
or LDAP password
must be used to authenticate.
- if omniauth_enabled? && button_based_providers.any? - if omniauth_enabled? && button_based_providers.any?
.form-group.row .form-group
= f.label :enabled_oauth_sign_in_sources, 'Enabled OAuth sign-in sources', class: 'col-form-label col-sm-2' = f.label :enabled_oauth_sign_in_sources, 'Enabled OAuth sign-in sources', class: 'label-light'
= hidden_field_tag 'application_setting[enabled_oauth_sign_in_sources][]' = hidden_field_tag 'application_setting[enabled_oauth_sign_in_sources][]'
.col-sm-10 .btn-group{ data: { toggle: 'buttons' } }
.btn-group{ data: { toggle: 'buttons' } } - oauth_providers_checkboxes.each do |source|
- oauth_providers_checkboxes.each do |source| = source
= source .form-group
.form-group.row = f.label :two_factor_authentication, 'Two-factor authentication', class: 'label-light'
= f.label :two_factor_authentication, 'Two-factor authentication', class: 'col-form-label col-sm-2' .form-check
.col-sm-10 = f.check_box :require_two_factor_authentication, class: 'form-check-input'
.form-check = f.label :require_two_factor_authentication, class: 'form-check-label' do
= f.check_box :require_two_factor_authentication, class: 'form-check-input' Require all users to setup Two-factor authentication
= f.label :require_two_factor_authentication, class: 'form-check-label' do .form-group
Require all users to setup Two-factor authentication = f.label :two_factor_authentication, 'Two-factor grace period (hours)', class: 'label-light'
.form-group.row = f.number_field :two_factor_grace_period, min: 0, class: 'form-control', placeholder: '0'
= f.label :two_factor_authentication, 'Two-factor grace period (hours)', class: 'col-form-label col-sm-2' .form-text.text-muted Amount of time (in hours) that users are allowed to skip forced configuration of two-factor authentication
.col-sm-10 .form-group
= f.number_field :two_factor_grace_period, min: 0, class: 'form-control', placeholder: '0' = f.label :home_page_url, 'Home page URL', class: 'label-light'
.form-text.text-muted Amount of time (in hours) that users are allowed to skip forced configuration of two-factor authentication = f.text_field :home_page_url, class: 'form-control', placeholder: 'http://company.example.com', :'aria-describedby' => 'home_help_block'
.form-group.row %span.form-text.text-muted#home_help_block We will redirect non-logged in users to this page
= f.label :home_page_url, 'Home page URL', class: 'col-form-label col-sm-2' .form-group
.col-sm-10 = f.label :after_sign_out_path, class: 'label-light'
= f.text_field :home_page_url, class: 'form-control', placeholder: 'http://company.example.com', :'aria-describedby' => 'home_help_block' = f.text_field :after_sign_out_path, class: 'form-control', placeholder: 'http://company.example.com', :'aria-describedby' => 'after_sign_out_path_help_block'
%span.form-text.text-muted#home_help_block We will redirect non-logged in users to this page %span.form-text.text-muted#after_sign_out_path_help_block We will redirect users to this page after they sign out
.form-group.row .form-group
= f.label :after_sign_out_path, class: 'col-form-label col-sm-2' = f.label :sign_in_text, class: 'label-light'
.col-sm-10 = f.text_area :sign_in_text, class: 'form-control', rows: 4
= f.text_field :after_sign_out_path, class: 'form-control', placeholder: 'http://company.example.com', :'aria-describedby' => 'after_sign_out_path_help_block' .form-text.text-muted Markdown enabled
%span.form-text.text-muted#after_sign_out_path_help_block We will redirect users to this page after they sign out
.form-group.row
= f.label :sign_in_text, class: 'col-form-label col-sm-2'
.col-sm-10
= f.text_area :sign_in_text, class: 'form-control', rows: 4
.form-text.text-muted Markdown enabled
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,57 +2,49 @@ ...@@ -2,57 +2,49 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :signup_enabled, class: 'form-check-input'
= f.check_box :signup_enabled, class: 'form-check-input' = f.label :signup_enabled, class: 'form-check-label' do
= f.label :signup_enabled, class: 'form-check-label' do Sign-up enabled
Sign-up enabled .form-group
.form-group.row .form-check
.offset-sm-2.col-sm-10 = f.check_box :send_user_confirmation_email, class: 'form-check-input'
.form-check = f.label :send_user_confirmation_email, class: 'form-check-label' do
= f.check_box :send_user_confirmation_email, class: 'form-check-input' Send confirmation email on sign-up
= f.label :send_user_confirmation_email, class: 'form-check-label' do .form-group
Send confirmation email on sign-up = f.label :domain_whitelist, 'Whitelisted domains for sign-ups', class: 'label-light'
.form-group.row = f.text_area :domain_whitelist_raw, placeholder: 'domain.com', class: 'form-control', rows: 8
= f.label :domain_whitelist, 'Whitelisted domains for sign-ups', class: 'col-form-label col-sm-2' .form-text.text-muted ONLY users with e-mail addresses that match these domain(s) will be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com
.col-sm-10 .form-group
= f.text_area :domain_whitelist_raw, placeholder: 'domain.com', class: 'form-control', rows: 8 = f.label :domain_blacklist_enabled, 'Domain Blacklist', class: 'label-light'
.form-text.text-muted ONLY users with e-mail addresses that match these domain(s) will be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com .form-check
.form-group.row = f.check_box :domain_blacklist_enabled, class: 'form-check-input'
= f.label :domain_blacklist_enabled, 'Domain Blacklist', class: 'col-form-label col-sm-2' = f.label :domain_blacklist_enabled, class: 'form-check-label' do
.col-sm-10 Enable domain blacklist for sign ups
.form-check .form-group
= f.check_box :domain_blacklist_enabled, class: 'form-check-input' .form-check
= f.label :domain_blacklist_enabled, class: 'form-check-label' do = radio_button_tag :blacklist_type, :file, false, class: 'form-check-input'
Enable domain blacklist for sign ups = label_tag :blacklist_type_file, class: 'form-check-label' do
.form-group.row .option-title
.offset-sm-2.col-sm-10 Upload blacklist file
.form-check .form-check
= radio_button_tag :blacklist_type, :file, class: 'form-check-input' = radio_button_tag :blacklist_type, :raw, @application_setting.domain_blacklist.present? || @application_setting.domain_blacklist.blank?, class: 'form-check-input'
= label_tag :blacklist_type_file, class: 'form-check-label' do = label_tag :blacklist_type_raw, class: 'form-check-label' do
.option-title .option-title
Upload blacklist file Enter blacklist manually
.form-check .form-group.blacklist-file
= radio_button_tag :blacklist_type, :raw, @application_setting.domain_blacklist.present? || @application_setting.domain_blacklist.blank?, class: 'form-check-input' = f.label :domain_blacklist_file, 'Blacklist file', class: 'label-light'
= label_tag :blacklist_type_raw, class: 'form-check-label' do = f.file_field :domain_blacklist_file, class: 'form-control', accept: '.txt,.conf'
.option-title .form-text.text-muted Users with e-mail addresses that match these domain(s) will NOT be able to sign-up. Wildcards allowed. Use separate lines or commas for multiple entries.
Enter blacklist manually .form-group.blacklist-raw
.form-group.row.blacklist-file = f.label :domain_blacklist, 'Blacklisted domains for sign-ups', class: 'label-light'
= f.label :domain_blacklist_file, 'Blacklist file', class: 'col-form-label col-sm-2' = f.text_area :domain_blacklist_raw, placeholder: 'domain.com', class: 'form-control', rows: 8
.col-sm-10 .form-text.text-muted Users with e-mail addresses that match these domain(s) will NOT be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com
= f.file_field :domain_blacklist_file, class: 'form-control', accept: '.txt,.conf'
.form-text.text-muted Users with e-mail addresses that match these domain(s) will NOT be able to sign-up. Wildcards allowed. Use separate lines or commas for multiple entries.
.form-group.row.blacklist-raw
= f.label :domain_blacklist, 'Blacklisted domains for sign-ups', class: 'col-form-label col-sm-2'
.col-sm-10
= f.text_area :domain_blacklist_raw, placeholder: 'domain.com', class: 'form-control', rows: 8
.form-text.text-muted Users with e-mail addresses that match these domain(s) will NOT be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com
.form-group.row .form-group
= f.label :after_sign_up_text, class: 'col-form-label col-sm-2' = f.label :after_sign_up_text, class: 'label-light'
.col-sm-10 = f.text_area :after_sign_up_text, class: 'form-control', rows: 4
= f.text_area :after_sign_up_text, class: 'form-control', rows: 4 .form-text.text-muted Markdown enabled
.form-text.text-muted Markdown enabled
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,64 +2,56 @@ ...@@ -2,64 +2,56 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :recaptcha_enabled, class: 'form-check-input'
= f.check_box :recaptcha_enabled, class: 'form-check-input' = f.label :recaptcha_enabled, class: 'form-check-label' do
= f.label :recaptcha_enabled, class: 'form-check-label' do Enable reCAPTCHA
Enable reCAPTCHA %span.form-text.text-muted#recaptcha_help_block Helps prevent bots from creating accounts
%span.form-text.text-muted#recaptcha_help_block Helps prevent bots from creating accounts
.form-group
.form-group.row = f.label :recaptcha_site_key, 'reCAPTCHA Site Key', class: 'label-light'
= f.label :recaptcha_site_key, 'reCAPTCHA Site Key', class: 'col-form-label col-sm-2' = f.text_field :recaptcha_site_key, class: 'form-control'
.col-sm-10 .form-text.text-muted
= f.text_field :recaptcha_site_key, class: 'form-control' Generate site and private keys at
.form-text.text-muted %a{ href: 'http://www.google.com/recaptcha', target: 'blank' } http://www.google.com/recaptcha
Generate site and private keys at
%a{ href: 'http://www.google.com/recaptcha', target: 'blank' } http://www.google.com/recaptcha .form-group
= f.label :recaptcha_private_key, 'reCAPTCHA Private Key', class: 'label-light'
.form-group.row = f.text_field :recaptcha_private_key, class: 'form-control'
= f.label :recaptcha_private_key, 'reCAPTCHA Private Key', class: 'col-form-label col-sm-2'
.col-sm-10 .form-group
= f.text_field :recaptcha_private_key, class: 'form-control' .form-check
= f.check_box :akismet_enabled, class: 'form-check-input'
.form-group.row = f.label :akismet_enabled, class: 'form-check-label' do
.offset-sm-2.col-sm-10 Enable Akismet
.form-check %span.form-text.text-muted#akismet_help_block Helps prevent bots from creating issues
= f.check_box :akismet_enabled, class: 'form-check-input'
= f.label :akismet_enabled, class: 'form-check-label' do .form-group
Enable Akismet = f.label :akismet_api_key, 'Akismet API Key', class: 'label-light'
%span.form-text.text-muted#akismet_help_block Helps prevent bots from creating issues = f.text_field :akismet_api_key, class: 'form-control'
.form-text.text-muted
.form-group.row Generate API key at
= f.label :akismet_api_key, 'Akismet API Key', class: 'col-form-label col-sm-2' %a{ href: 'http://www.akismet.com', target: 'blank' } http://www.akismet.com
.col-sm-10
= f.text_field :akismet_api_key, class: 'form-control' .form-group
.form-text.text-muted .form-check
Generate API key at = f.check_box :unique_ips_limit_enabled, class: 'form-check-input'
%a{ href: 'http://www.akismet.com', target: 'blank' } http://www.akismet.com = f.label :unique_ips_limit_enabled, class: 'form-check-label' do
Limit sign in from multiple ips
.form-group.row %span.form-text.text-muted#unique_ip_help_block
.offset-sm-2.col-sm-10 Helps prevent malicious users hide their activity
.form-check
= f.check_box :unique_ips_limit_enabled, class: 'form-check-input' .form-group
= f.label :unique_ips_limit_enabled, class: 'form-check-label' do = f.label :unique_ips_limit_per_user, 'IPs per user', class: 'label-light'
Limit sign in from multiple ips = f.number_field :unique_ips_limit_per_user, class: 'form-control'
%span.form-text.text-muted#unique_ip_help_block .form-text.text-muted
Helps prevent malicious users hide their activity Maximum number of unique IPs per user
.form-group.row .form-group
= f.label :unique_ips_limit_per_user, 'IPs per user', class: 'col-form-label col-sm-2' = f.label :unique_ips_limit_time_window, 'IP expiration time', class: 'label-light'
.col-sm-10 = f.number_field :unique_ips_limit_time_window, class: 'form-control'
= f.number_field :unique_ips_limit_per_user, class: 'form-control' .form-text.text-muted
.form-text.text-muted How many seconds an IP will be counted towards the limit
Maximum number of unique IPs per user
.form-group.row
= f.label :unique_ips_limit_time_window, 'IP expiration time', class: 'col-form-label col-sm-2'
.col-sm-10
= f.number_field :unique_ips_limit_time_window, class: 'form-control'
.form-text.text-muted
How many seconds an IP will be counted towards the limit
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
= f.label :terminal_max_session_time, 'Max session time', class: 'col-form-label col-sm-2' = f.label :terminal_max_session_time, 'Max session time', class: 'label-light'
.col-sm-10 = f.number_field :terminal_max_session_time, class: 'form-control'
= f.number_field :terminal_max_session_time, class: 'form-control' .form-text.text-muted
.form-text.text-muted Maximum time for web terminal websocket connection (in seconds).
Maximum time for web terminal websocket connection (in seconds). 0 for unlimited.
0 for unlimited.
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,21 +2,18 @@ ...@@ -2,21 +2,18 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.col-sm-12 .form-check
.form-check = f.check_box :enforce_terms, class: 'form-check-input'
= f.check_box :enforce_terms, class: 'form-check-input' = f.label :enforce_terms, class: 'form-check-label' do
= f.label :enforce_terms, class: 'form-check-label' do = _("Require all users to accept Terms of Service and Privacy Policy when they access GitLab.")
= _("Require all users to accept Terms of Service and Privacy Policy when they access GitLab.")
.form-text.text-muted
= _("When enabled, users cannot use GitLab until the terms have been accepted.")
.form-group.row
.col-sm-12
= f.label :terms do
= _("Terms of Service Agreement and Privacy Policy")
.col-sm-12
= f.text_area :terms, class: 'form-control', rows: 8
.form-text.text-muted .form-text.text-muted
= _("Markdown enabled") = _("When enabled, users cannot use GitLab until the terms have been accepted.")
.form-group
= f.label :terms do
= _("Terms of Service Agreement and Privacy Policy")
= f.text_area :terms, class: 'form-control', rows: 8
.form-text.text-muted
= _("Markdown enabled")
= f.submit _("Save changes"), class: "btn btn-success" = f.submit _("Save changes"), class: "btn btn-success"
...@@ -2,36 +2,34 @@ ...@@ -2,36 +2,34 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
.offset-sm-2.col-sm-10 .form-check
.form-check = f.check_box :version_check_enabled, class: 'form-check-input'
= f.check_box :version_check_enabled, class: 'form-check-input' = f.label :version_check_enabled, class: 'form-check-label' do
= f.label :version_check_enabled, class: 'form-check-label' do Enable version check
Enable version check .form-text.text-muted
.form-text.text-muted GitLab will inform you if a new version is available.
GitLab will inform you if a new version is available. = link_to 'Learn more', help_page_path("user/admin_area/settings/usage_statistics", anchor: "version-check")
= link_to 'Learn more', help_page_path("user/admin_area/settings/usage_statistics", anchor: "version-check") about what information is shared with GitLab Inc.
about what information is shared with GitLab Inc. .form-group
.form-group.row - can_be_configured = @application_setting.usage_ping_can_be_configured?
.offset-sm-2.col-sm-10 .form-check
- can_be_configured = @application_setting.usage_ping_can_be_configured? = f.check_box :usage_ping_enabled, disabled: !can_be_configured, class: 'form-check-input'
.form-check = f.label :usage_ping_enabled, class: 'form-check-label' do
= f.check_box :usage_ping_enabled, disabled: !can_be_configured, class: 'form-check-input' Enable usage ping
= f.label :usage_ping_enabled, class: 'form-check-label' do .form-text.text-muted
Enable usage ping - if can_be_configured
.form-text.text-muted To help improve GitLab and its user experience, GitLab will
- if can_be_configured periodically collect usage information.
To help improve GitLab and its user experience, GitLab will = link_to 'Learn more', help_page_path("user/admin_area/settings/usage_statistics", anchor: "usage-ping")
periodically collect usage information. about what information is shared with GitLab Inc. Visit
= link_to 'Learn more', help_page_path("user/admin_area/settings/usage_statistics", anchor: "usage-ping") = link_to 'Cohorts', admin_cohorts_path(anchor: 'usage-ping')
about what information is shared with GitLab Inc. Visit to see the JSON payload sent.
= link_to 'Cohorts', admin_cohorts_path(anchor: 'usage-ping') - else
to see the JSON payload sent. The usage ping is disabled, and cannot be configured through this
- else form. For more information, see the documentation on
The usage ping is disabled, and cannot be configured through this = succeed '.' do
form. For more information, see the documentation on = link_to 'deactivating the usage ping', help_page_path('user/admin_area/settings/usage_statistics', anchor: 'deactivate-the-usage-ping')
= succeed '.' do
= link_to 'deactivating the usage ping', help_page_path('user/admin_area/settings/usage_statistics', anchor: 'deactivate-the-usage-ping')
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -2,66 +2,57 @@ ...@@ -2,66 +2,57 @@
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
.form-group.row .form-group
= f.label :default_branch_protection, class: 'col-form-label col-sm-2' = f.label :default_branch_protection, class: 'label-light'
.col-sm-10 = f.select :default_branch_protection, options_for_select(Gitlab::Access.protection_options, @application_setting.default_branch_protection), {}, class: 'form-control'
= f.select :default_branch_protection, options_for_select(Gitlab::Access.protection_options, @application_setting.default_branch_protection), {}, class: 'form-control' .form-group.visibility-level-setting
.form-group.row.visibility-level-setting = f.label :default_project_visibility, class: 'label-light'
= f.label :default_project_visibility, class: 'col-form-label col-sm-2' = render('shared/visibility_radios', model_method: :default_project_visibility, form: f, selected_level: @application_setting.default_project_visibility, form_model: Project.new)
.col-sm-10 .form-group.visibility-level-setting
= render('shared/visibility_radios', model_method: :default_project_visibility, form: f, selected_level: @application_setting.default_project_visibility, form_model: Project.new) = f.label :default_snippet_visibility, class: 'label-light'
.form-group.row.visibility-level-setting = render('shared/visibility_radios', model_method: :default_snippet_visibility, form: f, selected_level: @application_setting.default_snippet_visibility, form_model: ProjectSnippet.new)
= f.label :default_snippet_visibility, class: 'col-form-label col-sm-2' .form-group.visibility-level-setting
.col-sm-10 = f.label :default_group_visibility, class: 'label-light'
= render('shared/visibility_radios', model_method: :default_snippet_visibility, form: f, selected_level: @application_setting.default_snippet_visibility, form_model: ProjectSnippet.new) = render('shared/visibility_radios', model_method: :default_group_visibility, form: f, selected_level: @application_setting.default_group_visibility, form_model: Group.new)
.form-group.row.visibility-level-setting .form-group
= f.label :default_group_visibility, class: 'col-form-label col-sm-2' = f.label :restricted_visibility_levels, class: 'label-light'
.col-sm-10 - checkbox_name = 'application_setting[restricted_visibility_levels][]'
= render('shared/visibility_radios', model_method: :default_group_visibility, form: f, selected_level: @application_setting.default_group_visibility, form_model: Group.new) = hidden_field_tag(checkbox_name)
.form-group.row - restricted_level_checkboxes('restricted-visibility-help', checkbox_name, class: 'form-check-input').each do |level|
= f.label :restricted_visibility_levels, class: 'col-form-label col-sm-2'
.col-sm-10
- checkbox_name = 'application_setting[restricted_visibility_levels][]'
= hidden_field_tag(checkbox_name)
- restricted_level_checkboxes('restricted-visibility-help', checkbox_name, class: 'form-check-input').each do |level|
.form-check
= level
%span.form-text.text-muted#restricted-visibility-help
Selected levels cannot be used by non-admin users for groups, projects or snippets.
If the public level is restricted, user profiles are only visible to logged in users.
.form-group.row
= f.label :import_sources, class: 'col-form-label col-sm-2'
.col-sm-10
= hidden_field_tag 'application_setting[import_sources][]'
- import_sources_checkboxes('import-sources-help', class: 'form-check-input').each do |source|
.form-check= source
%span.form-text.text-muted#import-sources-help
Enabled sources for code import during project creation. OmniAuth must be configured for GitHub
= link_to "(?)", help_page_path("integration/github")
, Bitbucket
= link_to "(?)", help_page_path("integration/bitbucket")
and GitLab.com
= link_to "(?)", help_page_path("integration/gitlab")
.form-group.row
.offset-sm-2.col-sm-10
.form-check .form-check
= f.check_box :project_export_enabled, class: 'form-check-input' = level
= f.label :project_export_enabled, class: 'form-check-label' do %span.form-text.text-muted#restricted-visibility-help
Project export enabled Selected levels cannot be used by non-admin users for groups, projects or snippets.
If the public level is restricted, user profiles are only visible to logged in users.
.form-group
= f.label :import_sources, class: 'label-light'
= hidden_field_tag 'application_setting[import_sources][]'
- import_sources_checkboxes('import-sources-help', class: 'form-check-input').each do |source|
.form-check= source
%span.form-text.text-muted#import-sources-help
Enabled sources for code import during project creation. OmniAuth must be configured for GitHub
= link_to "(?)", help_page_path("integration/github")
, Bitbucket
= link_to "(?)", help_page_path("integration/bitbucket")
and GitLab.com
= link_to "(?)", help_page_path("integration/gitlab")
.form-group
.form-check
= f.check_box :project_export_enabled, class: 'form-check-input'
= f.label :project_export_enabled, class: 'form-check-label' do
Project export enabled
.form-group.row .form-group
%label.col-form-label.col-sm-2 Enabled Git access protocols %label.label-light Enabled Git access protocols
.col-sm-10 = select(:application_setting, :enabled_git_access_protocol, [['Both SSH and HTTP(S)', nil], ['Only SSH', 'ssh'], ['Only HTTP(S)', 'http']], {}, class: 'form-control')
= select(:application_setting, :enabled_git_access_protocol, [['Both SSH and HTTP(S)', nil], ['Only SSH', 'ssh'], ['Only HTTP(S)', 'http']], {}, class: 'form-control') %span.form-text.text-muted#clone-protocol-help
%span.form-text.text-muted#clone-protocol-help Allow only the selected protocols to be used for Git access.
Allow only the selected protocols to be used for Git access.
- ApplicationSetting::SUPPORTED_KEY_TYPES.each do |type| - ApplicationSetting::SUPPORTED_KEY_TYPES.each do |type|
- field_name = :"#{type}_key_restriction" - field_name = :"#{type}_key_restriction"
.form-group.row .form-group
= f.label field_name, "#{type.upcase} SSH keys", class: 'col-form-label col-sm-2' = f.label field_name, "#{type.upcase} SSH keys", class: 'label-light'
.col-sm-10 = f.select field_name, key_restriction_options_for_select(type), {}, class: 'form-control'
= f.select field_name, key_restriction_options_for_select(type), {}, class: 'form-control'
= f.submit 'Save changes', class: "btn btn-success" = f.submit 'Save changes', class: "btn btn-success"
...@@ -25,9 +25,10 @@ ...@@ -25,9 +25,10 @@
%span.badge= @members.total_count %span.badge= @members.total_count
= form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form flex-project-members-form' do = form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form flex-project-members-form' do
.form-group .form-group
= search_field_tag :search, params[:search], { placeholder: 'Find existing members by name', class: 'form-control', spellcheck: false } .position-relative.append-right-8
%button.member-search-btn{ type: "submit", "aria-label" => "Submit search" } = search_field_tag :search, params[:search], { placeholder: 'Find existing members by name', class: 'form-control', spellcheck: false }
= icon("search") %button.member-search-btn{ type: "submit", "aria-label" => "Submit search" }
= icon("search")
- if can_manage_members - if can_manage_members
= render 'shared/members/filter_2fa_dropdown' = render 'shared/members/filter_2fa_dropdown'
= render 'shared/members/sort_dropdown' = render 'shared/members/sort_dropdown'
......
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
%span.badge.badge-pill= members.total_count %span.badge.badge-pill= members.total_count
= form_tag project_project_members_path(project), method: :get, class: 'form-inline member-search-form flex-project-members-form' do = form_tag project_project_members_path(project), method: :get, class: 'form-inline member-search-form flex-project-members-form' do
.form-group .form-group
= search_field_tag :search, params[:search], { placeholder: 'Find existing members by name', class: 'form-control', spellcheck: false } .position-relative
%button.member-search-btn{ type: "submit", "aria-label" => "Submit search" } = search_field_tag :search, params[:search], { placeholder: 'Find existing members by name', class: 'form-control', spellcheck: false }
= icon("search") %button.member-search-btn{ type: "submit", "aria-label" => "Submit search" }
= icon("search")
= render 'shared/members/sort_dropdown' = render 'shared/members/sort_dropdown'
%ul.content-list.members-list %ul.content-list.members-list
= render partial: 'shared/members/member', collection: members, as: :member = render partial: 'shared/members/member', collection: members, as: :member
---
title: Fixes Microsoft Teams notifications for pipeline events
merge_request: 19632
author: Jeff Brown
type: fixed
---
title: Use one column form layout on Admin Area Settings page
merge_request:
author:
type: changed
---
title: Added with_statsoption for GET /projects/:id/repository/commits
merge_request:
author:
type: added
---
title: Restore API v3 user endpoint
merge_request:
author:
type: changed
...@@ -81,6 +81,17 @@ GC.respond_to?(:copy_on_write_friendly=) and ...@@ -81,6 +81,17 @@ GC.respond_to?(:copy_on_write_friendly=) and
# fast LAN. # fast LAN.
check_client_connection false check_client_connection false
before_exec do |server|
# The following is necessary to ensure stale Prometheus metrics don't
# accumulate over time. It needs to be done in this hook as opposed to
# inside an init script to ensure metrics files aren't deleted after new
# unicorn workers start after a SIGUSR2 is received.
if ENV['prometheus_multiproc_dir']
old_metrics = Dir[File.join(ENV['prometheus_multiproc_dir'], '*.db')]
FileUtils.rm_rf(old_metrics)
end
end
before_fork do |server, worker| before_fork do |server, worker|
# the following is highly recommended for Rails + "preload_app true" # the following is highly recommended for Rails + "preload_app true"
# as there's no need for the master process to hold a connection # as there's no need for the master process to hold a connection
......
...@@ -16,6 +16,7 @@ GET /projects/:id/repository/commits ...@@ -16,6 +16,7 @@ GET /projects/:id/repository/commits
| `until` | string | no | Only commits before or on this date will be returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ | | `until` | string | no | Only commits before or on this date will be returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ |
| `path` | string | no | The file path | | `path` | string | no | The file path |
| `all` | boolean | no | Retrieve every commit from the repository | | `all` | boolean | no | Retrieve every commit from the repository |
| `with_stats` | boolean | no | Stats about each commit will be added to the response |
```bash ```bash
......
...@@ -15,19 +15,21 @@ module API ...@@ -15,19 +15,21 @@ module API
end end
params do params do
optional :ref_name, type: String, desc: 'The name of a repository branch or tag, if not given the default branch is used' optional :ref_name, type: String, desc: 'The name of a repository branch or tag, if not given the default branch is used'
optional :since, type: DateTime, desc: 'Only commits after or on this date will be returned' optional :since, type: DateTime, desc: 'Only commits after or on this date will be returned'
optional :until, type: DateTime, desc: 'Only commits before or on this date will be returned' optional :until, type: DateTime, desc: 'Only commits before or on this date will be returned'
optional :path, type: String, desc: 'The file path' optional :path, type: String, desc: 'The file path'
optional :all, type: Boolean, desc: 'Every commit will be returned' optional :all, type: Boolean, desc: 'Every commit will be returned'
optional :with_stats, type: Boolean, desc: 'Stats about each commit will be added to the response'
use :pagination use :pagination
end end
get ':id/repository/commits' do get ':id/repository/commits' do
path = params[:path] path = params[:path]
before = params[:until] before = params[:until]
after = params[:since] after = params[:since]
ref = params[:ref_name] || user_project.try(:default_branch) || 'master' unless params[:all] ref = params[:ref_name] || user_project.try(:default_branch) || 'master' unless params[:all]
offset = (params[:page] - 1) * params[:per_page] offset = (params[:page] - 1) * params[:per_page]
all = params[:all] all = params[:all]
with_stats = params[:with_stats]
commits = user_project.repository.commits(ref, commits = user_project.repository.commits(ref,
path: path, path: path,
...@@ -47,7 +49,9 @@ module API ...@@ -47,7 +49,9 @@ module API
paginated_commits = Kaminari.paginate_array(commits, total_count: commit_count) paginated_commits = Kaminari.paginate_array(commits, total_count: commit_count)
present paginate(paginated_commits), with: Entities::Commit serializer = with_stats ? Entities::CommitWithStats : Entities::Commit
present paginate(paginated_commits), with: serializer
end end
desc 'Commit multiple file changes as one commit' do desc 'Commit multiple file changes as one commit' do
......
...@@ -308,6 +308,10 @@ module API ...@@ -308,6 +308,10 @@ module API
expose :additions, :deletions, :total expose :additions, :deletions, :total
end end
class CommitWithStats < Commit
expose :stats, using: Entities::CommitStats
end
class CommitDetail < Commit class CommitDetail < Commit
expose :stats, using: Entities::CommitStats, if: :stats expose :stats, using: Entities::CommitStats, if: :stats
expose :status expose :status
......
...@@ -531,18 +531,22 @@ module API ...@@ -531,18 +531,22 @@ module API
authenticate! authenticate!
end end
desc 'Get the currently authenticated user' do # Enabling /user endpoint for the v3 version to allow oauth
success Entities::UserPublic # authentication through this endpoint.
end version %w(v3 v4), using: :path do
get do desc 'Get the currently authenticated user' do
entity = success Entities::UserPublic
if current_user.admin? end
Entities::UserWithAdmin get do
else entity =
Entities::UserPublic if current_user.admin?
end Entities::UserWithAdmin
else
Entities::UserPublic
end
present current_user, with: entity present current_user, with: entity
end
end end
desc "Get the currently authenticated user's SSH keys" do desc "Get the currently authenticated user's SSH keys" do
......
...@@ -1181,18 +1181,18 @@ module Gitlab ...@@ -1181,18 +1181,18 @@ module Gitlab
end end
def compare_source_branch(target_branch_name, source_repository, source_branch_name, straight:) def compare_source_branch(target_branch_name, source_repository, source_branch_name, straight:)
Gitlab::GitalyClient::StorageSettings.allow_disk_access do tmp_ref = "refs/tmp/#{SecureRandom.hex}"
with_repo_branch_commit(source_repository, source_branch_name) do |commit|
break unless commit
Gitlab::Git::Compare.new( return unless fetch_source_branch!(source_repository, source_branch_name, tmp_ref)
self,
target_branch_name, Gitlab::Git::Compare.new(
commit.sha, self,
straight: straight target_branch_name,
) tmp_ref,
end straight: straight
end )
ensure
delete_refs(tmp_ref)
end end
def write_ref(ref_path, ref, old_ref: nil, shell: true) def write_ref(ref_path, ref, old_ref: nil, shell: true)
......
...@@ -30,7 +30,7 @@ module MicrosoftTeams ...@@ -30,7 +30,7 @@ module MicrosoftTeams
result = { 'sections' => [] } result = { 'sections' => [] }
result['title'] = options[:title] result['title'] = options[:title]
result['summary'] = options[:pretext] result['summary'] = options[:summary]
result['sections'] << MicrosoftTeams::Activity.new(options[:activity]).prepare result['sections'] << MicrosoftTeams::Activity.new(options[:activity]).prepare
attachments = options[:attachments] attachments = options[:attachments]
......
{
"type": "object",
"allOf": [
{ "$ref": "basic.json" },
{
"required" : [
"stats"
],
"properties": {
"stats": { "$ref": "../commit_stats.json" }
}
}
]
}
{
"type": "array",
"items": { "$ref": "commit/with_stats.json" }
}
...@@ -62,6 +62,11 @@ describe('IDE jobs detail view', () => { ...@@ -62,6 +62,11 @@ describe('IDE jobs detail view', () => {
expect(vm.$el.querySelector('.build-loader-animation').style.display).toBe(''); expect(vm.$el.querySelector('.build-loader-animation').style.display).toBe('');
}); });
it('hides output when loading', () => {
expect(vm.$el.querySelector('.bash')).not.toBe(null);
expect(vm.$el.querySelector('.bash').style.display).toBe('none');
});
it('hide loading icon when isLoading is false', done => { it('hide loading icon when isLoading is false', done => {
vm.$store.state.pipelines.detailJob.isLoading = false; vm.$store.state.pipelines.detailJob.isLoading = false;
......
...@@ -8,7 +8,7 @@ describe MicrosoftTeams::Notifier do ...@@ -8,7 +8,7 @@ describe MicrosoftTeams::Notifier do
let(:options) do let(:options) do
{ {
title: 'JohnDoe4/project2', title: 'JohnDoe4/project2',
pretext: '[[JohnDoe4/project2](http://localhost/namespace2/gitlabhq)] Issue [#1 Awesome issue](http://localhost/namespace2/gitlabhq/issues/1) opened by user6', summary: '[[JohnDoe4/project2](http://localhost/namespace2/gitlabhq)] Issue [#1 Awesome issue](http://localhost/namespace2/gitlabhq/issues/1) opened by user6',
activity: { activity: {
title: 'Issue opened by user6', title: 'Issue opened by user6',
subtitle: 'in [JohnDoe4/project2](http://localhost/namespace2/gitlabhq)', subtitle: 'in [JohnDoe4/project2](http://localhost/namespace2/gitlabhq)',
......
...@@ -225,10 +225,15 @@ describe MicrosoftTeamsService do ...@@ -225,10 +225,15 @@ describe MicrosoftTeamsService do
it 'calls Microsoft Teams API for pipeline events' do it 'calls Microsoft Teams API for pipeline events' do
data = Gitlab::DataBuilder::Pipeline.build(pipeline) data = Gitlab::DataBuilder::Pipeline.build(pipeline)
data[:markdown] = true
chat_service.execute(data) chat_service.execute(data)
expect(WebMock).to have_requested(:post, webhook_url).once message = ChatMessage::PipelineMessage.new(data)
expect(WebMock).to have_requested(:post, webhook_url)
.with(body: hash_including({ summary: message.summary }))
.once
end end
end end
......
...@@ -18,14 +18,14 @@ describe API::Commits do ...@@ -18,14 +18,14 @@ describe API::Commits do
describe 'GET /projects/:id/repository/commits' do describe 'GET /projects/:id/repository/commits' do
let(:route) { "/projects/#{project_id}/repository/commits" } let(:route) { "/projects/#{project_id}/repository/commits" }
shared_examples_for 'project commits' do shared_examples_for 'project commits' do |schema: 'public_api/v4/commits'|
it "returns project commits" do it "returns project commits" do
commit = project.repository.commit commit = project.repository.commit
get api(route, current_user) get api(route, current_user)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to match_response_schema('public_api/v4/commits') expect(response).to match_response_schema(schema)
expect(json_response.first['id']).to eq(commit.id) expect(json_response.first['id']).to eq(commit.id)
expect(json_response.first['committer_name']).to eq(commit.committer_name) expect(json_response.first['committer_name']).to eq(commit.committer_name)
expect(json_response.first['committer_email']).to eq(commit.committer_email) expect(json_response.first['committer_email']).to eq(commit.committer_email)
...@@ -161,6 +161,23 @@ describe API::Commits do ...@@ -161,6 +161,23 @@ describe API::Commits do
end end
end end
context 'with_stats optional parameter' do
let(:project) { create(:project, :public, :repository) }
it_behaves_like 'project commits', schema: 'public_api/v4/commits_with_stats' do
let(:route) { "/projects/#{project_id}/repository/commits?with_stats=true" }
it 'include commits details' do
commit = project.repository.commit
get api(route, current_user)
expect(json_response.first['stats']['additions']).to eq(commit.stats.additions)
expect(json_response.first['stats']['deletions']).to eq(commit.stats.deletions)
expect(json_response.first['stats']['total']).to eq(commit.stats.total)
end
end
end
context 'with pagination params' do context 'with pagination params' do
let(:page) { 1 } let(:page) { 1 }
let(:per_page) { 5 } let(:per_page) { 5 }
......
...@@ -1123,58 +1123,63 @@ describe API::Users do ...@@ -1123,58 +1123,63 @@ describe API::Users do
describe "GET /user" do describe "GET /user" do
let(:personal_access_token) { create(:personal_access_token, user: user).token } let(:personal_access_token) { create(:personal_access_token, user: user).token }
context 'with regular user' do shared_examples 'get user info' do |version|
context 'with personal access token' do context 'with regular user' do
it 'returns 403 without private token when sudo is defined' do context 'with personal access token' do
get api("/user?private_token=#{personal_access_token}&sudo=123") it 'returns 403 without private token when sudo is defined' do
get api("/user?private_token=#{personal_access_token}&sudo=123", version: version)
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(403)
end
end end
end
it 'returns current user without private token when sudo not defined' do it 'returns current user without private token when sudo not defined' do
get api("/user", user) get api("/user", user, version: version)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to match_response_schema('public_api/v4/user/public') expect(response).to match_response_schema('public_api/v4/user/public')
expect(json_response['id']).to eq(user.id) expect(json_response['id']).to eq(user.id)
end end
context "scopes" do context "scopes" do
let(:path) { "/user" } let(:path) { "/user" }
let(:api_call) { method(:api) } let(:api_call) { method(:api) }
include_examples 'allows the "read_user" scope' include_examples 'allows the "read_user" scope', version
end
end end
end
context 'with admin' do context 'with admin' do
let(:admin_personal_access_token) { create(:personal_access_token, user: admin).token } let(:admin_personal_access_token) { create(:personal_access_token, user: admin).token }
context 'with personal access token' do context 'with personal access token' do
it 'returns 403 without private token when sudo defined' do it 'returns 403 without private token when sudo defined' do
get api("/user?private_token=#{admin_personal_access_token}&sudo=#{user.id}") get api("/user?private_token=#{admin_personal_access_token}&sudo=#{user.id}", version: version)
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
it 'returns initial current user without private token but with is_admin when sudo not defined' do it 'returns initial current user without private token but with is_admin when sudo not defined' do
get api("/user?private_token=#{admin_personal_access_token}") get api("/user?private_token=#{admin_personal_access_token}", version: version)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to match_response_schema('public_api/v4/user/admin') expect(response).to match_response_schema('public_api/v4/user/admin')
expect(json_response['id']).to eq(admin.id) expect(json_response['id']).to eq(admin.id)
end
end end
end end
end
context 'with unauthenticated user' do context 'with unauthenticated user' do
it "returns 401 error if user is unauthenticated" do it "returns 401 error if user is unauthenticated" do
get api("/user") get api("/user", version: version)
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(401)
end
end end
end end
it_behaves_like 'get user info', 'v3'
it_behaves_like 'get user info', 'v4'
end end
describe "GET /user/keys" do describe "GET /user/keys" do
......
shared_examples_for 'allows the "read_user" scope' do shared_examples_for 'allows the "read_user" scope' do |api_version|
let(:version) { api_version || 'v4' }
context 'for personal access tokens' do context 'for personal access tokens' do
context 'when the requesting token has the "api" scope' do context 'when the requesting token has the "api" scope' do
let(:token) { create(:personal_access_token, scopes: ['api'], user: user) } let(:token) { create(:personal_access_token, scopes: ['api'], user: user) }
it 'returns a "200" response' do it 'returns a "200" response' do
get api_call.call(path, user, personal_access_token: token) get api_call.call(path, user, personal_access_token: token, version: version)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
...@@ -14,7 +16,7 @@ shared_examples_for 'allows the "read_user" scope' do ...@@ -14,7 +16,7 @@ shared_examples_for 'allows the "read_user" scope' do
let(:token) { create(:personal_access_token, scopes: ['read_user'], user: user) } let(:token) { create(:personal_access_token, scopes: ['read_user'], user: user) }
it 'returns a "200" response' do it 'returns a "200" response' do
get api_call.call(path, user, personal_access_token: token) get api_call.call(path, user, personal_access_token: token, version: version)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
...@@ -28,7 +30,7 @@ shared_examples_for 'allows the "read_user" scope' do ...@@ -28,7 +30,7 @@ shared_examples_for 'allows the "read_user" scope' do
end end
it 'returns a "403" response' do it 'returns a "403" response' do
get api_call.call(path, user, personal_access_token: token) get api_call.call(path, user, personal_access_token: token, version: version)
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment