Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #9917

Closed
Open
Created Dec 16, 2015 by Administrator@rootOwner

[IMPROVEMENT] Do not hardcode /home/git to Gitlab, make it configurable

Created by: hron84

While I trying to install GitLab into our environment, we met with a problem GitLab hardly assumes it would be configured as 'git' user and /home/git directory, but in our case this username and home directory already occupied by something other and we wouldn't change it.

But anyways, hardcoding something is usually bad, Ruby provides many-many ways to calculate correct directories based on the actual path of the file, or query the home directory of the running user. There is no big advantage to use hardcoded absolute paths than relative or dynamic ones but causes problems if these paths are occupied by something other stuff.

Concrete examples:

# config/unicorn.rb

# Help ensure your application will always spawn in the symlinked
# "current" directory that Capistrano sets up.
working_directory "/home/git/gitlab" # available in 0.94.0+

# Listen on both a Unix domain socket and a TCP port.
# If you are load-balancing multiple Unicorn masters, lower the backlog
# setting to e.g. 64 for faster failover.
listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 1024
listen "127.0.0.1:8080", :tcp_nopush => true

# feel free to point this anywhere accessible on the filesystem
pid "/home/git/gitlab/tmp/pids/unicorn.pid"

These variables should use relative paths, or the internal %{working_directory} globbing.

But GitLab also cannot detect running user automatically but expect it to be configured in the configs or blindly assume it was running under git user with /home/git directory, regardless if this user is available or not. Since the install guide already suggests to use sudo -u USERNAME for running scripts, it would be nice if the components would be able to fetch actual username and homedir via Etc object and not blindly assume something that may or may not be true.

Assignee
Assign to
Time tracking