Commit 1e092b25 authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'fix-foodcritic' into 'master'

Fix foodcritic

This MR fixes all foodcritic issues and removes some unused attributes at the same time. More specifically,

 * `support_email` - The support email is not used anymore in gitlab.
 * `standard_signin_enabled` - The sign enabled feature is already covered by the `signin_enabled` attribute.

See merge request !109
parents 7693d12f 2cfea0dd
......@@ -66,7 +66,6 @@ end
default['gitlab']['git_path'] = "/usr/local/bin/git"
default['gitlab']['host'] = "localhost"
default['gitlab']['email_from'] = "gitlab@localhost"
default['gitlab']['support_email'] = "support@localhost"
default['gitlab']['max_size'] = "20971520" # 20.megabytes
default['gitlab']['git_timeout'] = 10
......@@ -76,7 +75,6 @@ default['gitlab']['projects_limit'] = 10
default['gitlab']['user_can_create_group'] = true
default['gitlab']['user_can_change_username'] = true
default['gitlab']['default_theme'] = 2
default['gitlab']['standard_signin_enabled'] = true
default['gitlab']['repository_downloads_path'] = "tmp/repositories"
default['gitlab']['oauth_enabled'] = false
default['gitlab']['oauth_block_auto_created_users'] = true
......
......@@ -6,14 +6,14 @@
gitlab = node['gitlab']
if gitlab['env'] == 'production'
cron 'gitlab_backups' do
action node['gitlab']['backup']['cron']['action']
minute node['gitlab']['backup']['cron']['minute']
hour node['gitlab']['backup']['cron']['hour']
user node['gitlab']['user']
mailto node['gitlab']['backup']['cron']['mailto']
path node['gitlab']['backup']['cron']['path']
command "cd #{gitlab['home']}/gitlab && bundle exec rake gitlab:backup:create RAILS_ENV=#{gitlab['env']}"
end
cron 'gitlab_backups' do
action node['gitlab']['backup']['cron']['action']
minute node['gitlab']['backup']['cron']['minute']
hour node['gitlab']['backup']['cron']['hour']
user node['gitlab']['user']
mailto node['gitlab']['backup']['cron']['mailto']
path node['gitlab']['backup']['cron']['path']
command "cd #{gitlab['home']}/gitlab && bundle exec rake gitlab:backup:create RAILS_ENV=#{gitlab['env']}"
only_if { gitlab['env'] == 'production' }
end
......@@ -19,8 +19,7 @@ template File.join(gitlab['shell_path'], "config.yml") do
:redis_host => gitlab['redis_host'],
:redis_port => gitlab['redis_port'],
:namespace => gitlab['namespace'],
:self_signed_cert => gitlab['self_signed_cert'],
:max_size => gitlab['max_size']
:self_signed_cert => gitlab['self_signed_cert']
})
end
......
......@@ -15,7 +15,6 @@ template File.join(gitlab['path'], 'config', 'gitlab.yml') do
:port => gitlab['port'],
:user => gitlab['user'],
:email_from => gitlab['email_from'],
:support_email => gitlab['support_email'],
:max_size => gitlab['max_size'],
:git_timeout => gitlab['git_timeout'],
:satellites_path => gitlab['satellites_path'],
......@@ -28,7 +27,6 @@ template File.join(gitlab['path'], 'config', 'gitlab.yml') do
:user_can_create_group => gitlab['user_can_create_group'],
:user_can_change_username => gitlab['user_can_change_username'],
:default_theme => gitlab['default_theme'],
:standard_signin_enabled => gitlab['standard_signin_enabled'],
:repository_downloads_path => gitlab['repository_downloads_path'],
:oauth_enabled => gitlab['oauth_enabled'],
:oauth_block_auto_created_users => gitlab['oauth_block_auto_created_users'],
......@@ -51,12 +49,14 @@ end
### Make sure GitLab can write to the log/ and tmp/ directories
### Create directories for sockets/pids
### Create public/uploads directory otherwise backup will fail
%w{log tmp tmp/pids tmp/sockets public/uploads}.each do |path|
directory File.join(gitlab['path'], path) do
%w{log tmp tmp/pids tmp/sockets public/uploads}.each do |folder|
path = File.join(gitlab['path'], folder)
directory path do
owner gitlab['user']
group gitlab['group']
mode 0755
not_if { File.exist?(File.join(gitlab['path'], path)) }
not_if { File.exist?(path) }
end
end
......@@ -260,22 +260,22 @@ when 'production'
end
end
if gitlab['aws']['enabled']
template "aws.yml" do
owner gitlab['user']
group gitlab['group']
path "#{gitlab['path']}/config/aws.yml"
mode 0755
variables({
:aws_access_key_id => gitlab['aws']['aws_access_key_id'],
:aws_secret_access_key => gitlab['aws']['aws_secret_access_key'],
:bucket => gitlab['aws']['bucket'],
:region => gitlab['aws']['region'],
:host => gitlab['aws']['host'],
:endpoint => gitlab['aws']['endpoint']
})
notifies :reload, "service[gitlab]"
end
template "aws.yml" do
owner gitlab['user']
group gitlab['group']
path "#{gitlab['path']}/config/aws.yml"
mode 0755
variables({
:aws_access_key_id => gitlab['aws']['aws_access_key_id'],
:aws_secret_access_key => gitlab['aws']['aws_secret_access_key'],
:bucket => gitlab['aws']['bucket'],
:region => gitlab['aws']['region'],
:host => gitlab['aws']['host'],
:endpoint => gitlab['aws']['endpoint']
})
notifies :reload, "service[gitlab]"
only_if { gitlab['aws']['enabled'] }
end
execute "rake assets:clean" do
......
......@@ -48,13 +48,13 @@ monit_monitrc "unicorn" do
end
disk_usage = monitrc['disk_usage']
if disk_usage['disk_percentage'] != "0"
monit_monitrc "disk_usage" do
variables ({
disk_percentage: disk_usage['disk_percentage'],
path: disk_usage['path']
})
end
monit_monitrc "disk_usage" do
variables ({
disk_percentage: disk_usage['disk_percentage'],
path: disk_usage['path']
})
only_if { disk_usage['disk_percentage'] != "0" }
end
directory "#{gitlab['path']}/bin" do
......
......@@ -20,7 +20,6 @@ template path do
:path => gitlab['path'],
:host => gitlab['host'],
:port => gitlab['port'],
:url => gitlab['url'],
:ssl_certificate_path => gitlab['ssl_certificate_path'],
:ssl_certificate_key_path => gitlab['ssl_certificate_key_path'],
:client_max_body_size => gitlab['client_max_body_size']
......@@ -48,12 +47,12 @@ else
end
if gitlab['port'] == "443"
directory "#{gitlab['ssl_certificate_path']}" do
directory gitlab['ssl_certificate_path'] do
recursive true
mode 0755
end
directory "#{gitlab['ssl_certificate_key_path']}" do
directory gitlab['ssl_certificate_key_path'] do
recursive true
mode 0755
end
......
......@@ -27,8 +27,7 @@ user gitlab['user'] do
end
# Locking user is not needed in development
if gitlab['env'] == 'production'
user gitlab['user'] do
action :lock
end
user gitlab['user'] do
action :lock
only_if { gitlab['env'] == 'production' }
end
......@@ -3,7 +3,6 @@
"host": "example.com",
"url": "http://example.com/",
"email_from": "gitlab@example.com",
"support_email": "support@example.com",
"database_adapter": "postgresql",
"database_password": "database password used by the GitLab application",
"repository": "clone URL for e.g. GitLab Enterprise Edition; omit this line to use Community Edition",
......
......@@ -24,8 +24,7 @@ describe "gitlab::gitlab_shell_install" do
redis_host: "127.0.0.1",
redis_port: "6379",
namespace: "resque:gitlab",
self_signed_cert: false,
max_size: "20971520"
self_signed_cert: false
}
)
end
......@@ -78,8 +77,7 @@ describe "gitlab::gitlab_shell_install" do
redis_host: "127.0.0.1",
redis_port: "6379",
namespace: "resque:gitlab",
self_signed_cert: false,
max_size: "20971520"
self_signed_cert: false
}
)
end
......@@ -119,8 +117,7 @@ describe "gitlab::gitlab_shell_install" do
redis_host: "127.0.0.1",
redis_port: "6379",
namespace: "resque:gitlab",
self_signed_cert: false,
max_size: "20971520"
self_signed_cert: false
}
)
end
......@@ -173,8 +170,7 @@ describe "gitlab::gitlab_shell_install" do
redis_host: "127.0.0.1",
redis_port: "6379",
namespace: "resque:gitlab",
self_signed_cert: false,
max_size: "20971520"
self_signed_cert: false
}
)
end
......
......@@ -20,7 +20,6 @@ describe "gitlab::install" do
port: '80',
user: 'git',
email_from: 'gitlab@localhost',
support_email: 'support@localhost',
max_size: '20971520',
git_timeout: 10,
satellites_path: '/home/git/gitlab-satellites',
......@@ -33,7 +32,6 @@ describe "gitlab::install" do
user_can_create_group: true,
user_can_change_username: true,
default_theme: 2,
standard_signin_enabled: true,
repository_downloads_path: 'tmp/repositories',
oauth_enabled: false,
oauth_block_auto_created_users: true,
......@@ -456,7 +454,6 @@ describe "gitlab::install" do
port: '80',
user: 'git',
email_from: 'gitlab@localhost',
support_email: 'support@localhost',
max_size: '20971520',
git_timeout: 10,
satellites_path: '/home/git/gitlab-satellites',
......@@ -469,7 +466,6 @@ describe "gitlab::install" do
user_can_create_group: true,
user_can_change_username: true,
default_theme: 2,
standard_signin_enabled: true,
repository_downloads_path: 'tmp/repositories',
oauth_enabled: false,
oauth_block_auto_created_users: true,
......
......@@ -24,7 +24,6 @@ describe "gitlab::nginx" do
path: "/home/git/gitlab",
host: "localhost",
port: "80",
url: "http://localhost:80/",
ssl_certificate_path: "/etc/ssl",
ssl_certificate_key_path: "/etc/ssl",
client_max_body_size: "20m"
......@@ -66,7 +65,6 @@ describe "gitlab::nginx" do
path: "/data/git/gitlab",
host: "localhost",
port: "80",
url: "http://localhost:80/",
ssl_certificate_path: "/etc/ssl",
ssl_certificate_key_path: "/etc/ssl",
client_max_body_size: "20m"
......@@ -114,7 +112,6 @@ describe "gitlab::nginx" do
path: "/home/git/gitlab",
host: "localhost",
port: "80",
url: "http://localhost:80/",
ssl_certificate_path: "/etc/ssl",
ssl_certificate_key_path: "/etc/ssl",
client_max_body_size: "20m"
......@@ -152,7 +149,6 @@ describe "gitlab::nginx" do
path: "/data/git/gitlab",
host: "localhost",
port: "80",
url: "http://localhost:80/",
ssl_certificate_path: "/etc/ssl",
ssl_certificate_key_path: "/etc/ssl",
client_max_body_size: "20m"
......
......@@ -57,7 +57,7 @@ production: &base
## Standard login settings
# The standard login can be disabled to force login via LDAP
# default: true - If set to false, standard login form won't be shown on the sign-in page
signin_enabled: <%= @standard_signin_enabled %>
signin_enabled: <%= @signin_enabled %>
# Restrict setting visibility levels for non-admin users.
# The default is to allow all levels.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment