Support deployments of Gitorious outside of the root path
authorTuomas Jormola <tj@solitudo.net>
Sat, 6 Apr 2013 00:31:08 +0000 (03:31 +0300)
committerTuomas Jormola <tj@solitudo.net>
Sat, 6 Apr 2013 00:59:01 +0000 (03:59 +0300)
commit86c1b0e5063785a6fb5bbeee37446fb186df43a5
treec5fdbf0a15cf58c55e9f0e30b194b6ad7eef126e
parent140c2883e94ab401b90072b6fcd0c7ced2882beb
Support deployments of Gitorious outside of the root path

This patch revives functionality for the next branch of Gitorious 3.0.0
first described in http://gitorious.org/gitorious/mainline/merge_requests/2219.
With this patch applied, you should be able to use the standard Rails
way to deploy Gitorious to other path than the root of the HTTP server,
i.e. have the environment variable RAILS_RELATIVE_URL_ROOT set to some
path before starting Rails running Gitorious.

Unfortunately, the path needs also to be defined in gitorious.yml since
accessing the value via Rails.application.config.relative_url_root is
not available for the Gitorious shell when accessing repos over SSH.

There's some problems related to static files, though. As of the date of
this commit, Rails is unable to server static files if relative_url_root
is set. See https://github.com/rails/rails/pull/10114. For the time
being, workaround is to create a symlink under the public directory with
the name of the path in relative_url_root pointing to itself. Also you
have to manually update any paths in public/*.html and public/robots.txt
files.
app/racks/git_http_cloner.rb
config/gitorious.sample.yml
config/routes.rb
lib/gitorious.rb
lib/gitorious/mount_point.rb
lib/gitorious/ssh/client.rb