summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-03-07 16:55:03 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-03-07 16:55:03 +0800
commitfb167787f2c470649195a5d623f489ec2c3a9117 (patch)
treead60222b53a11ee2b29131f57e24ba66dd823c3d /config
parent7c9cff3a744a64848207bfde1aedcfe652f07dce (diff)
parent24f1ee5e9b1f4d9bc8cff581419b091756da8deb (diff)
downloadgitlab-ce-fb167787f2c470649195a5d623f489ec2c3a9117.tar.gz
Merge remote-tracking branch 'upstream/master' into set-default-cache-key-for-jobs
* upstream/master: (289 commits) re-add Assign to Me link on new MR/Issue forms thinner bottom header border make header match old 16px padding of body contents Update font-awesome-rails to 4.7.0.1 Relax font-awesome-rails dependency to ~> 4.7 Restore keyboard shortcuts for "Activity" and "Charts" fix border radius bottom for header match padding for mr-widget sections Update changelog Fix project-last-commit alignment Docs: update GL Pages IP on GL.com Fix up @DouweM review Remove readme-only project view preference Add `uploads` to known models for Import/Export spec Add `has_many` associations for models that can have Upload records Handle relative and absolute Upload paths in the Uploaders Change the default CarrierWave root path for tests Fix Projects::UploadService spec Add a Project::UploadsController spec to ensure an Upload is created Add `RecordsUploads` module to record Upload records via callbacks ...
Diffstat (limited to 'config')
-rw-r--r--config/application.rb4
-rw-r--r--config/gitlab.yml.example10
-rw-r--r--config/initializers/1_settings.rb7
-rw-r--r--config/initializers/8_metrics.rb (renamed from config/initializers/metrics.rb)0
-rw-r--r--config/initializers/etag_caching.rb4
-rw-r--r--config/initializers/request_context.rb3
-rw-r--r--config/initializers/warden.rb5
-rw-r--r--config/karma.config.js13
-rw-r--r--config/routes.rb3
-rw-r--r--config/routes/profile.rb2
-rw-r--r--config/routes/project.rb7
-rw-r--r--config/sidekiq_queues.yml1
-rw-r--r--config/webpack.config.js61
13 files changed, 97 insertions, 23 deletions
diff --git a/config/application.rb b/config/application.rb
index 45f3b20d214..cdb93e50e66 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -7,6 +7,7 @@ Bundler.require(:default, Rails.env)
module Gitlab
class Application < Rails::Application
require_dependency Rails.root.join('lib/gitlab/redis')
+ require_dependency Rails.root.join('lib/gitlab/request_context')
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
@@ -90,7 +91,6 @@ module Gitlab
# Enable the asset pipeline
config.assets.enabled = true
- config.assets.paths << Gemojione.images_path
config.assets.paths << "vendor/assets/fonts"
config.assets.precompile << "*.png"
config.assets.precompile << "print.css"
@@ -100,8 +100,6 @@ module Gitlab
config.assets.precompile << "katex.js"
config.assets.precompile << "xterm/xterm.css"
config.assets.precompile << "lib/ace.js"
- config.assets.precompile << "lib/cropper.js"
- config.assets.precompile << "lib/raphael.js"
config.assets.precompile << "u2f.js"
config.assets.precompile << "vendor/assets/fonts/*"
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index a82ff605a70..be34a4000fa 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -177,9 +177,9 @@ production: &base
# Periodically executed jobs, to self-heal Gitlab, do external synchronizations, etc.
# Please read here for more information: https://github.com/ondrejbartas/sidekiq-cron#adding-cron-job
cron_jobs:
- # Flag stuck CI builds as failed
- stuck_ci_builds_worker:
- cron: "0 0 * * *"
+ # Flag stuck CI jobs as failed
+ stuck_ci_jobs_worker:
+ cron: "0 * * * *"
# Remove expired build artifacts
expire_build_artifacts_worker:
cron: "50 * * * *"
@@ -483,6 +483,8 @@ production: &base
# multipart_chunk_size: 104857600
# # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional
# # encryption: 'AES256'
+ # # Specifies Amazon S3 storage class to use for backups, this is optional
+ # # storage_class: 'STANDARD'
## GitLab Shell settings
gitlab_shell:
@@ -586,7 +588,7 @@ test:
new_issue_url: "http://redmine/projects/:issues_tracker_id/issues/new"
jira:
title: "JIRA"
- url: https://sample_company.atlasian.net
+ url: https://sample_company.atlassian.net
project_key: PROJECT
ldap:
enabled: false
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index c64ae15fa92..933844e4ea6 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -308,9 +308,9 @@ Settings.gravatar['host'] = Settings.host_without_www(Settings.gravatar[
# Cron Jobs
#
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['stuck_ci_jobs_worker'] ||= Settingslogic.new({})
+Settings.cron_jobs['stuck_ci_jobs_worker']['cron'] ||= '0 * * * *'
+Settings.cron_jobs['stuck_ci_jobs_worker']['job_class'] = 'StuckCiJobsWorker'
Settings.cron_jobs['expire_build_artifacts_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['expire_build_artifacts_worker']['cron'] ||= '50 * * * *'
Settings.cron_jobs['expire_build_artifacts_worker']['job_class'] = 'ExpireBuildArtifactsWorker'
@@ -399,6 +399,7 @@ if Settings.backup['upload']['connection']
end
Settings.backup['upload']['multipart_chunk_size'] ||= 104857600
Settings.backup['upload']['encryption'] ||= nil
+Settings.backup['upload']['storage_class'] ||= nil
#
# Git
diff --git a/config/initializers/metrics.rb b/config/initializers/8_metrics.rb
index a1517e6afc8..a1517e6afc8 100644
--- a/config/initializers/metrics.rb
+++ b/config/initializers/8_metrics.rb
diff --git a/config/initializers/etag_caching.rb b/config/initializers/etag_caching.rb
new file mode 100644
index 00000000000..eba88801141
--- /dev/null
+++ b/config/initializers/etag_caching.rb
@@ -0,0 +1,4 @@
+# This middleware has to come after Gitlab::Metrics::RackMiddleware
+# in the middleware stack, because it tracks events with
+# GitLab Performance Monitoring
+Rails.application.config.middleware.use(Gitlab::EtagCaching::Middleware)
diff --git a/config/initializers/request_context.rb b/config/initializers/request_context.rb
new file mode 100644
index 00000000000..0b485fc1adc
--- /dev/null
+++ b/config/initializers/request_context.rb
@@ -0,0 +1,3 @@
+Rails.application.configure do |config|
+ config.middleware.insert_after RequestStore::Middleware, Gitlab::RequestContext
+end
diff --git a/config/initializers/warden.rb b/config/initializers/warden.rb
new file mode 100644
index 00000000000..3d83fb92d56
--- /dev/null
+++ b/config/initializers/warden.rb
@@ -0,0 +1,5 @@
+Rails.application.configure do |config|
+ Warden::Manager.after_set_user do |user, auth, opts|
+ Gitlab::Auth::UniqueIpsLimiter.limit_user!(user)
+ end
+end
diff --git a/config/karma.config.js b/config/karma.config.js
index 2f3cc932413..a23e62f5022 100644
--- a/config/karma.config.js
+++ b/config/karma.config.js
@@ -1,9 +1,10 @@
var path = require('path');
+var webpack = require('webpack');
var webpackConfig = require('./webpack.config.js');
var ROOT_PATH = path.resolve(__dirname, '..');
// add coverage instrumentation to babel config
-if (webpackConfig && webpackConfig.module && webpackConfig.module.rules) {
+if (webpackConfig.module && webpackConfig.module.rules) {
var babelConfig = webpackConfig.module.rules.find(function (rule) {
return rule.loader === 'babel-loader';
});
@@ -13,6 +14,16 @@ if (webpackConfig && webpackConfig.module && webpackConfig.module.rules) {
babelConfig.options.plugins.push('istanbul');
}
+// remove problematic plugins
+if (webpackConfig.plugins) {
+ webpackConfig.plugins = webpackConfig.plugins.filter(function (plugin) {
+ return !(
+ plugin instanceof webpack.optimize.CommonsChunkPlugin ||
+ plugin instanceof webpack.DefinePlugin
+ );
+ });
+}
+
// Karma configuration
module.exports = function(config) {
var progressReporter = process.env.CI ? 'mocha' : 'progress';
diff --git a/config/routes.rb b/config/routes.rb
index 06d565df469..06293316937 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -27,9 +27,6 @@ Rails.application.routes.draw do
get '/autocomplete/users/:id' => 'autocomplete#user'
get '/autocomplete/projects' => 'autocomplete#projects'
- # Emojis
- resources :emojis, only: :index
-
# Search
get 'search' => 'search#show'
get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete
diff --git a/config/routes/profile.rb b/config/routes/profile.rb
index 6b91485da9e..07c341999ea 100644
--- a/config/routes/profile.rb
+++ b/config/routes/profile.rb
@@ -21,7 +21,7 @@ resource :profile, only: [:show, :update] do
end
end
resource :preferences, only: [:show, :update]
- resources :keys, only: [:index, :show, :new, :create, :destroy]
+ resources :keys, only: [:index, :show, :create, :destroy]
resources :emails, only: [:index, :create, :destroy]
resources :chat_names, only: [:index, :new, :create, :destroy] do
collection do
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 94841639823..f5cc99b6867 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -13,7 +13,6 @@ constraints(ProjectUrlConstrainer.new) do
resources :autocomplete_sources, only: [] do
collection do
- get 'emojis'
get 'members'
get 'issues'
get 'merge_requests'
@@ -58,6 +57,7 @@ constraints(ProjectUrlConstrainer.new) do
resources :graphs, only: [:show], constraints: { id: Gitlab::Regex.git_reference_regex } do
member do
+ get :charts
get :commits
get :ci
get :languages
@@ -140,6 +140,7 @@ constraints(ProjectUrlConstrainer.new) do
resources :pipelines, only: [:index, :new, :create, :show] do
collection do
resource :pipelines_settings, path: 'settings', only: [:show, :update]
+ get :charts
end
member do
@@ -265,7 +266,7 @@ constraints(ProjectUrlConstrainer.new) do
resources :group_links, only: [:index, :create, :update, :destroy], constraints: { id: /\d+/ }
- resources :notes, only: [:index, :create, :destroy, :update], concerns: :awardable, constraints: { id: /\d+/ } do
+ resources :notes, only: [:create, :destroy, :update], concerns: :awardable, constraints: { id: /\d+/ } do
member do
delete :delete_attachment
post :resolve
@@ -273,6 +274,8 @@ constraints(ProjectUrlConstrainer.new) do
end
end
+ get 'noteable/:target_type/:target_id/notes' => 'notes#index', as: 'noteable_notes'
+
resources :boards, only: [:index, :show] do
scope module: :boards do
resources :issues, only: [:index, :update]
diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml
index 97620cc9c7f..824f99e687e 100644
--- a/config/sidekiq_queues.yml
+++ b/config/sidekiq_queues.yml
@@ -29,6 +29,7 @@
- [email_receiver, 2]
- [emails_on_push, 2]
- [mailers, 2]
+ - [upload_checksum, 1]
- [use_key, 1]
- [repository_fork, 1]
- [repository_import, 1]
diff --git a/config/webpack.config.js b/config/webpack.config.js
index e91794208e6..7298e7109c6 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -17,7 +17,10 @@ var WEBPACK_REPORT = process.env.WEBPACK_REPORT;
var config = {
context: path.join(ROOT_PATH, 'app/assets/javascripts'),
entry: {
- application: './application.js',
+ common: './commons/index.js',
+ common_vue: ['vue', 'vue-resource'],
+ common_d3: ['d3'],
+ main: './main.js',
blob_edit: './blob_edit/blob_edit_bundle.js',
boards: './boards/boards_bundle.js',
simulate_drag: './test_utils/simulate_drag.js',
@@ -38,16 +41,13 @@ var config = {
snippet: './snippet/snippet_bundle.js',
terminal: './terminal/terminal_bundle.js',
users: './users/users_bundle.js',
- lib_chart: './lib/chart.js',
- lib_d3: './lib/d3.js',
- lib_vue: './lib/vue_resource.js',
vue_pipelines: './vue_pipelines_index/index.js',
},
output: {
path: path.join(ROOT_PATH, 'public/assets/webpack'),
publicPath: '/assets/webpack/',
- filename: IS_PRODUCTION ? '[name]-[chunkhash].js' : '[name].js'
+ filename: IS_PRODUCTION ? '[name].[chunkhash].bundle.js' : '[name].bundle.js'
},
devtool: 'inline-source-map',
@@ -64,6 +64,10 @@ var config = {
'stage-2'
]
}
+ },
+ {
+ test: /\.svg$/,
+ use: 'raw-loader'
}
]
},
@@ -78,15 +82,60 @@ var config = {
modules: false,
assets: true
}),
+
+ // prevent pikaday from including moment.js
new webpack.IgnorePlugin(/moment/, /pikaday/),
+
+ // fix legacy jQuery plugins which depend on globals
+ new webpack.ProvidePlugin({
+ $: 'jquery',
+ jQuery: 'jquery',
+ }),
+
+ // use deterministic module ids in all environments
+ IS_PRODUCTION ?
+ new webpack.HashedModuleIdsPlugin() :
+ new webpack.NamedModulesPlugin(),
+
+ // create cacheable common library bundle for all vue chunks
+ new webpack.optimize.CommonsChunkPlugin({
+ name: 'common_vue',
+ chunks: [
+ 'boards',
+ 'commit_pipelines',
+ 'cycle_analytics',
+ 'diff_notes',
+ 'environments',
+ 'environments_folder',
+ 'issuable',
+ 'merge_conflicts',
+ 'vue_pipelines',
+ ],
+ minChunks: function(module, count) {
+ return module.resource && (/vue_shared/).test(module.resource);
+ },
+ }),
+
+ // create cacheable common library bundle for all d3 chunks
+ new webpack.optimize.CommonsChunkPlugin({
+ name: 'common_d3',
+ chunks: ['graphs', 'users'],
+ }),
+
+ // create cacheable common library bundles
+ new webpack.optimize.CommonsChunkPlugin({
+ names: ['main', 'common', 'runtime'],
+ }),
],
resolve: {
extensions: ['.js', '.es6', '.js.es6'],
alias: {
'~': path.join(ROOT_PATH, 'app/assets/javascripts'),
- 'bootstrap/js': 'bootstrap-sass/assets/javascripts/bootstrap',
+ 'emoji-map$': path.join(ROOT_PATH, 'fixtures/emojis/digests.json'),
'emoji-aliases$': path.join(ROOT_PATH, 'fixtures/emojis/aliases.json'),
+ 'empty_states': path.join(ROOT_PATH, 'app/views/shared/empty_states'),
+ 'icons': path.join(ROOT_PATH, 'app/views/shared/icons'),
'vendor': path.join(ROOT_PATH, 'vendor/assets/javascripts'),
'vue$': 'vue/dist/vue.common.js',
}