Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
8f9dec28
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8f9dec28
编写于
1月 17, 2013
作者:
R
Riyad Preukschas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix check.rake to use the new user and group settings
上级
76329a46
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
19 deletion
+28
-19
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+25
-17
lib/tasks/gitlab/task_helpers.rake
lib/tasks/gitlab/task_helpers.rake
+3
-2
未找到文件。
lib/tasks/gitlab/check.rake
浏览文件 @
8f9dec28
...
...
@@ -169,7 +169,7 @@ namespace :gitlab do
else
puts
"no"
.
red
try_fixing_it
(
"sudo -u gitlab -H bundle exec rake db:migrate"
sudo_gitlab
(
"bundle exec rake db:migrate"
)
)
fix_and_rerun
end
...
...
@@ -194,7 +194,7 @@ namespace :gitlab do
else
puts
"no"
.
red
try_fixing_it
(
"sudo -u gitlab -H bundle exec rake gitlab:satellites:create"
,
sudo_gitlab
(
"bundle exec rake gitlab:satellites:create"
)
,
"If necessary, remove the tmp/repo_satellites directory ..."
,
"... and rerun the above command"
)
...
...
@@ -269,7 +269,8 @@ namespace :gitlab do
########################
def
check_gitlab_git_config
print
"Git configured for gitlab user? ... "
gitlab_user
=
Gitlab
.
config
.
gitlab
.
user
print
"Git configured for
#{
gitlab_user
}
user? ... "
options
=
{
"user.name"
=>
"GitLab"
,
...
...
@@ -284,8 +285,8 @@ namespace :gitlab do
else
puts
"no"
.
red
try_fixing_it
(
"sudo -u gitlab -H git config --global user.name
\"
#{
options
[
"user.name"
]
}
\"
"
,
"sudo -u gitlab -H git config --global user.email
\"
#{
options
[
"user.email"
]
}
\"
"
sudo_gitlab
(
"git config --global user.name
\"
#{
options
[
"user.name"
]
}
\"
"
)
,
sudo_gitlab
(
"git config --global user.email
\"
#{
options
[
"user.email"
]
}
\"
"
)
)
for_more_information
(
see_installation_guide_section
"GitLab"
...
...
@@ -296,15 +297,15 @@ namespace :gitlab do
def
check_gitlab_in_git_group
gitlab_user
=
Gitlab
.
config
.
gitlab
.
user
gitolite_
group
=
Gitlab
.
config
.
gitolite
.
group
print
"
gitlab user '
#{
gitlab_user
}
' has git group '
#{
gitolite_group
}
'
? ... "
gitolite_
owner_group
=
Gitlab
.
config
.
gitolite
.
owner_
group
print
"
#{
gitlab_user
}
user is in
#{
gitolite_owner_group
}
group
? ... "
if
run_and_match
(
"id -rnG"
,
/^
#{
gitolite_
group
}
\W|\W
#{
gitolite_group
}
\W|\W
#{
gitolite
_group
}
$/
)
if
run_and_match
(
"id -rnG"
,
/^
#{
gitolite_
owner_group
}
\W|\W
#{
gitolite_owner_group
}
\W|\W
#{
gitolite_owner
_group
}
$/
)
puts
"yes"
.
green
else
puts
"no"
.
red
try_fixing_it
(
"sudo usermod -a -G
#{
gitolite_group
}
#{
gitlab_user
}
"
"sudo usermod -a -G
#{
gitolite_
owner_
group
}
#{
gitlab_user
}
"
)
for_more_information
(
see_installation_guide_section
"System Users"
...
...
@@ -519,7 +520,8 @@ namespace :gitlab do
def
check_dot_gitolite_user_and_group
gitolite_ssh_user
=
Gitlab
.
config
.
gitolite
.
ssh_user
print
"Config directory owned by
#{
gitolite_ssh_user
}
:
#{
gitolite_ssh_user
}
... "
gitolite_owner_group
=
Gitlab
.
config
.
gitolite
.
owner_group
print
"Config directory owned by
#{
gitolite_ssh_user
}
:
#{
gitolite_owner_group
}
... "
gitolite_config_path
=
File
.
join
(
gitolite_user_home
,
".gitolite"
)
unless
File
.
exists?
(
gitolite_config_path
)
...
...
@@ -528,12 +530,12 @@ namespace :gitlab do
end
if
File
.
stat
(
gitolite_config_path
).
uid
==
uid_for
(
gitolite_ssh_user
)
&&
File
.
stat
(
gitolite_config_path
).
gid
==
gid_for
(
gitolite_
ssh_user
)
File
.
stat
(
gitolite_config_path
).
gid
==
gid_for
(
gitolite_
owner_group
)
puts
"yes"
.
green
else
puts
"no"
.
red
try_fixing_it
(
"sudo chown -R
#{
gitolite_ssh_user
}
:
#{
gitolite_
ssh_user
}
#{
gitolite_config_path
}
"
"sudo chown -R
#{
gitolite_ssh_user
}
:
#{
gitolite_
owner_group
}
#{
gitolite_config_path
}
"
)
for_more_information
(
see_installation_guide_section
"Gitolite"
...
...
@@ -738,7 +740,8 @@ namespace :gitlab do
def
check_repo_base_user_and_group
gitolite_ssh_user
=
Gitlab
.
config
.
gitolite
.
ssh_user
print
"Repo base owned by
#{
gitolite_ssh_user
}
:
#{
gitolite_ssh_user
}
? ... "
gitolite_owner_group
=
Gitlab
.
config
.
gitolite
.
owner_group
print
"Repo base owned by
#{
gitolite_ssh_user
}
:
#{
gitolite_owner_group
}
? ... "
repo_base_path
=
Gitlab
.
config
.
gitolite
.
repos_path
unless
File
.
exists?
(
repo_base_path
)
...
...
@@ -747,12 +750,12 @@ namespace :gitlab do
end
if
File
.
stat
(
repo_base_path
).
uid
==
uid_for
(
gitolite_ssh_user
)
&&
File
.
stat
(
repo_base_path
).
gid
==
gid_for
(
gitolite_
ssh_user
)
File
.
stat
(
repo_base_path
).
gid
==
gid_for
(
gitolite_
owner_group
)
puts
"yes"
.
green
else
puts
"no"
.
red
try_fixing_it
(
"sudo chown -R
#{
gitolite_ssh_user
}
:
#{
gitolite_
ssh_user
}
#{
repo_base_path
}
"
"sudo chown -R
#{
gitolite_ssh_user
}
:
#{
gitolite_
owner_group
}
#{
repo_base_path
}
"
)
for_more_information
(
see_installation_guide_section
"Gitolite"
...
...
@@ -786,7 +789,7 @@ namespace :gitlab do
else
puts
"wrong or missing"
.
red
try_fixing_it
(
"sudo -u gitlab -H bundle exec rake gitlab:gitolite:update_repos"
sudo_gitlab
(
"bundle exec rake gitlab:gitolite:update_repos"
)
)
for_more_information
(
"doc/raketasks/maintenance.md"
...
...
@@ -892,7 +895,7 @@ namespace :gitlab do
else
puts
"no"
.
red
try_fixing_it
(
"sudo -u gitlab -H bundle exec rake sidekiq:start"
sudo_gitlab
(
"bundle exec rake sidekiq:start"
)
)
for_more_information
(
see_installation_guide_section
(
"Install Init Script"
),
...
...
@@ -934,6 +937,11 @@ namespace :gitlab do
"doc/install/installation.md in section
\"
#{
section
}
\"
"
end
def
sudo_gitlab
(
command
)
gitlab_user
=
Gitlab
.
config
.
gitlab
.
user
"sudo -u
#{
gitlab_user
}
-H
#{
command
}
"
end
def
start_checking
(
component
)
puts
"Checking
#{
component
.
yellow
}
..."
puts
""
...
...
lib/tasks/gitlab/task_helpers.rake
浏览文件 @
8f9dec28
...
...
@@ -56,12 +56,13 @@ namespace :gitlab do
def
warn_user_is_not_gitlab
unless
@warned_user_not_gitlab
gitlab_user
=
Gitlab
.
config
.
gitlab
.
user
current_user
=
run
(
"whoami"
).
chomp
unless
current_user
==
"gitlab"
unless
current_user
==
gitlab_user
puts
"
#{
Colored
.
color
(
:black
)
+
Colored
.
color
(
:on_yellow
)
}
Warning
#{
Colored
.
extra
(
:clear
)
}
"
puts
" You are running as user
#{
current_user
.
magenta
}
, we hope you know what you are doing."
puts
" Things may work
\/
fail for the wrong reasons."
puts
" For correct results you should run this as user
#{
"gitlab"
.
magenta
}
."
puts
" For correct results you should run this as user
#{
gitlab_user
.
magenta
}
."
puts
""
end
@warned_user_not_gitlab
=
true
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录