From 5583197e091e8f75ad9c99a1bbc46e6a0b7279d4 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 29 Mar 2016 17:42:38 +0200 Subject: Create NotificationSettings object only when user change value in dropdown Signed-off-by: Dmitriy Zaporozhets --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index 6bf22fb4456..c665cefbb57 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -606,6 +606,7 @@ Rails.application.routes.draw do resources :forks, only: [:index, :new, :create] resource :import, only: [:new, :create, :show] + resources :notification_settings, only: [:create, :update] resources :refs, only: [] do collection do -- cgit v1.2.1 From 26631f9981a826ebe4aeba726e9be2b813d2c5c5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 29 Mar 2016 18:59:03 +0200 Subject: Change how notification settings in profile are rendered and updated Signed-off-by: Dmitriy Zaporozhets --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index c665cefbb57..7f03fbf6af9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -406,6 +406,7 @@ Rails.application.routes.draw do resource :avatar, only: [:destroy] resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create] + resources :notification_settings, only: [:update] end end -- cgit v1.2.1 From bf9526739b5c90790907c1d8b9410dd339e3d395 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 4 Apr 2016 17:23:43 +0200 Subject: Rebase repo check MR --- config/gitlab.yml.example | 7 +++++++ config/initializers/1_settings.rb | 7 ++++++- config/routes.rb | 5 +++++ 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index fb1c3476f65..cf20fc9c63a 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -155,6 +155,13 @@ production: &base # Flag stuck CI builds as failed stuck_ci_builds_worker: cron: "0 0 * * *" + # Periodically run 'git fsck' on all repositories. If started more than + # once per hour you will have concurrent 'git fsck' jobs. + repo_check_worker: + cron: "20 * * * *" + # Send admin emails once a day + admin_email_worker: + cron: "0 0 * * *" # diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 2b989015279..8240978ef06 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -239,7 +239,12 @@ Settings['cron_jobs'] ||= Settingslogic.new({}) Settings.cron_jobs['stuck_ci_builds_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['stuck_ci_builds_worker']['cron'] ||= '0 0 * * *' Settings.cron_jobs['stuck_ci_builds_worker']['job_class'] = 'StuckCiBuildsWorker' - +Settings.cron_jobs['repo_check_worker'] ||= Settingslogic.new({}) +Settings.cron_jobs['repo_check_worker']['cron'] ||= '20 * * * *' +Settings.cron_jobs['repo_check_worker']['job_class'] = 'RepoCheckWorker' +Settings.cron_jobs['admin_email_worker'] ||= Settingslogic.new({}) +Settings.cron_jobs['admin_email_worker']['cron'] ||= '0 0 * * *' +Settings.cron_jobs['admin_email_worker']['job_class'] = 'AdminEmailWorker' # # GitLab Shell diff --git a/config/routes.rb b/config/routes.rb index 6bf22fb4456..fad8600b77d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -264,6 +264,11 @@ Rails.application.routes.draw do member do put :transfer + post :repo_check + end + + collection do + put :clear_repo_check_states end resources :runner_projects -- cgit v1.2.1 From 5cf56e56470e695b10db02dff70d0f0b50060518 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Wed, 6 Apr 2016 13:47:05 +0200 Subject: Rename almost all the things --- config/gitlab.yml.example | 2 +- config/initializers/1_settings.rb | 6 +++--- config/routes.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index cf20fc9c63a..4fbef653bc1 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -157,7 +157,7 @@ production: &base cron: "0 0 * * *" # Periodically run 'git fsck' on all repositories. If started more than # once per hour you will have concurrent 'git fsck' jobs. - repo_check_worker: + repository_check_worker: cron: "20 * * * *" # Send admin emails once a day admin_email_worker: diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 8240978ef06..23771553c45 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -239,9 +239,9 @@ Settings['cron_jobs'] ||= Settingslogic.new({}) Settings.cron_jobs['stuck_ci_builds_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['stuck_ci_builds_worker']['cron'] ||= '0 0 * * *' Settings.cron_jobs['stuck_ci_builds_worker']['job_class'] = 'StuckCiBuildsWorker' -Settings.cron_jobs['repo_check_worker'] ||= Settingslogic.new({}) -Settings.cron_jobs['repo_check_worker']['cron'] ||= '20 * * * *' -Settings.cron_jobs['repo_check_worker']['job_class'] = 'RepoCheckWorker' +Settings.cron_jobs['repository_check_worker'] ||= Settingslogic.new({}) +Settings.cron_jobs['repository_check_worker']['cron'] ||= '20 * * * *' +Settings.cron_jobs['repository_check_worker']['job_class'] = 'RepositoryCheckWorker' Settings.cron_jobs['admin_email_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['admin_email_worker']['cron'] ||= '0 0 * * *' Settings.cron_jobs['admin_email_worker']['job_class'] = 'AdminEmailWorker' diff --git a/config/routes.rb b/config/routes.rb index fad8600b77d..c0ed99b1964 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -264,11 +264,11 @@ Rails.application.routes.draw do member do put :transfer - post :repo_check + post :repository_check end collection do - put :clear_repo_check_states + put :clear_repository_check_states end resources :runner_projects -- cgit v1.2.1 From 069724cef5873b83720004772d1e874030cc9fff Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Fri, 8 Apr 2016 17:11:13 -0300 Subject: Use singular resource for NotificationSetting Since a user cannot have multiple NotificationSettings records for one group/project we can use singular resource. --- config/routes.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index fade07c0500..552385110dd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -406,7 +406,7 @@ Rails.application.routes.draw do resource :avatar, only: [:destroy] resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create] - resources :notification_settings, only: [:update] + resource :notification_setting, only: [:update] end end @@ -608,7 +608,7 @@ Rails.application.routes.draw do resources :forks, only: [:index, :new, :create] resource :import, only: [:new, :create, :show] - resources :notification_settings, only: [:create, :update] + resource :notification_setting, only: [:create, :update] resources :refs, only: [] do collection do -- cgit v1.2.1 From 12e6084667f8750c263b4a2e324e9a283697b52e Mon Sep 17 00:00:00 2001 From: Patricio Cano Date: Mon, 11 Apr 2016 10:16:15 -0500 Subject: Allow `external_providers` for Omniauth to be defined to mark these users as external --- config/initializers/1_settings.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 72c4d8d61ce..94612997ead 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -129,6 +129,7 @@ Settings['omniauth'] ||= Settingslogic.new({}) Settings.omniauth['enabled'] = false if Settings.omniauth['enabled'].nil? Settings.omniauth['auto_sign_in_with_provider'] = false if Settings.omniauth['auto_sign_in_with_provider'].nil? Settings.omniauth['allow_single_sign_on'] = false if Settings.omniauth['allow_single_sign_on'].nil? +Settings.omniauth['external_providers'] = [] if Settings.omniauth['external_providers'].nil? Settings.omniauth['block_auto_created_users'] = true if Settings.omniauth['block_auto_created_users'].nil? Settings.omniauth['auto_link_ldap_user'] = false if Settings.omniauth['auto_link_ldap_user'].nil? Settings.omniauth['auto_link_saml_user'] = false if Settings.omniauth['auto_link_saml_user'].nil? -- cgit v1.2.1 From cedfe9d22851d6765b9737c2489e8ff166a7d238 Mon Sep 17 00:00:00 2001 From: Patricio Cano Date: Mon, 11 Apr 2016 10:16:56 -0500 Subject: Documentation of feature --- config/gitlab.yml.example | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 35c7c425a5a..75aba2544b5 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -304,6 +304,13 @@ production: &base # (default: false) auto_link_saml_user: false + # Set different Omniauth providers as external so that all users creating accounts + # via these providers will not be able to have access to internal projects. You + # will need to use the full name of the provider, like `google_oauth2` for Google. + # Refer to the examples below for the full names of the supported providers. + # (default: []) + external_providers: [] + ## Auth providers # Uncomment the following lines and fill in the data of the auth provider you want to use # If your favorite auth provider is not listed you can use others: -- cgit v1.2.1 From ef22b76b732c2bf4ce52b8a73570ac2921f9caa4 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Mon, 11 Apr 2016 19:33:26 -0300 Subject: Simplify Projects::NotificationSettingsController --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index 552385110dd..48601b7567b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -608,7 +608,7 @@ Rails.application.routes.draw do resources :forks, only: [:index, :new, :create] resource :import, only: [:new, :create, :show] - resource :notification_setting, only: [:create, :update] + resource :notification_setting, only: [:update] resources :refs, only: [] do collection do -- cgit v1.2.1 From cba2c437e582dd5880ec45cc4ff2fccda2315ad5 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 11 Apr 2016 15:38:36 -0400 Subject: Move RepositoryArchiveCacheWorker to sidekiq-cron Closes #15105 --- config/gitlab.yml.example | 3 +++ config/initializers/1_settings.rb | 3 +++ 2 files changed, 6 insertions(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 35c7c425a5a..1a512a2227f 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -156,6 +156,9 @@ production: &base stuck_ci_builds_worker: cron: "0 0 * * *" + # Remove outdated repository archives + repository_archive_cache_worker: + cron: "0 * * * *" # # 2. GitLab CI settings diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 72c4d8d61ce..ca74349e85d 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -239,6 +239,9 @@ Settings['cron_jobs'] ||= Settingslogic.new({}) Settings.cron_jobs['stuck_ci_builds_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['stuck_ci_builds_worker']['cron'] ||= '0 0 * * *' Settings.cron_jobs['stuck_ci_builds_worker']['job_class'] = 'StuckCiBuildsWorker' +Settings.cron_jobs['repository_archive_cache_worker'] ||= Settingslogic.new({}) +Settings.cron_jobs['repository_archive_cache_worker']['cron'] ||= '0 * * * *' +Settings.cron_jobs['repository_archive_cache_worker']['job_class'] = 'RepositoryArchiveCacheWorker' # -- cgit v1.2.1 From ea787165b3a9604aa86304e29778066bb014824e Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 12 Apr 2016 17:32:58 +0200 Subject: Move 'clear checks' button to applicatoin settings --- config/routes.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index c0ed99b1964..c163602126d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -267,10 +267,6 @@ Rails.application.routes.draw do post :repository_check end - collection do - put :clear_repository_check_states - end - resources :runner_projects end end @@ -286,6 +282,7 @@ Rails.application.routes.draw do resource :application_settings, only: [:show, :update] do resources :services put :reset_runners_token + put :clear_repository_check_states end resources :labels -- cgit v1.2.1 From 38cff18af0ed48bcd5916b6b6bb6ceeb9ab062fd Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Fri, 1 Apr 2016 15:04:03 -0700 Subject: Adjust the default trusted_proxies to only include localhost, and allow other trusted proxies to be configured. --- config/initializers/1_settings.rb | 1 + config/initializers/trusted_proxies.rb | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 config/initializers/trusted_proxies.rb (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 72c4d8d61ce..2167da306f2 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -190,6 +190,7 @@ Settings.gitlab.default_projects_features['visibility_level'] = Settings.send Settings.gitlab['repository_downloads_path'] = File.join(Settings.shared['path'], 'cache/archive') if Settings.gitlab['repository_downloads_path'].nil? Settings.gitlab['restricted_signup_domains'] ||= [] Settings.gitlab['import_sources'] ||= ['github','bitbucket','gitlab','gitorious','google_code','fogbugz','git'] +Settings.gitlab['trusted_proxies'] ||= [] # diff --git a/config/initializers/trusted_proxies.rb b/config/initializers/trusted_proxies.rb new file mode 100644 index 00000000000..b8cc025bae2 --- /dev/null +++ b/config/initializers/trusted_proxies.rb @@ -0,0 +1,2 @@ +Rails.application.config.action_dispatch.trusted_proxies = + [ '127.0.0.1', '::1' ] + Array(Gitlab.config.gitlab.trusted_proxies) -- cgit v1.2.1 From bb372ac97f733c45f22dc31e09b98a78411d4f86 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Wed, 6 Apr 2016 06:49:46 -0700 Subject: Add changelog entries, install docs, and gitlab.yml.example entry for the trusted_proxies setting --- config/gitlab.yml.example | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 35c7c425a5a..56caee47c97 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -46,6 +46,15 @@ production: &base # # relative_url_root: /gitlab + # Trusted Proxies + # Customize if you have GitLab behind a reverse proxy which is running on a different machine. + # Add the IP address for your reverse proxy to the list, otherwise users will appear signed in from that address. + trusted_proxies: + # Examples: + #- 192.168.1.0/24 + #- 192.168.2.1 + #- 2001:0db8::/32 + # Uncomment and customize if you can't use the default user to run GitLab (default: 'git') # user: git -- cgit v1.2.1 From 0f602be99f99f1ae493478a8a28df2907cfa0082 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Wed, 13 Apr 2016 15:56:05 +0200 Subject: Clear repository check columns asynchronously --- config/initializers/1_settings.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 5eb7fdff551..3124dc43065 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -241,7 +241,7 @@ Settings.cron_jobs['stuck_ci_builds_worker']['cron'] ||= '0 0 * * *' Settings.cron_jobs['stuck_ci_builds_worker']['job_class'] = 'StuckCiBuildsWorker' Settings.cron_jobs['repository_check_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['repository_check_worker']['cron'] ||= '20 * * * *' -Settings.cron_jobs['repository_check_worker']['job_class'] = 'RepositoryCheckWorker' +Settings.cron_jobs['repository_check_worker']['job_class'] = 'RepositoryCheck::BatchWorker' Settings.cron_jobs['admin_email_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['admin_email_worker']['cron'] ||= '0 0 * * *' Settings.cron_jobs['admin_email_worker']['job_class'] = 'AdminEmailWorker' -- cgit v1.2.1 From 31e28ebcebc054eaeef2eddba64ff2ff7ca3104f Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 12 Apr 2016 15:55:54 +0200 Subject: Load related MRs/branches asynchronously Currently this works by loading the HAML partials via XHR. While this is not the nicest setup it _is_ the easiest setup using the tools we currently have. Loading this data asynchronously doesn't make loading the related MRs/branches itself faster, it merely ensures that loading the issue itself is not slowed down. Fixes gitlab-org/gitlab-ce#14949 --- config/routes.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index 48601b7567b..688b83d2c95 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -701,6 +701,8 @@ Rails.application.routes.draw do resources :issues, constraints: { id: /\d+/ } do member do post :toggle_subscription + get :referenced_merge_requests + get :related_branches end collection do post :bulk_update -- cgit v1.2.1 From 2244aaf98f6c9b68e30febf6b80f2c0d965e541a Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Wed, 13 Apr 2016 13:20:57 +0300 Subject: Redis configuration consistency --- config/initializers/session_store.rb | 2 +- config/initializers/sidekiq.rb | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'config') diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 70285255877..88cb859871c 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -14,7 +14,7 @@ if Rails.env.test? Gitlab::Application.config.session_store :cookie_store, key: "_gitlab_session" else redis_config = Gitlab::Redis.redis_store_options - redis_config[:namespace] = 'session:gitlab' + redis_config[:namespace] = Gitlab::Redis::SESSION_NAMESPACE Gitlab::Application.config.session_store( :redis_store, # Using the cookie_store would enable session replay attacks. diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 9182d929809..f1eec674888 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,9 +1,7 @@ -SIDEKIQ_REDIS_NAMESPACE = 'resque:gitlab' - Sidekiq.configure_server do |config| config.redis = { url: Gitlab::Redis.url, - namespace: SIDEKIQ_REDIS_NAMESPACE + namespace: Gitlab::Redis::SIDEKIQ_NAMESPACE } config.server_middleware do |chain| @@ -30,6 +28,6 @@ end Sidekiq.configure_client do |config| config.redis = { url: Gitlab::Redis.url, - namespace: SIDEKIQ_REDIS_NAMESPACE + namespace: Gitlab::Redis::SIDEKIQ_NAMESPACE } end -- cgit v1.2.1 From a434ffd3b3a895bd75daed76000def23f4002f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 14 Apr 2016 12:20:16 +0200 Subject: Make /profile/keys/new redirects to /profile/keys for back-compat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Report: https://github.com/gitlabhq/gitlabhq/issues/10138 Signed-off-by: Rémy Coutable --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index 688b83d2c95..f32f7ea8557 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -326,7 +326,7 @@ Rails.application.routes.draw do end end resource :preferences, only: [:show, :update] - resources :keys, except: [:new] + resources :keys resources :emails, only: [:index, :create, :destroy] resource :avatar, only: [:destroy] resource :two_factor_auth, only: [:new, :create, :destroy] do -- cgit v1.2.1