Skip to content
Snippets Groups Projects
Commit 19eb6374 authored by Riyad Preukschas's avatar Riyad Preukschas
Browse files

Update uses of Gitolite.config.foo settings

parent b2e46f44
No related branches found
No related tags found
1 merge request!2247Reorganize settings
Showing
with 36 additions and 36 deletions
Loading
Loading
@@ -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
Loading
Loading
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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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
 
 
 
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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}
- if Gitlab.config.omniauth_enabled?
- if Gitlab.config.omniauth.enabled
%fieldset
%legend Social Accounts
.oauth_select_holder
Loading
Loading
Loading
Loading
@@ -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}!
Loading
Loading
.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"
Loading
Loading
@@ -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!(/^\//, "")
 
Loading
Loading
@@ -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
Loading
require 'grit'
require 'pygments'
 
Grit::Git.git_timeout = Gitlab.config.git_timeout
Grit::Git.git_max_size = Gitlab.config.git_max_size
Grit::Git.git_timeout = Gitlab.config.git.timeout
Grit::Git.git_max_size = Gitlab.config.git.max_size
 
Grit::Blob.class_eval do
include Linguist::BlobHelper
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@ Devise.setup do |config|
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
config.mailer_sender = Gitlab.config.email_from
config.mailer_sender = Gitlab.config.gitlab.email_from
 
# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"
Loading
Loading
Loading
Loading
@@ -14,10 +14,10 @@ Gitlab::Application.routes.draw do
 
# Enable Grack support
mount Grack::Bundle.new({
git_path: Gitlab.config.git_bin_path,
project_root: Gitlab.config.git_base_path,
upload_pack: Gitlab.config.git_upload_pack,
receive_pack: Gitlab.config.git_receive_pack
git_path: Gitlab.config.git.bin_path,
project_root: Gitlab.config.gitolite.repos_path,
upload_pack: Gitlab.config.gitolite.upload_pack,
receive_pack: Gitlab.config.gitolite.receive_pack
}), at: '/:path', constraints: { path: /[-\/\w\.-]+\.git/ }
 
#
Loading
Loading
Loading
Loading
@@ -33,9 +33,9 @@ DatabaseCleaner.strategy = :truncation
 
Spinach.hooks.before_scenario do
# Use tmp dir for FS manipulations
Gitlab.config.stub(git_base_path: Rails.root.join('tmp', 'test-git-base-path'))
FileUtils.rm_rf Gitlab.config.git_base_path
FileUtils.mkdir_p Gitlab.config.git_base_path
Gitlab.config.gitolite.stub(repos_path: Rails.root.join('tmp', 'test-git-base-path'))
FileUtils.rm_rf Gitlab.config.gitolite.repos_path
FileUtils.mkdir_p Gitlab.config.gitolite.repos_path
end
 
Spinach.hooks.after_scenario do
Loading
Loading
Loading
Loading
@@ -38,7 +38,7 @@ module Gitlab
email: email,
password: password,
password_confirmation: password,
projects_limit: Gitlab.config.default_projects_limit,
projects_limit: Gitlab.config.gitlab.default_projects_limit,
}, as: :admin)
if Gitlab.config.omniauth['block_auto_created_users'] && !ldap
@user.blocked = true
Loading
Loading
Loading
Loading
@@ -38,7 +38,7 @@ module Gitlab
end
 
def url_to_repo path
Gitlab.config.ssh_path + "#{path}.git"
Gitlab.config.gitolite.ssh_path_prefix + "#{path}.git"
end
 
def enable_automerge
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment