1 class Settings < Settingslogic
2 source "#{Rails.root}/config/gitlab.yml"
6 def gitlab_on_non_standard_port?
7 ![443, 80].include?(gitlab.port.to_i)
12 def build_gitlab_shell_ssh_path_prefix
13 if gitlab_shell.ssh_port != 22
14 "ssh://#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}:#{gitlab_shell.ssh_port}/"
16 "#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}:"
21 if gitlab_on_non_standard_port?
22 custom_port = ":#{gitlab.port}"
30 gitlab.relative_url_root
38 Settings['ldap'] ||= Settingslogic.new({})
39 Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil?
41 Settings['omniauth'] ||= Settingslogic.new({})
42 Settings.omniauth['enabled'] = false if Settings.omniauth['enabled'].nil?
43 Settings.omniauth['providers'] ||= []
45 Settings['issues_tracker'] ||= {}
50 Settings['gitlab'] ||= Settingslogic.new({})
51 Settings.gitlab['default_projects_limit'] ||= 10
52 Settings.gitlab['host'] ||= 'localhost'
53 Settings.gitlab['https'] = false if Settings.gitlab['https'].nil?
54 Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80
55 Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
56 Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http"
57 Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
58 Settings.gitlab['support_email'] ||= Settings.gitlab.email_from
59 Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
60 Settings.gitlab['user'] ||= 'git'
61 Settings.gitlab['signup_enabled'] ||= false
62 Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
67 Settings['gravatar'] ||= Settingslogic.new({})
68 Settings.gravatar['enabled'] = true if Settings.gravatar['enabled'].nil?
69 Settings.gravatar['plain_url'] ||= 'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm'
70 Settings.gravatar['ssl_url'] ||= 'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm'
75 Settings['gitlab_shell'] ||= Settingslogic.new({})
76 Settings.gitlab_shell['hooks_path'] ||= '/home/git/gitlab-shell/hooks/'
77 Settings.gitlab_shell['receive_pack'] = true if Settings.gitlab_shell['receive_pack'].nil?
78 Settings.gitlab_shell['upload_pack'] = true if Settings.gitlab_shell['upload_pack'].nil?
79 Settings.gitlab_shell['repos_path'] ||= '/home/git/repositories/'
80 Settings.gitlab_shell['ssh_host'] ||= (Settings.gitlab.host || 'localhost')
81 Settings.gitlab_shell['ssh_port'] ||= 22
82 Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user
83 Settings.gitlab_shell['owner_group'] ||= Settings.gitlab.user
84 Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.send(:build_gitlab_shell_ssh_path_prefix)
89 Settings['backup'] ||= Settingslogic.new({})
90 Settings.backup['keep_time'] ||= 0
91 Settings.backup['path'] = File.expand_path(Settings.backup['path'] || "tmp/backups/", Rails.root)
96 Settings['git'] ||= Settingslogic.new({})
97 Settings.git['max_size'] ||= 5242880 # 5.megabytes
98 Settings.git['bin_path'] ||= '/usr/bin/git'
99 Settings.git['timeout'] ||= 10
101 Settings['satellites'] ||= Settingslogic.new({})
102 Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root)