Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added Rails Environment Relative URL #642

Closed
wants to merge 1 commit into from

6 participants

Nate Steffan Valeriy Sizov Dmitriy Zaporozhets Jordano Celestrini Kjellski Chris Frohoff
Nate Steffan

Added a scope to enable the ability to use a context root on the application.

Valeriy Sizov
Collaborator

I don`t agree.
@randx what do you think?

Dmitriy Zaporozhets
Owner

I dont like this either

Valeriy Sizov vsizov closed this
Nate Steffan

Not to be annoying, but what don't you agree with? This seems to be the accepted way for a Rails 3 application to be put at a directory other than '/' since the removal of config.action_controller.relative_url_root.

Valeriy Sizov
Collaborator

we don`t support relative url. Also it looks dirty.

Valeriy Sizov
Collaborator

i mean we don`t want support of relative url.

Nate Steffan

I realize that as an open source project I have the freedom to change the code and use it as I see fit.

That being said, an open source project should be able to be customized easy enough so someone can integrate said project into their own environment without a lot of trouble. It should have been a lot easier for me to integrate this application into my environment and looking at other discussion topics on Google it seems like I wasn't the only one that was looking for this functionality in this project.

If you aren't going to include this functionality in the project natively, I would suggest creating a wiki page stating how it can be done so people don't spend hours like I did trying to figure out why I couldn't make it work properly.

Valeriy Sizov
Collaborator

yes. Manual or wiki page will be good idea. But this feature shouldn't be in core logic. Because it will make more hardly support our product. Sorry for my english. Do not be offended.

Dmitriy Zaporozhets
Owner

Manual or wiki is ok. But core functionality should be tiny

Jordano Celestrini

Several other projects like Redmine support this functionality. There are several situations where you create a subdomain just for the installation of a system is not possible, nor advisable. Sorry for my English ... but I agree that this is a necessary feature. I agree too that "nsteffan" propose of implementation is ugly. Maybe someone could see how Redmine do this and apply this feature to gitlabhq!

Kjellski

What am I supposed to do when I can't subdomain and need this functionality? Is there a way to make it behave nevertheless? I can't run this on a complete host on its own.

Chris Frohoff

I've created a pull request with an alternate implementation of relative url root support in #2162 .

Vincent Giersch gierschv referenced this pull request in gitlabhq/gitlab-ci
Merged

Added Rails Environment Relative URL #91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 4, 2012
  1. Added a scope to enable the ability to use a context root on the

    Nate Steffan authored
    application.
This page is out of date. Refresh to see the latest.
Showing with 109 additions and 107 deletions.
  1. +109 −107 config/routes.rb
216 config/routes.rb
View
@@ -1,134 +1,136 @@
Gitlab::Application.routes.draw do
- get 'search' => "search#show"
-
- # Optionally, enable Resque here
- require 'resque/server'
- mount Resque::Server.new, at: '/info/resque'
-
- get 'help' => 'help#index'
- get 'help/permissions' => 'help#permissions'
- get 'help/workflow' => 'help#workflow'
- get 'help/web_hooks' => 'help#web_hooks'
-
- namespace :admin do
- resources :users do
- member do
- put :team_update
+ scope ENV['RAILS_RELATIVE_URL_ROOT'] || '/' do
+ get 'search' => "search#show"
+
+ # Optionally, enable Resque here
+ require 'resque/server'
+ mount Resque::Server.new, at: '/info/resque'
+
+ get 'help' => 'help#index'
+ get 'help/permissions' => 'help#permissions'
+ get 'help/workflow' => 'help#workflow'
+ get 'help/web_hooks' => 'help#web_hooks'
+
+ namespace :admin do
+ resources :users do
+ member do
+ put :team_update
+ end
end
- end
- resources :projects, :constraints => { :id => /[^\/]+/ } do
- member do
- get :team
- put :team_update
+ resources :projects, :constraints => { :id => /[^\/]+/ } do
+ member do
+ get :team
+ put :team_update
+ end
end
+ resources :team_members, :only => [:edit, :update, :destroy]
+ get 'emails', :to => 'mailer#preview'
+ get 'mailer/preview_note'
+ get 'mailer/preview_user_new'
+ get 'mailer/preview_issue_new'
+ root :to => "users#index"
end
- resources :team_members, :only => [:edit, :update, :destroy]
- get 'emails', :to => 'mailer#preview'
- get 'mailer/preview_note'
- get 'mailer/preview_user_new'
- get 'mailer/preview_issue_new'
- root :to => "users#index"
- end
-
- get "errors/githost"
- get "profile/password", :to => "profile#password"
- put "profile/password", :to => "profile#password_update"
- put "profile/reset_private_token", :to => "profile#reset_private_token"
- get "profile", :to => "profile#show"
- get "profile/design", :to => "profile#design"
- put "profile/update", :to => "profile#update"
- get "dashboard", :to => "dashboard#index"
- get "dashboard/issues", :to => "dashboard#issues"
- get "dashboard/merge_requests", :to => "dashboard#merge_requests"
- get "dashboard/activities", :to => "dashboard#activities"
+ get "errors/githost"
+ get "profile/password", :to => "profile#password"
+ put "profile/password", :to => "profile#password_update"
+ put "profile/reset_private_token", :to => "profile#reset_private_token"
+ get "profile", :to => "profile#show"
+ get "profile/design", :to => "profile#design"
+ put "profile/update", :to => "profile#update"
- #get "profile/:id", :to => "profile#show"
+ get "dashboard", :to => "dashboard#index"
+ get "dashboard/issues", :to => "dashboard#issues"
+ get "dashboard/merge_requests", :to => "dashboard#merge_requests"
+ get "dashboard/activities", :to => "dashboard#activities"
- resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create, :index]
- resources :keys
+ #get "profile/:id", :to => "profile#show"
- devise_for :users, :controllers => { :omniauth_callbacks => :omniauth_callbacks }
+ resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create, :index]
+ resources :keys
- resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
- member do
- get "team"
- get "wall"
- get "graph"
- get "files"
- end
+ devise_for :users, :controllers => { :omniauth_callbacks => :omniauth_callbacks }
- resources :wikis, :only => [:show, :edit, :destroy, :create] do
+ resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
member do
- get "history"
+ get "team"
+ get "wall"
+ get "graph"
+ get "files"
end
- end
- resource :repository do
- member do
- get "branches"
- get "tags"
- get "archive"
+ resources :wikis, :only => [:show, :edit, :destroy, :create] do
+ member do
+ get "history"
+ end
end
- end
-
- resources :deploy_keys
- resources :protected_branches, :only => [:index, :create, :destroy]
- resources :refs, :only => [], :path => "/" do
- collection do
- get "switch"
+ resource :repository do
+ member do
+ get "branches"
+ get "tags"
+ get "archive"
+ end
end
- member do
- get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
- get "blob",
- :constraints => {
- :id => /[a-zA-Z.0-9\/_\-]+/,
- :path => /.*/
- }
-
-
- # tree viewer
- get "tree/:path" => "refs#tree",
- :as => :tree_file,
- :constraints => {
- :id => /[a-zA-Z.0-9\/_\-]+/,
- :path => /.*/
- }
+ resources :deploy_keys
+ resources :protected_branches, :only => [:index, :create, :destroy]
+
+ resources :refs, :only => [], :path => "/" do
+ collection do
+ get "switch"
+ end
+
+ member do
+ get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
+ get "blob",
+ :constraints => {
+ :id => /[a-zA-Z.0-9\/_\-]+/,
+ :path => /.*/
+ }
+
+
+ # tree viewer
+ get "tree/:path" => "refs#tree",
+ :as => :tree_file,
+ :constraints => {
+ :id => /[a-zA-Z.0-9\/_\-]+/,
+ :path => /.*/
+ }
+ end
end
- end
- resources :merge_requests do
- member do
- get :diffs
- end
+ resources :merge_requests do
+ member do
+ get :diffs
+ end
- collection do
- get :branch_from
- get :branch_to
+ collection do
+ get :branch_from
+ get :branch_to
+ end
end
- end
- resources :snippets
- resources :hooks, :only => [:index, :new, :create, :destroy, :show] do
- member do
- get :test
+ resources :snippets
+ resources :hooks, :only => [:index, :new, :create, :destroy, :show] do
+ member do
+ get :test
+ end
end
- end
- resources :commits do
- collection do
- get :compare
+ resources :commits do
+ collection do
+ get :compare
+ end
end
- end
- resources :team_members
- resources :issues do
- collection do
- post :sort
- get :search
+ resources :team_members
+ resources :issues do
+ collection do
+ post :sort
+ get :search
+ end
end
+ resources :notes, :only => [:index, :create, :destroy]
end
- resources :notes, :only => [:index, :create, :destroy]
+ root :to => "dashboard#index"
end
- root :to => "dashboard#index"
-end
+end
Something went wrong with that request. Please try again.