config: modified the configuration templates to suit our needs

This commit is contained in:
Sameer Naik 2014-02-05 23:25:09 +05:30
parent 5db5036454
commit 57ee929dbf
6 changed files with 27 additions and 29 deletions

View File

@ -1,6 +1,7 @@
#!/bin/bash
GITLAB_HOST=${GITLAB_HOST:-localhost}
GITLAB_PORT=${GITLAB_PORT:-80}
GITLAB_HTTPS=${GITLAB_HTTPS:-false}
GITLAB_EMAIL=${GITLAB_EMAIL:-gitlab@localhost}
GITLAB_SUPPORT=${GITLAB_SUPPORT:-support@localhost}
@ -125,13 +126,14 @@ sudo -u git -H git config --global user.email "${GITLAB_EMAIL}"
sudo -u git -H git config --global core.autocrlf input
# configure server url
sudo -u git -H sed 's/host: localhost/host: '${GITLAB_HOST}'/' -i /home/git/gitlab/config/gitlab.yml
sudo -u git -H sed 's/https: false/https: '${GITLAB_HTTPS}'/' -i /home/git/gitlab/config/gitlab.yml
sudo -u git -H sed 's/email_from: gitlab@localhost/email_from: '${GITLAB_EMAIL}'/' -i /home/git/gitlab/config/gitlab.yml
sudo -u git -H sed 's/support_email: support@localhost/support_email: '${GITLAB_SUPPORT}'/' -i /home/git/gitlab/config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_HOST}}/'${GITLAB_HOST}'/' -i /home/git/gitlab/config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_PORT}}/'${GITLAB_PORT}'/' -i /home/git/gitlab/config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_HTTPS}}/'${GITLAB_HTTPS}'/' -i /home/git/gitlab/config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_EMAIL}}/'${GITLAB_EMAIL}'/' -i /home/git/gitlab/config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_SUPPORT}}/'${GITLAB_SUPPORT}'/' -i /home/git/gitlab/config/gitlab.yml
# configure gitlab signup configuration
sudo -u git -H sed 's/# signup_enabled: true/signup_enabled: '${GITLAB_SIGNUP}'/' -i /home/git/gitlab/config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_SIGNUP}}/'${GITLAB_SIGNUP}'/' -i /home/git/gitlab/config/gitlab.yml
# configure database
if [ "${DB_TYPE}" == "postgres" ]; then
@ -155,17 +157,18 @@ sudo -u git -H sed 's/{{DB_POOL}}/'${DB_POOL}'/' -i /home/git/gitlab/config/data
sudo -u git -H sed 's/{{SIDEKIQ_CONCURRENCY}}/'${SIDEKIQ_CONCURRENCY}'/' -i /home/git/gitlab/config/sidekiq.yml
# configure redis
sudo -u git -H sed 's/redis.example.com:6379/'${REDIS_HOST}':'${REDIS_PORT}'/' -i /home/git/gitlab/config/resque.yml
sudo -u git -H sed 's/{{REDIS_HOST}}/'${REDIS_HOST}'/' -i /home/git/gitlab/config/resque.yml
sudo -u git -H sed 's/{{REDIS_PORT}}/'${REDIS_PORT}'/' -i /home/git/gitlab/config/resque.yml
# configure gitlab-shell
sudo -u git -H sed 's/host: 127.0.0.1/host: '${REDIS_HOST}'/' -i /home/git/gitlab-shell/config.yml
sudo -u git -H sed 's/port: 6379/port: '${REDIS_PORT}'/' -i /home/git/gitlab-shell/config.yml
sudo -u git -H sed 's/{{REDIS_HOST}}/'${REDIS_HOST}'/' -i /home/git/gitlab-shell/config.yml
sudo -u git -H sed 's/{{REDIS_PORT}}/'${REDIS_PORT}'/' -i /home/git/gitlab-shell/config.yml
# configure unicorn workers
sed 's/worker_processes 2/worker_processes '${UNICORN_WORKERS}'/' -i /home/git/gitlab/config/unicorn.rb
sed 's/{{UNICORN_WORKERS}}/'${UNICORN_WORKERS}'/' -i /home/git/gitlab/config/unicorn.rb
# configure unicorn timeout
sed 's/timeout 30/timeout '${UNICORN_TIMEOUT}'/' -i /home/git/gitlab/config/unicorn.rb
sed 's/{{UNICORN_TIMEOUT}}/'${UNICORN_TIMEOUT}'/' -i /home/git/gitlab/config/unicorn.rb
# take ownership of /home/git/data
chown git:git /home/git/data

View File

@ -15,7 +15,7 @@ http_settings:
# Give the canonicalized absolute pathname,
# REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!!
# Check twice that none of the components is a symlink, including "/home".
repos_path: "/home/git/repositories"
repos_path: "/home/git/data/repositories"
# File used as authorized_keys for gitlab user
auth_file: "/home/git/.ssh/authorized_keys"
@ -23,8 +23,8 @@ auth_file: "/home/git/.ssh/authorized_keys"
# Redis settings used for pushing commit notices to gitlab
redis:
bin: /usr/bin/redis-cli
host: 127.0.0.1
port: 6379
host: {{REDIS_HOST}}
port: {{REDIS_PORT}}
# socket: /tmp/redis.socket # Only define this if you want to use sockets
namespace: resque:gitlab

View File

@ -15,9 +15,9 @@ production: &base
## GitLab settings
gitlab:
## Web server settings
host: localhost
port: 80
https: false
host: {{GITLAB_HOST}}
port: {{GITLAB_PORT}}
https: {{GITLAB_HTTPS}}
# Uncomment and customize the last line to run in a non-root path
# WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this.
@ -35,10 +35,10 @@ production: &base
## Email settings
# Email address used in the "From" field in mails sent by GitLab
email_from: gitlab@localhost
email_from: {{GITLAB_EMAIL}}
# Email address of your support contact (default: same as email_from)
support_email: support@localhost
support_email: {{GITLAB_SUPPORT}}
## User settings
default_projects_limit: 10
@ -55,7 +55,7 @@ production: &base
## Users management
# default: false - Account passwords are not sent via the email if signup is enabled.
# signup_enabled: true
signup_enabled: {{GITLAB_SIGNUP}}
# Restrict setting visibility levels for non-admin users.
# The default is to allow all levels.
@ -175,7 +175,7 @@ production: &base
# GitLab Satellites
satellites:
# Relative paths are relative to Rails.root (default: tmp/repo_satellites/)
path: /home/git/gitlab-satellites/
path: /home/git/data/gitlab-satellites/
## Backup settings
backup:
@ -187,7 +187,7 @@ production: &base
path: /home/git/gitlab-shell/
# REPOS_PATH MUST NOT BE A SYMLINK!!!
repos_path: /home/git/repositories/
repos_path: /home/git/data/repositories/
hooks_path: /home/git/gitlab-shell/hooks/
# Git over HTTP

View File

@ -1,3 +1,3 @@
development: redis://localhost:6379
test: redis://localhost:6379
production: redis://redis.example.com:6379
production: redis://{{REDIS_HOST}}:{{REDIS_PORT}}

View File

@ -21,7 +21,7 @@
# Use at least one worker per core if you're on a dedicated server,
# more will usually help for _short_ waits on databases/caches.
worker_processes 2
worker_processes {{UNICORN_WORKERS}}
# Since Unicorn is never exposed to outside clients, it does not need to
# run on the standard HTTP port (80), there is no reason to start Unicorn
@ -40,7 +40,7 @@ listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 64
listen "127.0.0.1:8080", :tcp_nopush => true
# nuke workers after 30 seconds instead of 60 seconds (the default)
timeout 30
timeout {{UNICORN_TIMEOUT}}
# feel free to point this anywhere accessible on the filesystem
pid "/home/git/gitlab/tmp/pids/unicorn.pid"

View File

@ -21,7 +21,6 @@ chown -R git:git /home/git/gitlab-shell/
cd /home/git/gitlab-shell
sudo -u git -H cp -a /gitlab/setup/config/gitlab-shell/config.yml config.yml
sudo -u git -H sed 's/repos_path: "\/home\/git\/repositories"/repos_path: "\/home\/git\/data\/repositories"/' -i config.yml
sudo -u git -H ./bin/install
# install gitlab
@ -39,10 +38,6 @@ sudo -u git -H cp /gitlab/setup/config/gitlabhq/sidekiq.yml config/sidekiq.yml
sudo -u git -H cp /gitlab/setup/config/gitlabhq/unicorn.rb config/unicorn.rb
sudo -u git -H cp /gitlab/setup/config/gitlabhq/rack_attack.rb config/initializers/rack_attack.rb
# configure repositories path
sudo -u git -H sed 's/repos_path: \/home\/git\/repositories\//repos_path: \/home\/git\/data\/repositories\//' -i config/gitlab.yml
sudo -u git -H sed 's/path: \/home\/git\/gitlab-satellites\//path: \/home\/git\/data\/gitlab-satellites\//' -i config/gitlab.yml
# create required tmp and log directories
sudo -u git -H mkdir -p tmp/pids/ tmp/sockets/
chmod -R u+rwX log tmp