diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-13 16:38:24 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-13 16:38:24 +0200 |
commit | ed3f267497a1348f7e50e396e1d3569f2da8d48b (patch) | |
tree | 4f2ce69ffec0447ed3bea34e73241ddfa24d2f40 /config | |
parent | f5d24e60f842096f670593fb4dd0d29c3f5d4fcc (diff) | |
parent | 9e68109f2d454dd05cf42a03a41a2e858e1e11bc (diff) | |
download | gitlab-ce-ed3f267497a1348f7e50e396e1d3569f2da8d48b.tar.gz |
Merge branch 'ci-commit-as-pipeline' into with-pipeline-view
* ci-commit-as-pipeline: (131 commits)
Optimise Merge Request builds rendering
Fix migrations on MySQL
Update db/schema.rb
Cleanup changes
Cleanup required migrations
Add indexes concurrently on PostgreSQL
Fix CiStatus implementation and tests
Fix group_member_spec to not leak information
Fix doc for moving an issue
Update tests for moving issues via API
Tie example config to JIRA screenshot
API: Ability to move an issue
Added ability to add custom tags to transactions
API: Avoid group leak while updating the group
API: Return 404 if user does not have access to group
Move 'New branch from issue' feature doc to web_editor.md
Fix repository cache invalidation issue when project is recreated with an empty repo
improve formatting
Add `Gitlab.com?` method
(doc) fix typo to ssh keys doc url
...
Conflicts:
app/controllers/projects/pipelines_controller.rb
app/helpers/ci_status_helper.rb
app/helpers/gitlab_routing_helper.rb
app/views/projects/ci/commits/_commit.html.haml
app/views/projects/commit/_ci_commit.html.haml
Diffstat (limited to 'config')
-rw-r--r-- | config/gitlab.yml.example | 19 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 5 | ||||
-rw-r--r-- | config/initializers/metrics.rb | 15 | ||||
-rw-r--r-- | config/initializers/trusted_proxies.rb | 2 | ||||
-rw-r--r-- | config/routes.rb | 2 |
5 files changed, 40 insertions, 3 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 35c7c425a5a..b28fc5c8e01 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 @@ -156,6 +165,9 @@ production: &base stuck_ci_builds_worker: cron: "0 0 * * *" + # Remove outdated repository archives + repository_archive_cache_worker: + cron: "0 * * * *" # # 2. GitLab CI settings @@ -304,6 +316,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: diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 72c4d8d61ce..287f99c724d 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? @@ -190,6 +191,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'] ||= [] # @@ -239,6 +241,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' # diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb index 1b445bbbd10..22fe51a4534 100644 --- a/config/initializers/metrics.rb +++ b/config/initializers/metrics.rb @@ -1,4 +1,5 @@ if Gitlab::Metrics.enabled? + require 'pathname' require 'influxdb' require 'connection_pool' require 'method_source' @@ -85,9 +86,6 @@ if Gitlab::Metrics.enabled? config.instrument_instance_methods(const) end - config.instrument_methods(Banzai::ReferenceExtractor) - config.instrument_instance_methods(Banzai::ReferenceExtractor) - config.instrument_methods(Banzai::Renderer) config.instrument_methods(Banzai::Querying) @@ -98,6 +96,17 @@ if Gitlab::Metrics.enabled? config.instrument_methods(Gitlab::ReferenceExtractor) config.instrument_instance_methods(Gitlab::ReferenceExtractor) + + # Instrument all service classes + services = Rails.root.join('app', 'services') + + Dir[services.join('**', '*.rb')].each do |file_path| + path = Pathname.new(file_path).relative_path_from(services) + const = path.to_s.sub('.rb', '').camelize.constantize + + config.instrument_methods(const) + config.instrument_instance_methods(const) + end end GC::Profiler.enable 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) diff --git a/config/routes.rb b/config/routes.rb index 6384757835a..0932739473d 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] + resource :notification_setting, only: [:update] end end @@ -607,6 +608,7 @@ Rails.application.routes.draw do resources :forks, only: [:index, :new, :create] resource :import, only: [:new, :create, :show] + resource :notification_setting, only: [:update] resources :refs, only: [] do collection do |