BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
bd78e1a2
Commit
bd78e1a2
authored
Aug 21, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9535 from bbodenmiller/patch-3
check upload dir permissions
parents
677bf661
ea9b8fe5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
check.rake
lib/tasks/gitlab/check.rake
+52
-0
No files found.
lib/tasks/gitlab/check.rake
View file @
bd78e1a2
...
...
@@ -22,6 +22,7 @@ namespace :gitlab do
check_gitlab_config_not_outdated
check_log_writable
check_tmp_writable
check_uploads
check_init_script_exists
check_init_script_up_to_date
check_projects_have_namespace
...
...
@@ -277,6 +278,57 @@ namespace :gitlab do
end
end
def
check_uploads
print
"Uploads directory setup correctly? ... "
unless
File
.
directory?
(
Rails
.
root
.
join
(
'public/uploads'
))
puts
"no"
.
red
try_fixing_it
(
"sudo -u
#{
gitlab_user
}
mkdir -m 750
#{
Rails
.
root
}
/public/uploads"
)
for_more_information
(
see_installation_guide_section
"GitLab"
)
fix_and_rerun
return
end
upload_path
=
File
.
realpath
(
Rails
.
root
.
join
(
'public/uploads'
))
upload_path_tmp
=
File
.
join
(
upload_path
,
'tmp'
)
if
File
.
stat
(
upload_path
).
mode
==
040750
unless
Dir
.
exists?
(
upload_path_tmp
)
puts
'skipped (no tmp uploads folder yet)'
.
magenta
return
end
# if tmp upload dir has incorrect permissions, assume others do as well
if
File
.
stat
(
upload_path_tmp
).
mode
==
040755
&&
File
.
owned?
(
upload_path_tmp
)
# verify drwxr-xr-x permissions
puts
"yes"
.
green
else
puts
"no"
.
red
try_fixing_it
(
"sudo chown -R
#{
gitlab_user
}
#{
upload_path
}
"
,
"sudo find
#{
upload_path
}
-type f -exec chmod 0644 {}
\\
;"
,
"sudo find
#{
upload_path
}
-type d -not -path
#{
upload_path
}
-exec chmod 0755 {}
\\
;"
)
for_more_information
(
see_installation_guide_section
"GitLab"
)
fix_and_rerun
end
else
puts
"no"
.
red
try_fixing_it
(
"sudo chmod 0750
#{
upload_path
}
"
,
)
for_more_information
(
see_installation_guide_section
"GitLab"
)
fix_and_rerun
end
end
def
check_redis_version
print
"Redis version >= 2.0.0? ... "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment