diff options
author | Chris Frohoff <chris@frohoff.org> | 2012-12-28 22:11:28 +0400 |
---|---|---|
committer | Chris Frohoff <chris@frohoff.org> | 2012-12-28 22:11:28 +0400 |
commit | 21e55ca318bb829399c85b10e678b596d6fd414e (patch) | |
tree | d3029235bcc15ef06a9489df40b79b280be1397f /config | |
parent | e9394c48ca7aacd9d151519c1da51d18a21b351b (diff) |
added RAILS_RELATIVE_URL_ROOT support
Diffstat (limited to 'config')
-rw-r--r-- | config/gitlab.yml.example | 3 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 4 | ||||
-rw-r--r-- | config/routes.rb | 2 | ||||
-rw-r--r-- | config/unicorn.rb.example | 4 |
4 files changed, 11 insertions, 2 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index f47625eb132..5546632cb7f 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -18,6 +18,9 @@ gitlab: host: localhost port: 80 https: false + # uncomment and customize to run in non-root path + # note that ENV['RAILS_RELATIVE_URL_ROOT'] in config/unicorn.rb may need to be changed + # relative_url_root: /gitlab ## Email settings # Email address used in the "From" field in mails sent by GitLab diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index efc81611835..6b47a9cc948 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -25,7 +25,8 @@ class Settings < Settingslogic [ gitlab.protocol, "://", gitlab.host, - custom_port + custom_port, + gitlab.relative_url_root ].join('') end end @@ -45,6 +46,7 @@ Settings.gitlab['default_projects_limit'] ||= 10 Settings.gitlab['host'] ||= 'localhost' Settings.gitlab['https'] ||= false Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80 +Settings.gitlab['relative_url_root'] ||= '' Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http" Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}" Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url) diff --git a/config/routes.rb b/config/routes.rb index 4a02bd9f809..1259496f634 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,7 +18,7 @@ Gitlab::Application.routes.draw do project_root: Gitlab.config.gitolite.repos_path, upload_pack: Gitlab.config.gitolite.upload_pack, receive_pack: Gitlab.config.gitolite.receive_pack - }), at: '/:path', constraints: { path: /[-\/\w\.-]+\.git/ } + }), at: '/', constraints: lambda { |request| /[-\/\w\.-]+\.git/.match(request.path_info) } # # Help diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example index 425dbf33f86..4852cd65daa 100644 --- a/config/unicorn.rb.example +++ b/config/unicorn.rb.example @@ -1,3 +1,7 @@ +# uncomment and customize to run in non-root path +# note that config/gitlab.yml web path should also be changed +# ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab" + app_dir = "/home/gitlab/gitlab/" worker_processes 2 working_directory app_dir |