summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorPeter Golm <golm.peter@gmail.com>2014-01-09 13:03:22 +0100
committerPeter Golm <golm.peter@gmail.com>2014-01-09 13:03:22 +0100
commit5f034015bbaa0718c6b85b9291c7cbd728329666 (patch)
tree616df978e7d679a6a4c327aa8d7ce37ae82641d4 /config
parent9310e5ccbf98f0c59a05f2b0a47faab9c84c7577 (diff)
parent1f838a4f98fafa80ae5cfd7759b883b00870072f (diff)
downloadgitlab-ci-5f034015bbaa0718c6b85b9291c7cbd728329666.tar.gz
Merge github.com:gitlabhq/gitlab-ci into NewCharts
Conflicts: app/controllers/projects_controller.rb config/routes.rb
Diffstat (limited to 'config')
-rw-r--r--config/application.rb12
-rw-r--r--config/application.yml.example20
-rw-r--r--config/database.yml.postgresql2
-rw-r--r--config/environments/development.rb11
-rw-r--r--config/environments/production.rb14
-rw-r--r--config/environments/test.rb5
-rw-r--r--config/initializers/1_settings.rb34
-rw-r--r--config/initializers/secret_token.rb1
-rw-r--r--config/initializers/smtp_settings.rb.sample18
-rw-r--r--config/routes.rb2
-rw-r--r--config/schedule.rb2
11 files changed, 96 insertions, 25 deletions
diff --git a/config/application.rb b/config/application.rb
index 3e5c811..ad29b57 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -2,12 +2,7 @@ require File.expand_path('../boot', __FILE__)
require 'rails/all'
-if defined?(Bundler)
- # If you precompile assets before deploying to production, use this line
- # Bundler.require(*Rails.groups(:assets => %w(development test)))
- # If you want your assets lazily compiled in production, use this line
- Bundler.require(:default, :assets, Rails.env)
-end
+Bundler.require(:default, Rails.env)
module GitlabCi
class Application < Rails::Application
@@ -22,9 +17,6 @@ module GitlabCi
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
- # Activate observers that should always be running.
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
@@ -58,5 +50,7 @@ module GitlabCi
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
+
+ config.active_record.whitelist_attributes = false
end
end
diff --git a/config/application.yml.example b/config/application.yml.example
index 8ec7179..d0d092c 100644
--- a/config/application.yml.example
+++ b/config/application.yml.example
@@ -2,13 +2,33 @@ defaults: &defaults
allowed_gitlab_urls:
- 'https://dev.gitlab.org/'
- 'https://staging.gitlab.org/'
+
+ ## Gitlab CI settings
gitlab_ci:
+ ## Web server settings
+ host: localhost
+ port: 80
https: false
+
+ ## Email settings
+ # Email address used in the "From" field in mails sent by GitLab-CI
+ email_from: gitlab-ci@localhost
+
+ # Email address of your support contact (default: same as email_from)
+ support_email: support@localhost
+
+ # Send emails for all failing builds
+ # all_broken_builds: true
+
+ # Add committer to recipients list
+ # add_committer: true
+
gravatar:
enabled: true
plain_url: "http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm"
ssl_url: "https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm"
+
development:
<<: *defaults
neat_setting: 800
diff --git a/config/database.yml.postgresql b/config/database.yml.postgresql
index 45f1e71..f6bc38c 100644
--- a/config/database.yml.postgresql
+++ b/config/database.yml.postgresql
@@ -6,7 +6,7 @@ production:
encoding: unicode
database: gitlab_ci_production
pool: 5
- username: postgres
+ username: gitlab_ci
password:
# host: localhost
# port: 5432
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 73c9fb1..1ec813b 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -6,9 +6,6 @@ GitlabCi::Application.configure do
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
-
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
@@ -25,13 +22,13 @@ GitlabCi::Application.configure do
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
- # Log the query plan for queries taking more than this (works
- # with SQLite, MySQL, and PostgreSQL)
- config.active_record.auto_explain_threshold_in_seconds = 0.5
-
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
+
+ config.eager_load = false
+
+ config.action_mailer.delivery_method = :letter_opener
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index f120540..7cad55b 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -48,8 +48,14 @@ GitlabCi::Application.configure do
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
- # Disable delivery errors, bad email addresses will be ignored
- # config.action_mailer.raise_delivery_errors = false
+ config.action_mailer.delivery_method = :sendmail
+ # Defaults to:
+ # # config.action_mailer.sendmail_settings = {
+ # # location: '/usr/sbin/sendmail',
+ # # arguments: '-i -t'
+ # # }
+ config.action_mailer.perform_deliveries = true
+ config.action_mailer.raise_delivery_errors = true
# Enable threaded mode
# config.threadsafe!
@@ -64,4 +70,8 @@ GitlabCi::Application.configure do
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5
+ #
+ config.eager_load = true
+
+ config.assets.js_compressor = :uglifier
end
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 13bffaa..4ba8e77 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -11,9 +11,6 @@ GitlabCi::Application.configure do
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
- # Log error messages when you accidentally call methods on nil
- config.whiny_nils = true
-
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
@@ -34,4 +31,6 @@ GitlabCi::Application.configure do
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
+
+ config.eager_load = false
end
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index ab97627..a7aa77b 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -1,6 +1,28 @@
class Settings < Settingslogic
source "#{Rails.root}/config/application.yml"
namespace Rails.env
+
+ class << self
+ def gitlab_ci_on_non_standard_port?
+ ![443, 80].include?(gitlab_ci.port.to_i)
+ end
+
+ private
+
+ def build_gitlab_ci_url
+ if gitlab_ci_on_non_standard_port?
+ custom_port = ":#{gitlab_ci.port}"
+ else
+ custom_port = nil
+ end
+ [ gitlab_ci.protocol,
+ "://",
+ gitlab_ci.host,
+ custom_port,
+ gitlab_ci.relative_url_root
+ ].join('')
+ end
+ end
end
@@ -8,7 +30,17 @@ end
# GitlabCi
#
Settings['gitlab_ci'] ||= Settingslogic.new({})
-Settings.gitlab_ci['https'] = false if Settings.gitlab_ci['https'].nil?
+Settings.gitlab_ci['https'] = false if Settings.gitlab_ci['https'].nil?
+Settings.gitlab_ci['host'] ||= 'localhost'
+Settings.gitlab_ci['port'] ||= Settings.gitlab_ci.https ? 443 : 80
+Settings.gitlab_ci['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
+Settings.gitlab_ci['protocol'] ||= Settings.gitlab_ci.https ? "https" : "http"
+Settings.gitlab_ci['email_from'] ||= "gitlab-ci@#{Settings.gitlab_ci.host}"
+Settings.gitlab_ci['support_email'] ||= Settings.gitlab_ci.email_from
+Settings.gitlab_ci['all_broken_builds'] = true if Settings.gitlab_ci['all_broken_builds'].nil?
+Settings.gitlab_ci['add_committer'] = true if Settings.gitlab_ci['add_committer'].nil?
+Settings.gitlab_ci['url'] ||= Settings.send(:build_gitlab_ci_url)
+
#
# Gravatar
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
index aaf65b5..ccbda95 100644
--- a/config/initializers/secret_token.rb
+++ b/config/initializers/secret_token.rb
@@ -5,3 +5,4 @@
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
GitlabCi::Application.config.secret_token = '41cff934d5a788409310b2b4dc931ca9be9c5113ede94f41d44bf71b403f007d8031efa855d6d111393d33ca839722db98445a1a6f020331a3f43bd29a50c93e'
+GitlabCi::Application.config.secret_key_token = '41cff934d5a788409310b2b4dc931ca9be9c5113ede94f41d44bf71b403f007d8031efa855d6d111393d33ca839722db98445a1a6f020331a3f43bd29a50c93e'
diff --git a/config/initializers/smtp_settings.rb.sample b/config/initializers/smtp_settings.rb.sample
new file mode 100644
index 0000000..45b5a5c
--- /dev/null
+++ b/config/initializers/smtp_settings.rb.sample
@@ -0,0 +1,18 @@
+# To enable smtp email delivery for your GitLab instance do next:
+# 1. Rename this file to smtp_settings.rb
+# 2. Edit settings inside this file
+# 3. Restart GitLab instance
+#
+if Rails.env.production?
+ ActionMailer::Base.delivery_method = :smtp
+
+ ActionMailer::Base.smtp_settings = {
+ address: "email.server.com",
+ port: 456,
+ user_name: "smtp",
+ password: "123456",
+ domain: "gitlab.company.com",
+ authentication: :login,
+ enable_starttls_auto: true
+ }
+end
diff --git a/config/routes.rb b/config/routes.rb
index b3eb883..62eb42e 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -14,7 +14,7 @@ GitlabCi::Application.routes.draw do
end
member do
- get :status
+ get :status, to: 'projects#badge'
get :integration
post :build
end
diff --git a/config/schedule.rb b/config/schedule.rb
index cf2358e..1741299 100644
--- a/config/schedule.rb
+++ b/config/schedule.rb
@@ -1,5 +1,5 @@
# Use this file to easily define all of your cron jobs.
#
every 1.hour do
- runner "Scheduler.new.perform"
+ rake "schedule_builds"
end