From 3e1bd5570f0ca277fb82a45d83f5bf44f3663a0d Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Wed, 22 Mar 2017 22:31:07 +0800 Subject: Test both PostgreSQL and MySQL for the win. --- config/database.yml.postgresql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/database.yml.postgresql b/config/database.yml.postgresql index 7067e0fe402..c517a4c0cb8 100644 --- a/config/database.yml.postgresql +++ b/config/database.yml.postgresql @@ -9,7 +9,7 @@ production: # username: git # password: # host: localhost - # port: 5432 + # port: 5432 # # Development specific @@ -21,6 +21,7 @@ development: pool: 5 username: postgres password: + # host: localhost # # Staging specific @@ -32,6 +33,7 @@ staging: pool: 5 username: postgres password: + # host: localhost # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". @@ -43,3 +45,4 @@ test: &test pool: 5 username: postgres password: + # host: localhost -- cgit v1.2.1 From 76e7d2564d30a72604496acf8cd6fb1228905c0f Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Mon, 10 Apr 2017 19:21:45 +0800 Subject: Set profiler only for postgresql not mysql Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10156#note_26812609 --- config/initializers/rspec_profiling.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/rspec_profiling.rb b/config/initializers/rspec_profiling.rb index 764c067c6f0..b909cc5b9a4 100644 --- a/config/initializers/rspec_profiling.rb +++ b/config/initializers/rspec_profiling.rb @@ -38,7 +38,7 @@ if Rails.env.test? end end - if ENV.has_key?('CI') + if ENV.has_key?('CI') && ENV['GITLAB_DATABASE'] == 'postgresql' RspecProfiling::VCS::Git.prepend(RspecProfilingExt::Git) RspecProfiling::Run.prepend(RspecProfilingExt::Run) end -- cgit v1.2.1 From 1b14a8d001941895d79fcbe807bef2f052b4289f Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 11 Apr 2017 01:27:36 +0800 Subject: Add # host for development and test as well --- config/database.yml.mysql | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') diff --git a/config/database.yml.mysql b/config/database.yml.mysql index a33e40e8eb3..db1b712d3bc 100644 --- a/config/database.yml.mysql +++ b/config/database.yml.mysql @@ -25,6 +25,7 @@ development: pool: 5 username: root password: "secure password" + # host: localhost # socket: /tmp/mysql.sock # Warning: The database defined as "test" will be erased and @@ -39,4 +40,5 @@ test: &test pool: 5 username: root password: + # host: localhost # socket: /tmp/mysql.sock -- cgit v1.2.1 From d6cc8feb6ce0a8e39a1bc8830b932155713357da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Rodr=C3=ADguez?= Date: Tue, 28 Mar 2017 22:23:45 -0300 Subject: Setup and run a Gitaly server for testing if GitalyClient is enabled --- config/gitlab.yml.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 3c70f35b9d0..06c9f734c2a 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -579,9 +579,9 @@ test: storages: default: path: tmp/tests/repositories/ - gitaly_address: unix:<%= Rails.root.join('tmp/sockets/private/gitaly.socket') %> + gitaly_address: unix:tmp/tests/gitaly/gitaly.socket gitaly: - enabled: false + enabled: true backup: path: tmp/tests/backups gitlab_shell: -- cgit v1.2.1 From 10deca824ed55d642ba942d21df768d9c1a376bc Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Wed, 12 Apr 2017 19:05:23 +0000 Subject: Improve webpack-dev-server compatibility with non-localhost setups. --- config/webpack.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 0fea3f8222b..ffb16190093 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -11,6 +11,7 @@ var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeMod var ROOT_PATH = path.resolve(__dirname, '..'); var IS_PRODUCTION = process.env.NODE_ENV === 'production'; var IS_DEV_SERVER = process.argv[1].indexOf('webpack-dev-server') !== -1; +var DEV_SERVER_HOST = process.env.DEV_SERVER_HOST || 'localhost'; var DEV_SERVER_PORT = parseInt(process.env.DEV_SERVER_PORT, 10) || 3808; var DEV_SERVER_LIVERELOAD = process.env.DEV_SERVER_LIVERELOAD !== 'false'; var WEBPACK_REPORT = process.env.WEBPACK_REPORT; @@ -182,12 +183,13 @@ if (IS_PRODUCTION) { if (IS_DEV_SERVER) { config.devtool = 'cheap-module-eval-source-map'; config.devServer = { + host: DEV_SERVER_HOST, port: DEV_SERVER_PORT, headers: { 'Access-Control-Allow-Origin': '*' }, stats: 'errors-only', inline: DEV_SERVER_LIVERELOAD }; - config.output.publicPath = '//localhost:' + DEV_SERVER_PORT + config.output.publicPath; + config.output.publicPath = '//' + DEV_SERVER_HOST + ':' + DEV_SERVER_PORT + config.output.publicPath; config.plugins.push( // watch node_modules for changes if we encounter a missing module compile error new WatchMissingNodeModulesPlugin(path.join(ROOT_PATH, 'node_modules')) -- cgit v1.2.1 From ebd5e9b4549ebc80155a5a8f139efdb40b6f8b12 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 5 Apr 2017 13:19:59 +0100 Subject: Port 'Add EE usage ping' to CE CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/557 --- config/initializers/1_settings.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 4c9d829aa9f..c19ccbb8fd8 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -110,6 +110,14 @@ class Settings < Settingslogic URI.parse(url_without_path).host end + + # Random cron time every Sunday to load balance usage pings + def cron_random_weekly_time + hour = rand(24) + minute = rand(60) + + "#{minute} #{hour} * * 0" + end end end @@ -355,6 +363,9 @@ Settings.cron_jobs['remove_unreferenced_lfs_objects_worker']['job_class'] = 'Rem Settings.cron_jobs['stuck_import_jobs_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['stuck_import_jobs_worker']['cron'] ||= '15 * * * *' Settings.cron_jobs['stuck_import_jobs_worker']['job_class'] = 'StuckImportJobsWorker' +Settings.cron_jobs['gitlab_usage_ping_worker'] ||= Settingslogic.new({}) +Settings.cron_jobs['gitlab_usage_ping_worker']['cron'] ||= Settings.send(:cron_random_weekly_time) +Settings.cron_jobs['gitlab_usage_ping_worker']['job_class'] = 'GitlabUsagePingWorker' # # GitLab Shell -- cgit v1.2.1 From 0483019e9800dc1b4ef4493890f815f047b7c04e Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 5 Apr 2017 13:29:48 +0100 Subject: Port 'Add more usage data to EE ping' to CE CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/735 --- config/routes/admin.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/routes/admin.rb b/config/routes/admin.rb index 486ce3c5c87..3c1c2ce2582 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -91,6 +91,7 @@ namespace :admin do resource :application_settings, only: [:show, :update] do resources :services, only: [:index, :edit, :update] + get :usage_data put :reset_runners_token put :reset_health_check_token put :clear_repository_check_states -- cgit v1.2.1 From d4da926f48503125307fe3d4a4f3952df92fc1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 7 Mar 2017 19:35:32 +0100 Subject: Add new ScheduleUpdateUserActivityWorker and UpdateUserActivityWorker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- config/initializers/1_settings.rb | 5 +++++ config/sidekiq_queues.yml | 1 + 2 files changed, 6 insertions(+) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index c19ccbb8fd8..96d39f7c4b3 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -367,6 +367,11 @@ Settings.cron_jobs['gitlab_usage_ping_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['gitlab_usage_ping_worker']['cron'] ||= Settings.send(:cron_random_weekly_time) Settings.cron_jobs['gitlab_usage_ping_worker']['job_class'] = 'GitlabUsagePingWorker' +# Every day at 00:30 +Settings.cron_jobs['schedule_update_user_activity_worker'] ||= Settingslogic.new({}) +Settings.cron_jobs['schedule_update_user_activity_worker']['cron'] ||= '30 0 * * *' +Settings.cron_jobs['schedule_update_user_activity_worker']['job_class'] = 'ScheduleUpdateUserActivityWorker' + # # GitLab Shell # diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index 9d2066a6490..bf8964d7f68 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -53,3 +53,4 @@ - [default, 1] - [pages, 1] - [system_hook_push, 1] + - [update_user_activity, 1] -- cgit v1.2.1 From 81022d76671a3c8961f6969542f8968901668a5f Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Thu, 30 Mar 2017 16:48:33 +0100 Subject: Add user cohorts table to admin area This table shows the percentage of users who registered in the last twelve months, who last signed in during or later than each of those twelve months, by month. It is only enabled when the usage ping is enabled, and the page also shows pretty-printed usage ping data. The cohorts table is generated in Ruby from some basic SQL queries, because performing the gap-filling and running sums needed in both MySQL and Postgres is painful. --- config/routes/admin.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') diff --git a/config/routes/admin.rb b/config/routes/admin.rb index 3c1c2ce2582..5b44d449b2b 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -106,6 +106,8 @@ namespace :admin do end end + resources :user_cohorts, only: :index + resources :builds, only: :index do collection do post :cancel_all -- cgit v1.2.1 From 5b698082323e019e47b5c739cdec0300b521340b Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 5 Apr 2017 11:24:15 +0100 Subject: Rename user cohorts -> cohorts --- config/routes/admin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/routes/admin.rb b/config/routes/admin.rb index 5b44d449b2b..52ba10604d4 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -106,7 +106,7 @@ namespace :admin do end end - resources :user_cohorts, only: :index + resources :cohorts, only: :index resources :builds, only: :index do collection do -- cgit v1.2.1 From 380e40fee30d836e6dffb1e956df39033d43a671 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 12 Apr 2017 16:13:24 +0100 Subject: Remove unused user activities code --- config/initializers/1_settings.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 96d39f7c4b3..2ccf9e45111 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -212,8 +212,8 @@ Settings.gitlab['email_from'] ||= ENV['GITLAB_EMAIL_FROM'] || "gitlab@#{Settings Settings.gitlab['email_display_name'] ||= ENV['GITLAB_EMAIL_DISPLAY_NAME'] || 'GitLab' Settings.gitlab['email_reply_to'] ||= ENV['GITLAB_EMAIL_REPLY_TO'] || "noreply@#{Settings.gitlab.host}" Settings.gitlab['email_subject_suffix'] ||= ENV['GITLAB_EMAIL_SUBJECT_SUFFIX'] || "" -Settings.gitlab['base_url'] ||= Settings.send(:build_base_gitlab_url) -Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url) +Settings.gitlab['base_url'] ||= Settings.__send__(:build_base_gitlab_url) +Settings.gitlab['url'] ||= Settings.__send__(:build_gitlab_url) Settings.gitlab['user'] ||= 'git' Settings.gitlab['user_home'] ||= begin Etc.getpwnam(Settings.gitlab['user']).dir -- cgit v1.2.1 From fce5738e9f2511effb14114389a0c0e1c880b88c Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 12 Apr 2017 16:13:48 +0100 Subject: Don't use `send` in settings initializer --- config/initializers/1_settings.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 2ccf9e45111..87bf48a3dcd 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -223,7 +223,7 @@ end Settings.gitlab['time_zone'] ||= nil Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled'].nil? Settings.gitlab['signin_enabled'] ||= true if Settings.gitlab['signin_enabled'].nil? -Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], []) +Settings.gitlab['restricted_visibility_levels'] = Settings.__send__(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], []) Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil? Settings.gitlab['issue_closing_pattern'] = '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e[sd]|ing)?|[Rr]esolv(?:e[sd]?|ing))(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?)|([A-Z][A-Z0-9_]+-\d+))+)' if Settings.gitlab['issue_closing_pattern'].nil? Settings.gitlab['default_projects_features'] ||= {} @@ -236,7 +236,7 @@ Settings.gitlab.default_projects_features['wiki'] = true if Settin Settings.gitlab.default_projects_features['snippets'] = true if Settings.gitlab.default_projects_features['snippets'].nil? Settings.gitlab.default_projects_features['builds'] = true if Settings.gitlab.default_projects_features['builds'].nil? Settings.gitlab.default_projects_features['container_registry'] = true if Settings.gitlab.default_projects_features['container_registry'].nil? -Settings.gitlab.default_projects_features['visibility_level'] = Settings.send(:verify_constant, Gitlab::VisibilityLevel, Settings.gitlab.default_projects_features['visibility_level'], Gitlab::VisibilityLevel::PRIVATE) +Settings.gitlab.default_projects_features['visibility_level'] = Settings.__send__(:verify_constant, Gitlab::VisibilityLevel, Settings.gitlab.default_projects_features['visibility_level'], Gitlab::VisibilityLevel::PRIVATE) Settings.gitlab['domain_whitelist'] ||= [] Settings.gitlab['import_sources'] ||= %w[github bitbucket gitlab google_code fogbugz git gitlab_project gitea] Settings.gitlab['trusted_proxies'] ||= [] @@ -250,7 +250,7 @@ Settings.gitlab_ci['shared_runners_enabled'] = true if Settings.gitlab_ci['share Settings.gitlab_ci['all_broken_builds'] = true if Settings.gitlab_ci['all_broken_builds'].nil? Settings.gitlab_ci['add_pusher'] = false if Settings.gitlab_ci['add_pusher'].nil? Settings.gitlab_ci['builds_path'] = Settings.absolute(Settings.gitlab_ci['builds_path'] || "builds/") -Settings.gitlab_ci['url'] ||= Settings.send(:build_gitlab_ci_url) +Settings.gitlab_ci['url'] ||= Settings.__send__(:build_gitlab_ci_url) # # Reply by email @@ -289,7 +289,7 @@ Settings.pages['https'] = false if Settings.pages['https'].nil? Settings.pages['host'] ||= "example.com" Settings.pages['port'] ||= Settings.pages.https ? 443 : 80 Settings.pages['protocol'] ||= Settings.pages.https ? "https" : "http" -Settings.pages['url'] ||= Settings.send(:build_pages_url) +Settings.pages['url'] ||= Settings.__send__(:build_pages_url) Settings.pages['external_http'] ||= false unless Settings.pages['external_http'].present? Settings.pages['external_https'] ||= false unless Settings.pages['external_https'].present? @@ -364,7 +364,7 @@ Settings.cron_jobs['stuck_import_jobs_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['stuck_import_jobs_worker']['cron'] ||= '15 * * * *' Settings.cron_jobs['stuck_import_jobs_worker']['job_class'] = 'StuckImportJobsWorker' Settings.cron_jobs['gitlab_usage_ping_worker'] ||= Settingslogic.new({}) -Settings.cron_jobs['gitlab_usage_ping_worker']['cron'] ||= Settings.send(:cron_random_weekly_time) +Settings.cron_jobs['gitlab_usage_ping_worker']['cron'] ||= Settings.__send__(:cron_random_weekly_time) Settings.cron_jobs['gitlab_usage_ping_worker']['job_class'] = 'GitlabUsagePingWorker' # Every day at 00:30 @@ -385,7 +385,7 @@ Settings.gitlab_shell['ssh_host'] ||= Settings.gitlab.ssh_host Settings.gitlab_shell['ssh_port'] ||= 22 Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user Settings.gitlab_shell['owner_group'] ||= Settings.gitlab.user -Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.send(:build_gitlab_shell_ssh_path_prefix) +Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.__send__(:build_gitlab_shell_ssh_path_prefix) # # Repositories -- cgit v1.2.1 From 00dd2ba95e9607ce4a1cd1a19aecee9b3e083768 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Fri, 14 Apr 2017 14:54:36 -0700 Subject: Turn on caching of classes in Knapsack specs Enabling caching of classes slows start-up time because all controllers are loaded at initialization, but it reduces memory and load because files are not reloaded with every request. For example, caching is not necessary for loading database migrations but useful for handling Knapsack specs. Addresses gitlab-org/gitlab-ee#2162 --- config/environments/test.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/environments/test.rb b/config/environments/test.rb index a25c5016a3b..c3b788c038e 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -8,7 +8,12 @@ Rails.application.configure do # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! - config.cache_classes = false + + # Enabling caching of classes slows start-up time because all controllers + # are loaded at initalization, but it reduces memory and load because files + # are not reloaded with every request. For example, caching is not necessary + # for loading database migrations but useful for handling Knapsack specs. + config.cache_classes = ENV['CACHE_CLASSES'] == 'true' # Configure static asset server for tests with Cache-Control for performance config.assets.digest = false -- cgit v1.2.1 From 8918433af66b77ab101bd5ba3b4a3c716be0f864 Mon Sep 17 00:00:00 2001 From: Regis Boudinot Date: Sat, 15 Apr 2017 15:11:04 +0000 Subject: Issue Title Vue: convert to .vue - use 'render' with 'createElement' in index --- config/webpack.config.js | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index ffb16190093..64a04dc342e 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -125,6 +125,7 @@ var config = { 'notebook_viewer', 'pdf_viewer', 'vue_pipelines', + 'issue_show', ], minChunks: function(module, count) { return module.resource && (/vue_shared/).test(module.resource); -- cgit v1.2.1 From 00c4e1410388b6d85e3f163204a49c31f76b5349 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 13 Apr 2017 11:44:52 -0500 Subject: Remove format from end of URL for URLs that take a ref or path --- config/routes/project.rb | 32 ---------- config/routes/repository.rb | 139 ++++++++++++++++++++++---------------------- 2 files changed, 70 insertions(+), 101 deletions(-) (limited to 'config') diff --git a/config/routes/project.rb b/config/routes/project.rb index f5009186344..fa92202c1ea 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -42,29 +42,6 @@ constraints(ProjectUrlConstrainer.new) do resources :domains, only: [:show, :new, :create, :destroy], controller: 'pages_domains', constraints: { id: /[^\/]+/ } end - resources :compare, only: [:index, :create] do - collection do - get :diff_for_path - end - end - - get '/compare/:from...:to', to: 'compare#show', as: 'compare', constraints: { from: /.+/, to: /.+/ } - - # Don't use format parameter as file extension (old 3.0.x behavior) - # See http://guides.rubyonrails.org/routing.html#route-globbing-and-wildcard-segments - scope format: false do - resources :network, only: [:show], constraints: { id: Gitlab::Regex.git_reference_regex } - - resources :graphs, only: [:show], constraints: { id: Gitlab::Regex.git_reference_regex } do - member do - get :charts - get :commits - get :ci - get :languages - end - end - end - resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do member do get 'raw' @@ -128,15 +105,6 @@ constraints(ProjectUrlConstrainer.new) do end end - resources :branches, only: [:index, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex } - delete :merged_branches, controller: 'branches', action: :destroy_all_merged - resources :tags, only: [:index, :show, :new, :create, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex } do - resource :release, only: [:edit, :update] - end - - resources :protected_branches, only: [:index, :show, :create, :update, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex } - resources :protected_tags, only: [:index, :show, :create, :update, :destroy], constraints: { id: Gitlab::Regex.git_reference_regex } - resources :variables, only: [:index, :show, :update, :create, :destroy] resources :triggers, only: [:index, :create, :edit, :update, :destroy] do member do diff --git a/config/routes/repository.rb b/config/routes/repository.rb index f8966c5ae75..5cf37a06e97 100644 --- a/config/routes/repository.rb +++ b/config/routes/repository.rb @@ -1,4 +1,4 @@ -# All routing related to repositoty browsing +# All routing related to repository browsing resource :repository, only: [:create] do member do @@ -6,83 +6,84 @@ resource :repository, only: [:create] do end end -resources :refs, only: [] do - collection do - get 'switch' +# Don't use format parameter as file extension (old 3.0.x behavior) +# See http://guides.rubyonrails.org/routing.html#route-globbing-and-wildcard-segments +scope format: false do + get '/compare/:from...:to', to: 'compare#show', as: 'compare', constraints: { from: /.+/, to: /.+/ } + + resources :compare, only: [:index, :create] do + collection do + get :diff_for_path + end end - member do - # tree viewer logs - get 'logs_tree', constraints: { id: Gitlab::Regex.git_reference_regex } - # Directories with leading dots erroneously get rejected if git - # ref regex used in constraints. Regex verification now done in controller. - get 'logs_tree/*path' => 'refs#logs_tree', as: :logs_file, constraints: { - id: /.*/, - path: /.*/ - } + resources :refs, only: [] do + collection do + get 'switch' + end + + member do + # tree viewer logs + get 'logs_tree', constraints: { id: Gitlab::Regex.git_reference_regex } + # Directories with leading dots erroneously get rejected if git + # ref regex used in constraints. Regex verification now done in controller. + get 'logs_tree/*path', action: :logs_tree, as: :logs_file, format: false, constraints: { + id: /.*/, + path: /.*/ + } + end end -end -get '/new/*id', to: 'blob#new', constraints: { id: /.+/ }, as: 'new_blob' -post '/create/*id', to: 'blob#create', constraints: { id: /.+/ }, as: 'create_blob' -get '/edit/*id', to: 'blob#edit', constraints: { id: /.+/ }, as: 'edit_blob' -put '/update/*id', to: 'blob#update', constraints: { id: /.+/ }, as: 'update_blob' -post '/preview/*id', to: 'blob#preview', constraints: { id: /.+/ }, as: 'preview_blob' + scope constraints: { id: Gitlab::Regex.git_reference_regex } do + resources :network, only: [:show] -scope('/blob/*id', as: :blob, controller: :blob, constraints: { id: /.+/, format: false }) do - get :diff - get '/', action: :show - delete '/', action: :destroy - post '/', action: :create - put '/', action: :update -end + resources :graphs, only: [:show] do + member do + get :charts + get :commits + get :ci + get :languages + end + end -get( - '/raw/*id', - to: 'raw#show', - constraints: { id: /.+/, format: /(html|js)/ }, - as: :raw -) + resources :branches, only: [:index, :new, :create, :destroy] + delete :merged_branches, controller: 'branches', action: :destroy_all_merged + resources :tags, only: [:index, :show, :new, :create, :destroy] do + resource :release, only: [:edit, :update] + end -get( - '/tree/*id', - to: 'tree#show', - constraints: { id: /.+/, format: /(html|js)/ }, - as: :tree -) + resources :protected_branches, only: [:index, :show, :create, :update, :destroy] + resources :protected_tags, only: [:index, :show, :create, :update, :destroy] + end + + scope constraints: { id: /.+/ } do + scope controller: :blob do + get '/new/*id', action: :new, as: :new_blob + post '/create/*id', action: :create, as: :create_blob + get '/edit/*id', action: :edit, as: :edit_blob + put '/update/*id', action: :update, as: :update_blob + post '/preview/*id', action: :preview, as: :preview_blob -get( - '/find_file/*id', - to: 'find_file#show', - constraints: { id: /.+/, format: /html/ }, - as: :find_file -) + scope path: '/blob/*id', as: :blob do + get :diff + get '/', action: :show + delete '/', action: :destroy + post '/', action: :create + put '/', action: :update + end + end -get( - '/files/*id', - to: 'find_file#list', - constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ }, - as: :files -) + get '/tree/*id', to: 'tree#show', as: :tree + get '/raw/*id', to: 'raw#show', as: :raw + get '/blame/*id', to: 'blame#show', as: :blame + get '/commits/*id', to: 'commits#show', as: :commits -post( - '/create_dir/*id', - to: 'tree#create_dir', - constraints: { id: /.+/ }, - as: 'create_dir' -) + post '/create_dir/*id', to: 'tree#create_dir', as: :create_dir -get( - '/blame/*id', - to: 'blame#show', - constraints: { id: /.+/, format: /(html|js)/ }, - as: :blame -) + scope controller: :find_file do + get '/find_file/*id', action: :show, as: :find_file -# File/dir history -get( - '/commits/*id', - to: 'commits#show', - constraints: { id: /.+/, format: false }, - as: :commits -) + get '/files/*id', action: :list, as: :files + end + end +end -- cgit v1.2.1 From 468ff9593a1e1ba13228966480dea72d516b7644 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Wed, 19 Apr 2017 11:44:37 +0000 Subject: Remove special naming of pipelines folder --- config/webpack.config.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 64a04dc342e..cb0a57a3a41 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -19,12 +19,11 @@ var WEBPACK_REPORT = process.env.WEBPACK_REPORT; var config = { context: path.join(ROOT_PATH, 'app/assets/javascripts'), entry: { + blob: './blob_edit/blob_bundle.js', + boards: './boards/boards_bundle.js', common: './commons/index.js', common_vue: ['vue', './vue_shared/common_vue.js'], common_d3: ['d3'], - main: './main.js', - blob: './blob_edit/blob_bundle.js', - boards: './boards/boards_bundle.js', cycle_analytics: './cycle_analytics/cycle_analytics_bundle.js', commit_pipelines: './commit/pipelines/pipelines_bundle.js', diff_notes: './diff_notes/diff_notes_bundle.js', @@ -32,26 +31,27 @@ var config = { environments_folder: './environments/folder/environments_folder_bundle.js', filtered_search: './filtered_search/filtered_search_bundle.js', graphs: './graphs/graphs_bundle.js', + group: './group.js', groups_list: './groups_list.js', issuable: './issuable/issuable_bundle.js', + issue_show: './issue_show/index.js', + main: './main.js', merge_conflicts: './merge_conflicts/merge_conflicts_bundle.js', merge_request_widget: './merge_request_widget/ci_bundle.js', monitoring: './monitoring/monitoring_bundle.js', network: './network/network_bundle.js', notebook_viewer: './blob/notebook_viewer.js', - sketch_viewer: './blob/sketch_viewer.js', pdf_viewer: './blob/pdf_viewer.js', + pipelines: './pipelines/index.js', profile: './profile/profile_bundle.js', protected_branches: './protected_branches/protected_branches_bundle.js', protected_tags: './protected_tags', snippet: './snippet/snippet_bundle.js', + sketch_viewer: './blob/sketch_viewer.js', stl_viewer: './blob/stl_viewer.js', terminal: './terminal/terminal_bundle.js', u2f: ['vendor/u2f'], users: './users/users_bundle.js', - vue_pipelines: './vue_pipelines_index/index.js', - issue_show: './issue_show/index.js', - group: './group.js', }, output: { @@ -121,11 +121,11 @@ var config = { 'environments', 'environments_folder', 'issuable', + 'issue_show', 'merge_conflicts', 'notebook_viewer', 'pdf_viewer', - 'vue_pipelines', - 'issue_show', + 'pipelines', ], minChunks: function(module, count) { return module.resource && (/vue_shared/).test(module.resource); -- cgit v1.2.1 From 6cb65c8c344e733902d7193facc71cdc8ce569c7 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Fri, 31 Mar 2017 02:37:45 +0200 Subject: Make location of gitlab_workhorse_secret configurable Hard-coding location of configuration files is very bad practice. This patch applies the same approach as currently used for gitlab_shell_secret file. --- config/gitlab.yml.example | 5 +++++ config/initializers/1_settings.rb | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 06c9f734c2a..c2eaf263937 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -505,6 +505,11 @@ production: &base # If you use non-standard ssh port you need to specify it # ssh_port: 22 + workhorse: + # File that contains the secret key for verifying access for gitlab-workhorse. + # Default is '.gitlab_workhorse_secret' relative to Rails.root (i.e. root of the GitLab app). + # secret_file: /home/git/gitlab/.gitlab_workhorse_secret + ## Git settings # CAUTION! # Use the default values unless you really know what you are doing diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 87bf48a3dcd..7a8f00f11b2 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -387,6 +387,12 @@ Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user Settings.gitlab_shell['owner_group'] ||= Settings.gitlab.user Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.__send__(:build_gitlab_shell_ssh_path_prefix) +# +# Workhorse +# +Settings['workhorse'] ||= Settingslogic.new({}) +Settings.workhorse['secret_file'] ||= Rails.root.join('.gitlab_workhorse_secret') + # # Repositories # -- cgit v1.2.1 From e9819de10aa1ca29cb760c714c37ab0a23c0bd89 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Mon, 10 Apr 2017 19:50:48 +0100 Subject: Remove the ClearDatabaseCacheWorker --- config/sidekiq_queues.yml | 1 - 1 file changed, 1 deletion(-) (limited to 'config') diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index bf8964d7f68..c3bd73533d0 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -34,7 +34,6 @@ - [repository_fork, 1] - [repository_import, 1] - [project_service, 1] - - [clear_database_cache, 1] - [delete_user, 1] - [delete_merged_branches, 1] - [authorized_projects, 1] -- cgit v1.2.1