Skip to content
Snippets Groups Projects
Commit 0f502fa6 authored by Sytse Sijbrandij's avatar Sytse Sijbrandij
Browse files

Merge branch 'specify_url' into 'master'

Specify Url
parents da68aeb3 a2f049cf
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -8,7 +8,7 @@ GitLab!
After the steps below your GitLab instance should reachable over HTTP,
and have an admin user with username `root` and password `5iveL!fe`.
 
### Ubuntu
### Ubuntu 12.04
 
```
sudo apt-get install openssh-server
Loading
Loading
@@ -30,28 +30,59 @@ sudo lokkit -s http -s ssh
 
## How to manage an Omnibus-installed GitLab
 
### Administrative commands
### Start/stop GitLab
 
You can make configuration changes by editing `/etc/gitlab/gitlab.rb` and
`/etc/gitlab/gitlab-secrets.json`, followed by running
You can start, stop or restart GitLab and all of its components with the
following commands.
 
```shell
# Start all GitLab components
sudo gitlab-ctl start
# Stop all GitLab components
sudo gitlab-ctl stop
# Restart all GitLab components
sudo gitlab-ctl restart
```
sudo gitlab-ctl reconfigure
It is also possible to start, stop or restart individual components.
```shell
sudo gitlab-ctl restart unicorn
```
### Creating the gitlab.rb configuration file
```shell
sudo mkdir -p /etc/gitlab
sudo touch /etc/gitlab/gitlab.rb
sudo chmod 600 /etc/gitlab/gitlab.rb
```
 
To start/stop a component of GitLab run e.g.
`sudo gitlab-ctl stop sidekiq`. To permanently disable e.g. Sidekiq, add
`sidekiq['enable'] = false` to `/etc/gitlab/gitlab.rb`, and run
`sudo gitlab-ctl reconfigure` for the change to take effect.
### Configuring the external URL for GitLab
 
To invoke a GitLab rake task, use `gitlab-rake`. For example:
In order for GitLab to display correct repository clone links to your users
it needs to know the URL under which it is reached by your users, e.g.
`http://gitlab.example.com`. Add the following line to `/etc/gitlab/gitlab.rb`:
 
```ruby
external_url "http://gitlab.example.com"
```
Run `sudo gitlab-ctl reconfigure` for the change to take effect.
### Invoking Rake tasks
To invoke a GitLab Rake task, use `gitlab-rake`. For example:
```shell
sudo gitlab-rake gitlab:backup:create
```
 
There is no need to change the user or the `RAILS_ENV` environment variable;
this is taken care of by the `gitlab-rake` wrapper script.
Contrary to with a traditional GitLab installation, there is no need to change
the user or the `RAILS_ENV` environment variable; this is taken care of by the
`gitlab-rake` wrapper script.
 
### Directory structure
 
Loading
Loading
@@ -67,4 +98,4 @@ Omnibus-gitlab uses four different directories.
 
## Building your own package
 
See (doc/build.md).
See [the separate build documentation](doc/build.md).
Loading
Loading
@@ -21,11 +21,13 @@ require 'chef/mash'
require 'chef/json_compat'
require 'chef/mixin/deep_merge'
require 'securerandom'
require 'uri'
 
module Gitlab
extend(Mixlib::Config)
 
bootstrap Mash.new
user Mash.new
postgresql Mash.new
redis Mash.new
gitlab_rails Mash.new
Loading
Loading
@@ -33,6 +35,7 @@ module Gitlab
sidekiq Mash.new
nginx Mash.new
node nil
external_url nil
 
class << self
 
Loading
Loading
@@ -72,10 +75,39 @@ module Gitlab
end
end
 
def parse_external_url
return unless external_url
uri = URI(external_url.to_s)
unless uri.host
raise "External URL must include a FQDN"
end
Gitlab['user']['git_user_email'] ||= "gitlab@#{uri.host}"
Gitlab['gitlab_rails']['external_fqdn'] = uri.host
Gitlab['gitlab_rails']['notification_email'] ||= "gitlab@#{uri.host}"
case uri.scheme
when "http"
Gitlab['gitlab_rails']['external_https'] = false
when "https"
Gitlab['gitlab_rails']['external_https'] = true
else
raise "Unsupported external URL scheme: #{uri.scheme}"
end
unless ["", "/"].include?(uri.path)
raise "Unsupported external URL path: #{uri.path}"
end
Gitlab['gitlab_rails']['external_port'] = uri.port
end
def generate_hash
results = { "gitlab" => {} }
[
"bootstrap",
"user",
"redis",
"gitlab_rails",
"unicorn",
Loading
Loading
@@ -92,6 +124,7 @@ module Gitlab
 
def generate_config(node_name)
generate_secrets(node_name)
parse_external_url
generate_hash
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment