2012-07-02 20:51:48 +02:00
|
|
|
class Settings < Settingslogic
|
|
|
|
source "#{Rails.root}/config/gitlab.yml"
|
|
|
|
|
|
|
|
class << self
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def web_protocol
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.web_protocol is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitlab.protocol
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:51:48 +02:00
|
|
|
self.web['protocol'] ||= web.https ? "https" : "http"
|
2012-07-02 20:51:48 +02:00
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-08-03 17:27:39 +02:00
|
|
|
def web_host
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.web_host is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitlab.host
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:51:48 +02:00
|
|
|
self.web['host'] ||= 'localhost'
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def email_from
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.email_from is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitlab.email_from
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-01 12:11:17 +02:00
|
|
|
self.email['from'] ||= ("notify@" + web_host)
|
2012-07-02 20:51:48 +02:00
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-08-03 17:27:39 +02:00
|
|
|
def url
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.url is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitlab.url
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:51:48 +02:00
|
|
|
self['url'] ||= build_url
|
2012-08-03 17:27:39 +02:00
|
|
|
end
|
2012-07-02 20:51:48 +02:00
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-08-03 17:27:39 +02:00
|
|
|
def web_port
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.web_port is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitlab.port.to_i
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-03 17:34:47 +02:00
|
|
|
if web.https
|
2012-07-03 17:52:48 +02:00
|
|
|
web['port'] = 443
|
2012-07-03 17:34:47 +02:00
|
|
|
else
|
|
|
|
web['port'] ||= 80
|
2012-07-03 17:52:48 +02:00
|
|
|
end.to_i
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-03 17:52:48 +02:00
|
|
|
def web_custom_port?
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.web_custom_port? is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitlab_on_non_standard_port?
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-03 17:52:48 +02:00
|
|
|
![443, 80].include?(web_port)
|
2012-07-02 20:51:48 +02:00
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def build_url
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.build_url is deprecated and will be removed from GitLab 4.1", caller)
|
2012-07-03 17:52:48 +02:00
|
|
|
if web_custom_port?
|
2012-10-02 09:54:33 +02:00
|
|
|
custom_port = ":#{web_port}"
|
|
|
|
else
|
|
|
|
custom_port = nil
|
2012-07-03 17:52:48 +02:00
|
|
|
end
|
2012-10-02 09:54:33 +02:00
|
|
|
[
|
|
|
|
web_protocol,
|
|
|
|
"://",
|
|
|
|
web_host,
|
|
|
|
custom_port
|
|
|
|
].join('')
|
2012-07-02 20:51:48 +02:00
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def ssh_port
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.ssh_port is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitolite.ssh_port
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:51:48 +02:00
|
|
|
git_host['port'] || 22
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def ssh_user
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.ssh_user is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitolite.ssh_user
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:51:48 +02:00
|
|
|
git_host['git_user'] || 'git'
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def ssh_host
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.ssh_host is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitolite.ssh_host
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:59:48 +02:00
|
|
|
git_host['host'] || web_host || 'localhost'
|
2012-07-02 20:51:48 +02:00
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def ssh_path
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.ssh_path is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitolite.ssh_path_prefix
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:51:48 +02:00
|
|
|
if ssh_port != 22
|
|
|
|
"ssh://#{ssh_user}@#{ssh_host}:#{ssh_port}/"
|
|
|
|
else
|
|
|
|
"#{ssh_user}@#{ssh_host}:"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def git_base_path
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.git_base_path is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitolite.repos_path
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:51:48 +02:00
|
|
|
git_host['base_path'] || '/home/git/repositories/'
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-08-28 10:57:23 +02:00
|
|
|
def git_hooks_path
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.git_hooks_path is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitolite.hooks_path
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-08-28 10:57:23 +02:00
|
|
|
git_host['hooks_path'] || '/home/git/share/gitolite/hooks/'
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def git_upload_pack
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.git_upload_pack is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitolite.upload_pack
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-01 12:11:17 +02:00
|
|
|
if git_host['upload_pack'] != false
|
2012-07-02 20:59:48 +02:00
|
|
|
true
|
2012-07-01 12:11:17 +02:00
|
|
|
else
|
|
|
|
false
|
2012-07-02 20:59:48 +02:00
|
|
|
end
|
2012-07-02 20:51:48 +02:00
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def git_receive_pack
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.git_receive_pack is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitolite.receive_pack
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-01 12:11:17 +02:00
|
|
|
if git_host['receive_pack'] != false
|
2012-07-02 20:59:48 +02:00
|
|
|
true
|
2012-07-01 12:11:17 +02:00
|
|
|
else
|
|
|
|
false
|
2012-07-02 20:59:48 +02:00
|
|
|
end
|
2012-07-02 20:51:48 +02:00
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def git_bin_path
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.git_bin_path is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
git.bin_path
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:51:48 +02:00
|
|
|
git['path'] || '/usr/bin/git'
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def git_max_size
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.git_max_size is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
git.max_size
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:51:48 +02:00
|
|
|
git['git_max_size'] || 5242880 # 5.megabytes
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def git_timeout
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.git_timeout is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
git.timeout
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:51:48 +02:00
|
|
|
git['git_timeout'] || 10
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:51:48 +02:00
|
|
|
def gitolite_admin_uri
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.gitolite_admin_uri is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitolite.admin_uri
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-11 16:36:00 +02:00
|
|
|
git_host['admin_uri'] || 'git@localhost:gitolite-admin'
|
2012-07-02 20:51:48 +02:00
|
|
|
end
|
2012-07-02 20:59:48 +02:00
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-11-06 23:47:33 +01:00
|
|
|
def gitolite_config_file
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.gitolite_config_file is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitolite.config_file
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-11-06 23:47:33 +01:00
|
|
|
git_host['config_file'] || 'gitolite.conf'
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-08-29 01:08:39 +02:00
|
|
|
def gitolite_admin_key
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.gitolite_admin_key is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitolite.admin_key
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-08-29 01:08:39 +02:00
|
|
|
git_host['gitolite_admin_key'] || 'gitlab'
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-02 20:59:48 +02:00
|
|
|
def default_projects_limit
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.default_projects_limit is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gitlab.default_projects_limit
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-02 20:59:48 +02:00
|
|
|
app['default_projects_limit'] || 10
|
|
|
|
end
|
2012-07-10 16:12:19 +02:00
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-10 16:12:19 +02:00
|
|
|
def backup_path
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.backup_path is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
backup.path
|
|
|
|
rescue Settingslogic::MissingSetting
|
|
|
|
File.expand_path(app['backup_path'] || "backups/", Rails.root)
|
2012-07-10 16:12:19 +02:00
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-07-10 16:12:19 +02:00
|
|
|
def backup_keep_time
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.backup_keep_time is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
backup.keep_time
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-07-10 16:12:19 +02:00
|
|
|
app['backup_keep_time'] || 0
|
|
|
|
end
|
2012-08-16 03:06:08 +02:00
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-09-12 06:48:22 +02:00
|
|
|
def ldap_enabled?
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.ldap_enabled? is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
ldap.enabled
|
2012-09-13 00:11:59 +02:00
|
|
|
rescue Settingslogic::MissingSetting
|
2012-09-12 06:48:22 +02:00
|
|
|
false
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-08-03 17:27:39 +02:00
|
|
|
def omniauth_enabled?
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.omniauth_enabled? is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
omniauth.enabled
|
2012-09-13 00:11:59 +02:00
|
|
|
rescue Settingslogic::MissingSetting
|
2012-09-12 06:48:22 +02:00
|
|
|
false
|
2012-08-03 17:27:39 +02:00
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-08-03 17:27:39 +02:00
|
|
|
def omniauth_providers
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.omniauth_providers is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
omniauth.providers
|
|
|
|
rescue Settingslogic::MissingSetting
|
|
|
|
[]
|
2012-08-03 17:27:39 +02:00
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-08-16 03:06:08 +02:00
|
|
|
def disable_gravatar?
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.disable_gravatar? is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
!gravatar.enabled
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-08-16 03:06:08 +02:00
|
|
|
app['disable_gravatar'] || false
|
|
|
|
end
|
2012-12-06 21:44:22 +01:00
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-12-06 21:44:22 +01:00
|
|
|
def gravatar_url
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.gravatar_url is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gravatar.plain_url
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-12-06 21:44:22 +01:00
|
|
|
app['gravatar_url'] || 'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm'
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
# FIXME: Deprecated: remove for 4.1
|
2012-12-06 21:44:22 +01:00
|
|
|
def gravatar_ssl_url
|
2012-12-20 16:52:29 +01:00
|
|
|
ActiveSupport::Deprecation.warn("Settings.gravatar_ssl_url is deprecated and will be removed from GitLab 4.1", caller)
|
|
|
|
gravatar.ssl_url
|
|
|
|
rescue Settingslogic::MissingSetting
|
2012-12-06 21:44:22 +01:00
|
|
|
app['gravatar_ssl_url'] || 'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm'
|
|
|
|
end
|
|
|
|
|
2012-12-20 16:52:29 +01:00
|
|
|
|
|
|
|
|
|
|
|
def gitlab_on_non_standard_port?
|
|
|
|
![443, 80].include?(gitlab.port.to_i)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def build_gitolite_ssh_path_prefix
|
|
|
|
if gitolite.ssh_port != 22
|
|
|
|
"ssh://#{gitolite.ssh_user}@#{gitolite.ssh_host}:#{gitolite.ssh_port}/"
|
|
|
|
else
|
|
|
|
"#{gitolite.ssh_user}@#{gitolite.ssh_host}:"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def build_gitlab_url
|
|
|
|
if gitlab_on_non_standard_port?
|
|
|
|
custom_port = ":#{gitlab.port}"
|
|
|
|
else
|
|
|
|
custom_port = nil
|
|
|
|
end
|
|
|
|
[ gitlab.protocol,
|
|
|
|
"://",
|
|
|
|
gitlab.host,
|
|
|
|
custom_port
|
|
|
|
].join('')
|
|
|
|
end
|
2012-07-02 20:51:48 +02:00
|
|
|
end
|
|
|
|
end
|
2012-12-20 16:52:29 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Default settings
|
|
|
|
|
|
|
|
# FIXME: Deprecated: remove for 4.1
|
|
|
|
# all Settings.web ...
|
|
|
|
# all Settings.app ...
|
|
|
|
# all Settings.email ...
|
|
|
|
# all Settings.git_host ...
|
|
|
|
Settings['pre_40_config'] ||= Settings['web'].present?
|
|
|
|
|
|
|
|
Settings['ldap'] ||= Settingslogic.new({})
|
|
|
|
Settings.ldap['enabled'] ||= false
|
|
|
|
|
|
|
|
Settings['omniauth'] ||= Settingslogic.new({})
|
|
|
|
Settings.omniauth['enabled'] ||= false
|
|
|
|
Settings.omniauth['providers'] ||= []
|
|
|
|
|
|
|
|
Settings['gitlab'] ||= Settingslogic.new({})
|
|
|
|
Settings.gitlab['default_projects_limit'] ||= Settings.pre_40_config ? Settings.default_projects_limit : 10
|
|
|
|
Settings.gitlab['host'] ||= Settings.pre_40_config ? Settings.web_host : 'localhost'
|
|
|
|
Settings.gitlab['https'] ||= Settings.pre_40_config ? Settings.web.https : false
|
|
|
|
Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80
|
|
|
|
Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http"
|
|
|
|
Settings.gitlab['email_from'] ||= Settings.pre_40_config ? Settings.email_from : "gitlab@#{Settings.gitlab.host}"
|
|
|
|
Settings.gitlab['url'] ||= Settings.pre_40_config ? Settings.url : Settings.send(:build_gitlab_url)
|
|
|
|
|
|
|
|
Settings['gravatar'] ||= Settingslogic.new({})
|
|
|
|
Settings.gravatar['enabled'] ||= Settings.pre_40_config ? !Settings.disable_gravatar? : true
|
|
|
|
Settings.gravatar['plain_url'] ||= Settings.pre_40_config ? Settings.gravatar_url : 'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm'
|
|
|
|
Settings.gravatar['ssl_url'] ||= Settings.pre_40_config ? Settings.gravatar_ssl_url : 'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm'
|
|
|
|
|
|
|
|
Settings['gitolite'] ||= Settingslogic.new({})
|
|
|
|
Settings.gitolite['admin_key'] ||= Settings.pre_40_config ? Settings.gitolite_admin_key : 'gitlab'
|
|
|
|
Settings.gitolite['admin_uri'] ||= Settings.pre_40_config ? Settings.gitolite_admin_uri : 'git@localhost:gitolite-admin'
|
|
|
|
Settings.gitolite['config_file'] ||= Settings.pre_40_config ? Settings.gitolite_config_file : 'gitolite.conf'
|
|
|
|
Settings.gitolite['hooks_path'] ||= Settings.pre_40_config ? Settings.git_hooks_path : '/home/git/share/gitolite/hooks/'
|
|
|
|
Settings.gitolite['receive_pack'] ||= Settings.pre_40_config ? Settings.git_receive_pack : (Settings.gitolite['receive_pack'] != false)
|
|
|
|
Settings.gitolite['repos_path'] ||= Settings.pre_40_config ? Settings.git_base_path : '/home/git/repositories/'
|
|
|
|
Settings.gitolite['upload_pack'] ||= Settings.pre_40_config ? Settings.git_upload_pack : (Settings.gitolite['upload_pack'] != false)
|
|
|
|
Settings.gitolite['ssh_host'] ||= Settings.pre_40_config ? Settings.ssh_host : (Settings.gitlab.host || 'localhost')
|
|
|
|
Settings.gitolite['ssh_port'] ||= Settings.pre_40_config ? Settings.ssh_port : 22
|
|
|
|
Settings.gitolite['ssh_user'] ||= Settings.pre_40_config ? Settings.ssh_user : 'git'
|
|
|
|
Settings.gitolite['ssh_path_prefix'] ||= Settings.pre_40_config ? Settings.ssh_path : Settings.send(:build_gitolite_ssh_path_prefix)
|
|
|
|
|
|
|
|
Settings['backup'] ||= Settingslogic.new({})
|
|
|
|
Settings.backup['keep_time'] ||= Settings.pre_40_config ? Settings.backup_keep_time : 0
|
|
|
|
Settings.backup['path'] = Settings.pre_40_config ? Settings.backup_path : File.expand_path(Settings.backup['path'] || "tmp/backups/", Rails.root)
|
|
|
|
|
|
|
|
Settings['git'] ||= Settingslogic.new({})
|
|
|
|
Settings.git['max_size'] ||= Settings.pre_40_config ? Settings.git_max_size : 5242880 # 5.megabytes
|
|
|
|
Settings.git['bin_path'] ||= Settings.pre_40_config ? Settings.git_bin_path : '/usr/bin/git'
|
|
|
|
Settings.git['timeout'] ||= Settings.pre_40_config ? Settings.git_timeout : 10
|
|
|
|
Settings.git['path'] ||= Settings.git.bin_path # FIXME: Deprecated: remove for 4.1
|