Commit 28ba8ed5 authored by Artem Sidorenko's avatar Artem Sidorenko

Use dedicated relative_url.rb initializer

in order to have it the same way like in omnibus
parent 333ad73e
...@@ -23,6 +23,7 @@ config/gitlab.yml ...@@ -23,6 +23,7 @@ config/gitlab.yml
config/gitlab_ci.yml config/gitlab_ci.yml
config/initializers/rack_attack.rb config/initializers/rack_attack.rb
config/initializers/smtp_settings.rb config/initializers/smtp_settings.rb
config/initializers/relative_url.rb
config/resque.yml config/resque.yml
config/unicorn.rb config/unicorn.rb
config/secrets.yml config/secrets.yml
......
...@@ -54,14 +54,6 @@ module Gitlab ...@@ -54,14 +54,6 @@ module Gitlab
config.action_view.sanitized_allowed_protocols = %w(smb) config.action_view.sanitized_allowed_protocols = %w(smb)
# Relative URL support
# WARNING: We recommend using an FQDN to host GitLab in a root path instead
# of using a relative URL.
# Documentation: http://doc.gitlab.com/ce/install/relative_url.html
# Uncomment and customize the following line to run in a non-root path
#
# config.relative_url_root = "/gitlab"
config.middleware.use Rack::Attack config.middleware.use Rack::Attack
# Allow access to GitLab API from other domains # Allow access to GitLab API from other domains
......
# Relative URL support
# WARNING: We recommend using an FQDN to host GitLab in a root path instead
# of using a relative URL.
# Documentation: http://doc.gitlab.com/ce/install/relative_url.html
# Copy this file to relative_url.rb and customize it to run in a non-root path
#
Rails.application.configure do
config.relative_url_root = "/gitlab"
end
...@@ -25,7 +25,7 @@ that points to your GitLab instance. ...@@ -25,7 +25,7 @@ that points to your GitLab instance.
The TL;DR list of configuration files that you need to change in order to The TL;DR list of configuration files that you need to change in order to
serve GitLab under a relative URL is: serve GitLab under a relative URL is:
- `/home/git/gitlab/config/application.rb` - `/home/git/gitlab/config/initializers/relative_url.rb`
- `/home/git/gitlab/config/gitlab.yml` - `/home/git/gitlab/config/gitlab.yml`
- `/home/git/gitlab/config/unicorn.rb` - `/home/git/gitlab/config/unicorn.rb`
- `/home/git/gitlab-shell/config.yml` - `/home/git/gitlab-shell/config.yml`
...@@ -66,8 +66,14 @@ Make sure to follow all steps below: ...@@ -66,8 +66,14 @@ Make sure to follow all steps below:
sudo service gitlab stop sudo service gitlab stop
``` ```
1. Edit `/home/git/gitlab/config/application.rb` and uncomment/change the 1. Create `/home/git/gitlab/config/initializers/relative_url.rb`
following line:
```shell
cp /home/git/gitlab/config/initializers/relative_url.rb.sample \
/home/git/gitlab/config/initializers/relative_url.rb
```
and change the following line:
```ruby ```ruby
config.relative_url_root = "/gitlab" config.relative_url_root = "/gitlab"
...@@ -119,8 +125,12 @@ Make sure to follow all steps below: ...@@ -119,8 +125,12 @@ Make sure to follow all steps below:
### Disable relative URL in GitLab ### Disable relative URL in GitLab
To disable the relative URL, follow the same steps as above and set up the To disable the relative URL:
GitLab URL to one that doesn't contain a relative path.
1. Remove `/home/git/gitlab/config/initializers/relative_url.rb`
1. Follow the same as above starting from 2. and set up the
GitLab URL to one that doesn't contain a relative path.
[omnibus-rel]: http://doc.gitlab.com/omnibus/settings/configuration.html#configuring-a-relative-url-for-gitlab "How to setup relative URL in Omnibus GitLab" [omnibus-rel]: http://doc.gitlab.com/omnibus/settings/configuration.html#configuring-a-relative-url-for-gitlab "How to setup relative URL in Omnibus GitLab"
[restart gitlab]: ../administration/restart_gitlab.md#installations-from-source "How to restart GitLab" [restart gitlab]: ../administration/restart_gitlab.md#installations-from-source "How to restart GitLab"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment