Update uses of Gitolite.config.foo settings
This commit is contained in:
parent
b2e46f44ce
commit
19eb637419
33 changed files with 95 additions and 95 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- if Gitlab.config.omniauth_enabled?
|
||||
- if Gitlab.config.omniauth.enabled
|
||||
%fieldset
|
||||
%legend Social Accounts
|
||||
.oauth_select_holder
|
||||
|
|
|
@ -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}!
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue