From cf852ecf870cabdb98527fee1c4d16767eee07ba Mon Sep 17 00:00:00 2001 From: tiagonbotelho Date: Thu, 25 Aug 2016 13:58:59 +0100 Subject: adds migration and respective validation and update of limit of memory per project --- app/controllers/admin/application_settings_controller.rb | 1 + app/models/application_setting.rb | 4 ++++ app/views/admin/application_settings/_form.html.haml | 4 ++++ 3 files changed, 9 insertions(+) (limited to 'app') diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index 6ef7cf0bae6..be483459f70 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -118,6 +118,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController :container_registry_token_expire_delay, :repository_storage, :enabled_git_access_protocol, + :project_size_limit, restricted_visibility_levels: [], import_sources: [], disabled_oauth_sign_in_sources: [] diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 246477ffe88..36d8bfa36ef 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -63,6 +63,10 @@ class ApplicationSetting < ActiveRecord::Base presence: true, numericality: { only_integer: true, greater_than: 0 } + validates :project_size_limit, + presence: true, + numericality: { only_integer: true, greater_than: 0 } + validates :container_registry_token_expire_delay, presence: true, numericality: { only_integer: true, greater_than: 0 } diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index d929364fc96..7410e6d883e 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -88,6 +88,10 @@ = f.label :max_attachment_size, 'Maximum attachment size (MB)', class: 'control-label col-sm-2' .col-sm-10 = f.number_field :max_attachment_size, class: 'form-control' + .form-group + = f.label :project_size_limit, 'Project size limit (MB)', class: 'control-label col-sm-2' + .col-sm-10 + = f.number_field :project_size_limit, class: 'form-control' .form-group = f.label :session_expire_delay, 'Session duration (minutes)', class: 'control-label col-sm-2' .col-sm-10 -- cgit v1.2.3