diff options
author | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-12-15 01:16:25 +0100 |
---|---|---|
committer | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-12-20 16:54:28 +0100 |
commit | 19eb63741995e3be60781db74edab5d5ae896c6b (patch) | |
tree | 349c2f0d63b4bf89500de1c8c3ee5887dc981e68 /app | |
parent | b2e46f44ceee2078b8e1d92ae5ff892c044bc0e7 (diff) | |
download | gitlab-ce-19eb63741995e3be60781db74edab5d5ae896c6b.tar.gz |
Update uses of Gitolite.config.foo settings
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin/users_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/omniauth_callbacks_controller.rb | 2 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 4 | ||||
-rw-r--r-- | app/mailers/notify.rb | 8 | ||||
-rw-r--r-- | app/models/namespace.rb | 8 | ||||
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/roles/push_observer.rb | 2 | ||||
-rw-r--r-- | app/roles/repository.rb | 4 | ||||
-rw-r--r-- | app/views/admin/groups/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/errors/gitolite.html.haml | 4 | ||||
-rw-r--r-- | app/views/profiles/account.html.haml | 2 | ||||
-rw-r--r-- | app/views/profiles/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/_clone_panel.html.haml | 2 | ||||
-rw-r--r-- | app/workers/post_receive.rb | 4 |
14 files changed, 24 insertions, 24 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 5614aaa2a67..5f259bd7e27 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -30,7 +30,7 @@ class Admin::UsersController < AdminController def new - @admin_user = User.new({ projects_limit: Gitlab.config.default_projects_limit }, as: :admin) + @admin_user = User.new({ projects_limit: Gitlab.config.gitlab.default_projects_limit }, as: :admin) end def edit diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 2fb783b289b..c4ebf0e4889 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -1,5 +1,5 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController - Gitlab.config.omniauth_providers.each do |provider| + Gitlab.config.omniauth.providers.each do |provider| define_method provider['name'] do handle_omniauth end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 571c0cb71b6..c9e939801c2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -37,7 +37,7 @@ module ApplicationHelper if Gitlab.config.disable_gravatar? || user_email.blank? 'no_avatar.png' else - gravatar_url = request.ssl? ? Gitlab.config.gravatar_ssl_url : Gitlab.config.gravatar_url + gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url user_email.strip! sprintf(gravatar_url, {:hash => Digest::MD5.hexdigest(user_email.downcase), :email => URI.escape(user_email), :size => size}) end @@ -48,7 +48,7 @@ module ApplicationHelper end def web_app_url - "#{request_protocol}://#{Gitlab.config.web_host}/" + "#{request_protocol}://#{Gitlab.config.gitlab.host}/" end def last_commit(project) diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 29cebadaf94..f954a05c883 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -3,11 +3,11 @@ class Notify < ActionMailer::Base add_template_helper ApplicationHelper add_template_helper GitlabMarkdownHelper - default_url_options[:host] = Gitlab.config.web_host - default_url_options[:protocol] = Gitlab.config.web_protocol - default_url_options[:port] = Gitlab.config.web_port if Gitlab.config.web_custom_port? + default_url_options[:host] = Gitlab.config.gitlab.host + default_url_options[:protocol] = Gitlab.config.gitlab.protocol + default_url_options[:port] = Gitlab.config.gitlab.port if Gitlab.config.gitlab_on_non_standard_port? - default from: Gitlab.config.email_from + default from: Gitlab.config.gitlab.email_from diff --git a/app/models/namespace.rb b/app/models/namespace.rb index e1c24de949a..3c087e26c19 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -48,14 +48,14 @@ class Namespace < ActiveRecord::Base end def ensure_dir_exist - namespace_dir_path = File.join(Gitlab.config.git_base_path, path) + namespace_dir_path = File.join(Gitlab.config.gitolite.repos_path, path) system("mkdir -m 770 #{namespace_dir_path}") unless File.exists?(namespace_dir_path) end def move_dir if path_changed? - old_path = File.join(Gitlab.config.git_base_path, path_was) - new_path = File.join(Gitlab.config.git_base_path, path) + old_path = File.join(Gitlab.config.gitolite.repos_path, path_was) + new_path = File.join(Gitlab.config.gitolite.repos_path, path) if File.exists?(new_path) raise "Already exists" end @@ -64,7 +64,7 @@ class Namespace < ActiveRecord::Base end def rm_dir - dir_path = File.join(Gitlab.config.git_base_path, path) + dir_path = File.join(Gitlab.config.gitolite.repos_path, path) system("rm -rf #{dir_path}") end end diff --git a/app/models/project.rb b/app/models/project.rb index eb6e7cb1b08..6a427fddfac 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -195,7 +195,7 @@ class Project < ActiveRecord::Base end def web_url - [Gitlab.config.url, path_with_namespace].join("/") + [Gitlab.config.gitlab.url, path_with_namespace].join("/") end def common_notes diff --git a/app/roles/push_observer.rb b/app/roles/push_observer.rb index 0b3d57f48a7..dda18267207 100644 --- a/app/roles/push_observer.rb +++ b/app/roles/push_observer.rb @@ -114,7 +114,7 @@ module PushObserver id: commit.id, message: commit.safe_message, timestamp: commit.date.xmlschema, - url: "#{Gitlab.config.url}/#{path_with_namespace}/commit/#{commit.id}", + url: "#{Gitlab.config.gitlab.url}/#{path_with_namespace}/commit/#{commit.id}", author: { name: commit.author_name, email: commit.author_email diff --git a/app/roles/repository.rb b/app/roles/repository.rb index 4e80d50cc72..78190ca96d0 100644 --- a/app/roles/repository.rb +++ b/app/roles/repository.rb @@ -97,7 +97,7 @@ module Repository end def path_to_repo - File.join(Gitlab.config.git_base_path, "#{path_with_namespace}.git") + File.join(Gitlab.config.gitolite.repos_path, "#{path_with_namespace}.git") end def namespace_dir @@ -199,7 +199,7 @@ module Repository end def http_url_to_repo - http_url = [Gitlab.config.url, "/", path_with_namespace, ".git"].join('') + http_url = [Gitlab.config.gitlab.url, "/", path_with_namespace, ".git"].join('') end # Check if current branch name is marked as protected in the system diff --git a/app/views/admin/groups/show.html.haml b/app/views/admin/groups/show.html.haml index 1b02475fa80..41f6d9b3516 100644 --- a/app/views/admin/groups/show.html.haml +++ b/app/views/admin/groups/show.html.haml @@ -22,7 +22,7 @@ %b Path: %td - %span.monospace= File.join(Gitlab.config.git_base_path, @group.path) + %span.monospace= File.join(Gitlab.config.gitolite.repos_path, @group.path) %tr %td %b diff --git a/app/views/errors/gitolite.html.haml b/app/views/errors/gitolite.html.haml index 6eec95836d6..590bca71dd4 100644 --- a/app/views/errors/gitolite.html.haml +++ b/app/views/errors/gitolite.html.haml @@ -21,5 +21,5 @@ Permissions: %pre = preserve do - sudo chown -R git:git #{Gitlab.config.git_base_path} - sudo chmod -R ug+rwXs #{Gitlab.config.git_base_path} + sudo chown -R git:git #{Gitlab.config.gitolite.repos_path} + sudo chmod -R ug+rwXs #{Gitlab.config.gitolite.repos_path} diff --git a/app/views/profiles/account.html.haml b/app/views/profiles/account.html.haml index 1c51f48f401..3b5099edbdb 100644 --- a/app/views/profiles/account.html.haml +++ b/app/views/profiles/account.html.haml @@ -1,4 +1,4 @@ -- if Gitlab.config.omniauth_enabled? +- if Gitlab.config.omniauth.enabled %fieldset %legend Social Accounts .oauth_select_holder diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index ac36fa3aa55..177119f093a 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -37,7 +37,7 @@ %li %p You can change your avatar at #{link_to "gravatar.com", "http://gravatar.com"} - - if Gitlab.config.omniauth_enabled? && @user.provider? + - if Gitlab.config.omniauth.enabled && @user.provider? %li %p You can login through #{@user.provider.titleize}! diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml index f632e1221f9..e283d9b3085 100644 --- a/app/views/shared/_clone_panel.html.haml +++ b/app/views/shared/_clone_panel.html.haml @@ -1,4 +1,4 @@ .input-prepend.project_clone_holder %button{class: "btn active", :"data-clone" => @project.ssh_url_to_repo} SSH - %button{class: "btn", :"data-clone" => @project.http_url_to_repo}= Gitlab.config.web_protocol.upcase + %button{class: "btn", :"data-clone" => @project.http_url_to_repo}= Gitlab.config.gitlab.protocol.upcase = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select input-xxlarge" diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb index 11281b8b656..1414ed490c9 100644 --- a/app/workers/post_receive.rb +++ b/app/workers/post_receive.rb @@ -2,7 +2,7 @@ class PostReceive @queue = :post_receive def self.perform(repo_path, oldrev, newrev, ref, identifier) - repo_path.gsub!(Gitlab.config.git_base_path.to_s, "") + repo_path.gsub!(Gitlab.config.gitolite.repos_path.to_s, "") repo_path.gsub!(/.git$/, "") repo_path.gsub!(/^\//, "") @@ -10,7 +10,7 @@ class PostReceive return false if project.nil? # Ignore push from non-gitlab users - user = if identifier.eql? Gitlab.config.gitolite_admin_key + user = if identifier.eql? Gitlab.config.gitolite.admin_key email = project.commit(newrev).author.email rescue nil User.find_by_email(email) if email elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier) |