_form.html.haml 17.8 KB
Newer Older
1
= form_for @application_setting, url: admin_application_settings_path, html: { class: 'form-horizontal fieldset-form' } do |f|
2
  = form_errors(@application_setting)
3

4
  %fieldset
5
    %legend Visibility and Access Controls
6
    .form-group
7 8 9 10 11 12
      = f.label :default_branch_protection, class: 'control-label col-sm-2'
      .col-sm-10
        = f.select :default_branch_protection, options_for_select(Gitlab::Access.protection_options, @application_setting.default_branch_protection), {}, class: 'form-control'
    .form-group.project-visibility-level-holder
      = f.label :default_project_visibility, class: 'control-label col-sm-2'
      .col-sm-10
13
        = render('shared/visibility_radios', model_method: :default_project_visibility, form: f, selected_level: @application_setting.default_project_visibility, form_model: Project.new)
14 15 16
    .form-group.project-visibility-level-holder
      = f.label :default_snippet_visibility, class: 'control-label col-sm-2'
      .col-sm-10
17
        = render('shared/visibility_radios', model_method: :default_snippet_visibility, form: f, selected_level: @application_setting.default_snippet_visibility, form_model: ProjectSnippet.new)
18
    .form-group.project-visibility-level-holder
19 20 21
      = f.label :default_group_visibility, class: 'control-label col-sm-2'
      .col-sm-10
        = render('shared/visibility_radios', model_method: :default_group_visibility, form: f, selected_level: @application_setting.default_group_visibility, form_model: Group.new)
22 23 24 25 26 27 28
    .form-group
      = f.label :restricted_visibility_levels, class: 'control-label col-sm-2'
      .col-sm-10
        - data_attrs = { toggle: 'buttons' }
        .btn-group{ data: data_attrs }
          - restricted_level_checkboxes('restricted-visibility-help').each do |level|
            = level
29 30
        %span.help-block#restricted-visibility-help
          Selected levels cannot be used by non-admin users for projects or snippets.
31
          If the public level is restricted, user profiles are only visible to logged in users.
32 33 34 35 36 37 38 39 40
    .form-group
      = f.label :import_sources, class: 'control-label col-sm-2'
      .col-sm-10
        - data_attrs = { toggle: 'buttons' }
        .btn-group{ data: data_attrs }
          - import_sources_checkboxes('import-sources-help').each do |source|
            = source
        %span.help-block#import-sources-help
          Enabled sources for code import during project creation. OmniAuth must be configured for GitHub
41
          = link_to "(?)", help_page_path("integration/github")
42
          , Bitbucket
43
          = link_to "(?)", help_page_path("integration/bitbucket")
44
          and GitLab.com
45
          = link_to "(?)", help_page_path("integration/gitlab")
46 47 48
    .form-group
      %label.control-label.col-sm-2 Enabled Git access protocols
      .col-sm-10
49
        = select(:application_setting, :enabled_git_access_protocol, [['Both SSH and HTTP(S)', nil], ['Only SSH', 'ssh'], ['Only HTTP(S)', 'http']], {}, class: 'form-control')
50 51
        %span.help-block#clone-protocol-help
          Allow only the selected protocols to be used for Git access.
52
    .form-group
53 54
      .col-sm-offset-2.col-sm-10
        .checkbox
55 56 57
          = f.label :version_check_enabled do
            = f.check_box :version_check_enabled
            Version check enabled
58 59 60 61 62 63 64 65 66 67
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :email_author_in_body do
            = f.check_box :email_author_in_body
            Include author name in notification email body
          .help-block
            Some email servers do not support overriding the email sender name.
            Enable this option to include the name of the author of the issue,
            merge request or comment in the email body instead.
68 69 70 71
    .form-group
      = f.label :admin_notification_email, class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_field :admin_notification_email, class: 'form-control'
72 73
        .help-block
          Abuse reports will be sent to this address if it is set. Abuse reports are always available in the admin area.
74 75 76

  %fieldset
    %legend Account and Limit Settings
77
    .form-group
78 79 80 81 82
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :gravatar_enabled do
            = f.check_box :gravatar_enabled
            Gravatar enabled
83
    .form-group
84
      = f.label :default_projects_limit, class: 'control-label col-sm-2'
85 86
      .col-sm-10
        = f.number_field :default_projects_limit, class: 'form-control'
87
    .form-group
88
      = f.label :max_attachment_size, 'Maximum attachment size (MB)', class: 'control-label col-sm-2'
V
Vinnie Okada 已提交
89
      .col-sm-10
90 91 92
        = f.number_field :max_attachment_size, class: 'form-control'
    .form-group
      = f.label :session_expire_delay, 'Session duration (minutes)', class: 'control-label col-sm-2'
V
Vinnie Okada 已提交
93
      .col-sm-10
94 95
        = f.number_field :session_expire_delay, class: 'form-control'
        %span.help-block#session_expire_delay_help_block GitLab restart is required to apply changes
96
    .form-group
97
      = f.label :user_oauth_applications, 'User OAuth applications', class: 'control-label col-sm-2'
98
      .col-sm-10
99 100 101 102
        .checkbox
          = f.label :user_oauth_applications do
            = f.check_box :user_oauth_applications
            Allow users to register any application to use GitLab as an OAuth provider
103 104 105 106 107 108 109
    .form-group
      = f.label :user_default_external, 'New users set to external', class: 'control-label col-sm-2'
      .col-sm-10
        .checkbox
          = f.label :user_default_external do
            = f.check_box :user_default_external
            Newly registered users will by default be external
110 111

  %fieldset
112
    %legend Sign-up Restrictions
113 114 115
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
116 117 118
          = f.label :signup_enabled do
            = f.check_box :signup_enabled
            Sign-up enabled
119 120 121
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
122
          = f.label :send_user_confirmation_email do
123
            = f.check_box :send_user_confirmation_email
124
            Send confirmation email on sign-up
125
    .form-group
126
      = f.label :domain_whitelist, 'Whitelisted domains for sign-ups', class: 'control-label col-sm-2'
127
      .col-sm-10
128
        = f.text_area :domain_whitelist_raw, placeholder: 'domain.com', class: 'form-control', rows: 8
129 130 131 132 133 134 135 136 137 138 139 140
        .help-block 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-group
      = f.label :domain_blacklist_enabled, 'Domain Blacklist', class: 'control-label col-sm-2'
      .col-sm-10
        .checkbox
          = f.label :domain_blacklist_enabled do
            = f.check_box :domain_blacklist_enabled
            Enable domain blacklist for sign ups
    .form-group
      .col-sm-offset-2.col-sm-10
        .radio
          = label_tag :blacklist_type_file do
141
            = radio_button_tag :blacklist_type, :file
142 143 144 145
            .option-title
              Upload blacklist file
        .radio
          = label_tag :blacklist_type_raw do
146
            = radio_button_tag :blacklist_type, :raw, @application_setting.domain_blacklist.present? || @application_setting.domain_blacklist.blank?
147 148 149 150 151 152 153 154
            .option-title
              Enter blacklist manually
    .form-group.blacklist-file
      = f.label :domain_blacklist_file, 'Blacklist file', class: 'control-label col-sm-2'
      .col-sm-10
        = f.file_field :domain_blacklist_file, class: 'form-control', accept: '.txt,.conf'
        .help-block 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.blacklist-raw
155
      = f.label :domain_blacklist, 'Blacklisted domains for sign-ups', class: 'control-label col-sm-2'
156
      .col-sm-10
157
        = f.text_area :domain_blacklist_raw, placeholder: 'domain.com', class: 'form-control', rows: 8
158 159 160 161 162 163 164 165 166 167
        .help-block 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
      = f.label :after_sign_up_text, class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_area :after_sign_up_text, class: 'form-control', rows: 4
        .help-block Markdown enabled

  %fieldset
    %legend Sign-in Restrictions
168 169 170 171 172 173
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :signin_enabled do
            = f.check_box :signin_enabled
            Sign-in enabled
174
    - if omniauth_enabled? && button_based_providers.any?
175
      .form-group
176
        = f.label :enabled_oauth_sign_in_sources, 'Enabled OAuth Sign-In sources', class: 'control-label col-sm-2'
177
        .col-sm-10
178
          .btn-group{ data: { toggle: 'buttons' } }
179
            - oauth_providers_checkboxes.each do |source|
180
              = source
181
    .form-group
182
      = f.label :two_factor_authentication, 'Two-factor authentication', class: 'control-label col-sm-2'
183 184 185 186
      .col-sm-10
        .checkbox
          = f.label :require_two_factor_authentication do
            = f.check_box :require_two_factor_authentication
187
            Require all users to setup Two-factor authentication
188
    .form-group
189
      = f.label :two_factor_authentication, 'Two-factor grace period (hours)', class: 'control-label col-sm-2'
190 191 192
      .col-sm-10
        = f.number_field :two_factor_grace_period, min: 0, class: 'form-control', placeholder: '0'
        .help-block Amount of time (in hours) that users are allowed to skip forced configuration of two-factor authentication
193
    .form-group
194
      = f.label :home_page_url, 'Home page URL', class: 'control-label col-sm-2'
195
      .col-sm-10
196 197
        = f.text_field :home_page_url, class: 'form-control', placeholder: 'http://company.example.com', :'aria-describedby' => 'home_help_block'
        %span.help-block#home_help_block We will redirect non-logged in users to this page
198 199 200 201 202
    .form-group
      = f.label :after_sign_out_path, class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_field :after_sign_out_path, class: 'form-control', placeholder: 'http://company.example.com', :'aria-describedby' => 'after_sign_out_path_help_block'
        %span.help-block#after_sign_out_path_help_block We will redirect users to this page after they sign out
203
    .form-group
204
      = f.label :sign_in_text, class: 'control-label col-sm-2'
205
      .col-sm-10
206 207
        = f.text_area :sign_in_text, class: 'form-control', rows: 4
        .help-block Markdown enabled
208 209 210 211 212
    .form-group
      = f.label :help_page_text, class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_area :help_page_text, class: 'form-control', rows: 4
        .help-block Markdown enabled
213

214 215 216 217 218 219 220
  %fieldset
    %legend Continuous Integration
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :shared_runners_enabled do
            = f.check_box :shared_runners_enabled
S
Steffen Köhler 已提交
221
            Enable shared runners for new projects
222 223 224 225 226
    .form-group
      = f.label :shared_runners_text, class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_area :shared_runners_text, class: 'form-control', rows: 4
        .help-block Markdown enabled
K
Kamil Trzcinski 已提交
227 228 229 230 231
    .form-group
      = f.label :max_artifacts_size, 'Maximum artifacts size (MB)', class: 'control-label col-sm-2'
      .col-sm-10
        = f.number_field :max_artifacts_size, class: 'form-control'

232 233 234 235 236 237 238 239
  - if Gitlab.config.registry.enabled
    %fieldset
      %legend Container Registry
      .form-group
        = f.label :container_registry_token_expire_delay, 'Authorization token duration (minutes)', class: 'control-label col-sm-2'
        .col-sm-10
          = f.number_field :container_registry_token_expire_delay, class: 'form-control'

240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
  %fieldset
    %legend Metrics
    %p
      These settings require a restart to take effect.
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :metrics_enabled do
            = f.check_box :metrics_enabled
            Enable InfluxDB Metrics
    .form-group
      = f.label :metrics_host, 'InfluxDB host', class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_field :metrics_host, class: 'form-control', placeholder: 'influxdb.example.com'
    .form-group
255
      = f.label :metrics_port, 'InfluxDB port', class: 'control-label col-sm-2'
256
      .col-sm-10
257
        = f.text_field :metrics_port, class: 'form-control', placeholder: '8089'
258
        .help-block
259 260 261 262
          The UDP port to use for connecting to InfluxDB. InfluxDB requires that
          your server configuration specifies a database to store data in when
          sending messages to this port, without it metrics data will not be
          saved.
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
    .form-group
      = f.label :metrics_pool_size, 'Connection pool size', class: 'control-label col-sm-2'
      .col-sm-10
        = f.number_field :metrics_pool_size, class: 'form-control'
        .help-block
          The amount of InfluxDB connections to open. Connections are opened
          lazily. Users using multi-threaded application servers should ensure
          enough connections are available (at minimum the amount of application
          server threads).
    .form-group
      = f.label :metrics_timeout, 'Connection timeout', class: 'control-label col-sm-2'
      .col-sm-10
        = f.number_field :metrics_timeout, class: 'form-control'
        .help-block
          The amount of seconds after which an InfluxDB connection will time
          out.
    .form-group
      = f.label :metrics_method_call_threshold, 'Method Call Threshold (ms)', class: 'control-label col-sm-2'
      .col-sm-10
        = f.number_field :metrics_method_call_threshold, class: 'form-control'
        .help-block
          A method call is only tracked when it takes longer to complete than
          the given amount of milliseconds.
286 287 288 289 290 291 292
    .form-group
      = f.label :metrics_sample_interval, 'Sampler Interval (sec)', class: 'control-label col-sm-2'
      .col-sm-10
        = f.number_field :metrics_sample_interval, class: 'form-control'
        .help-block
          The sampling interval in seconds. Sampled data includes memory usage,
          retained Ruby objects, file descriptors and so on.
293 294 295 296 297 298 299
    .form-group
      = f.label :metrics_packet_size, 'Metrics per packet', class: 'control-label col-sm-2'
      .col-sm-10
        = f.number_field :metrics_packet_size, class: 'form-control'
        .help-block
          The amount of points to store in a single UDP packet. More points
          results in fewer but larger UDP packets being sent.
300

301 302 303 304 305 306 307 308
  %fieldset
    %legend Spam and Anti-bot Protection
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :recaptcha_enabled do
            = f.check_box :recaptcha_enabled
            Enable reCAPTCHA
309
          %span.help-block#recaptcha_help_block Helps prevent bots from creating accounts
310 311 312 313 314 315

    .form-group
      = f.label :recaptcha_site_key, 'reCAPTCHA Site Key', class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_field :recaptcha_site_key, class: 'form-control'
        .help-block
316 317 318
          Generate site and private keys at
          %a{ href: 'http://www.google.com/recaptcha', target: 'blank'} http://www.google.com/recaptcha

319 320 321 322 323
    .form-group
      = f.label :recaptcha_private_key, 'reCAPTCHA Private Key', class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_field :recaptcha_private_key, class: 'form-control'

324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :akismet_enabled do
            = f.check_box :akismet_enabled
            Enable Akismet
          %span.help-block#akismet_help_block Helps prevent bots from creating issues

    .form-group
      = f.label :akismet_api_key, 'Akismet API Key', class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_field :akismet_api_key, class: 'form-control'
        .help-block
          Generate API key at
          %a{ href: 'http://www.akismet.com', target: 'blank'} http://www.akismet.com

J
Jeroen Nijhof 已提交
340 341 342 343 344 345 346 347 348 349
  %fieldset
    %legend Error Reporting and Logging
    %p
      These settings require a restart to take effect.
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :sentry_enabled do
            = f.check_box :sentry_enabled
            Enable Sentry
350 351
          .help-block
            Sentry is an error reporting and logging tool which is currently not shipped with GitLab, get it here:
D
Douwe Maan 已提交
352
            %a{ href: 'https://getsentry.com', target: '_blank' } https://getsentry.com
J
Jeroen Nijhof 已提交
353 354 355 356 357 358

    .form-group
      = f.label :sentry_dsn, 'Sentry DSN', class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_field :sentry_dsn, class: 'form-control'

359 360 361 362 363 364 365 366 367
  %fieldset
    %legend Repository Storage
    .form-group
      = f.label :repository_storage, 'Storage path for new projects', class: 'control-label col-sm-2'
      .col-sm-10
        = f.select :repository_storage, repository_storage_options_for_select, {}, class: 'form-control'
        .help-block
          You can manage the repository storage paths in your gitlab.yml configuration file

368 369 370 371 372 373 374 375 376
  %fieldset
    %legend Repository Checks
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :repository_checks_enabled do
            = f.check_box :repository_checks_enabled
            Enable Repository Checks
          .help-block
377
            GitLab will periodically run
378 379
            %a{ href: 'https://www.kernel.org/pub/software/scm/git/docs/git-fsck.html', target: 'blank' } 'git fsck'
            in all project and wiki repositories to look for silent disk corruption issues.
380 381 382 383
    .form-group
      .col-sm-offset-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"
        .help-block
J
Jacob Vosmaer 已提交
384
          If you got a lot of false alarms from repository checks you can choose to clear all repository check information from the database.
385

386

387
  .form-actions
388
    = f.submit 'Save', class: 'btn btn-save'