Skip to content
This repository

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

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

Dmitriy Zaporozhets
Owner
randx commented

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

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

Valeriy Sizov

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

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
randx commented

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

Showing 1 unique commit by 1 author.

Apr 04, 2012
Added a scope to enable the ability to use a context root on the
application.
80d333a
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 109 additions and 107 deletions. Show diff stats Hide diff stats

  1. 216  config/routes.rb
216  config/routes.rb
... ...
@@ -1,134 +1,136 @@
1 1
 Gitlab::Application.routes.draw do
2  
-  get 'search' => "search#show"
3  
-
4  
-  # Optionally, enable Resque here
5  
-  require 'resque/server'
6  
-  mount Resque::Server.new, at: '/info/resque'
7  
-
8  
-  get 'help' => 'help#index'
9  
-  get 'help/permissions' => 'help#permissions'
10  
-  get 'help/workflow' => 'help#workflow'
11  
-  get 'help/web_hooks' => 'help#web_hooks'
12  
-
13  
-  namespace :admin do
14  
-    resources :users do 
15  
-      member do 
16  
-        put :team_update
  2
+  scope ENV['RAILS_RELATIVE_URL_ROOT'] || '/' do
  3
+    get 'search' => "search#show"
  4
+
  5
+    # Optionally, enable Resque here
  6
+    require 'resque/server'
  7
+    mount Resque::Server.new, at: '/info/resque'
  8
+
  9
+    get 'help' => 'help#index'
  10
+    get 'help/permissions' => 'help#permissions'
  11
+    get 'help/workflow' => 'help#workflow'
  12
+    get 'help/web_hooks' => 'help#web_hooks'
  13
+
  14
+    namespace :admin do
  15
+      resources :users do 
  16
+        member do 
  17
+          put :team_update
  18
+        end
17 19
       end
18  
-    end
19  
-    resources :projects, :constraints => { :id => /[^\/]+/ } do 
20  
-      member do 
21  
-        get :team
22  
-        put :team_update
  20
+      resources :projects, :constraints => { :id => /[^\/]+/ } do 
  21
+        member do 
  22
+          get :team
  23
+          put :team_update
  24
+        end
23 25
       end
  26
+      resources :team_members, :only => [:edit, :update, :destroy]
  27
+      get 'emails', :to => 'mailer#preview'
  28
+      get 'mailer/preview_note'
  29
+      get 'mailer/preview_user_new'
  30
+      get 'mailer/preview_issue_new'
  31
+      root :to => "users#index"
24 32
     end
25  
-    resources :team_members, :only => [:edit, :update, :destroy]
26  
-    get 'emails', :to => 'mailer#preview'
27  
-    get 'mailer/preview_note'
28  
-    get 'mailer/preview_user_new'
29  
-    get 'mailer/preview_issue_new'
30  
-    root :to => "users#index"
31  
-  end
32  
-
33  
-  get "errors/githost"
34  
-  get "profile/password", :to => "profile#password"
35  
-  put "profile/password", :to => "profile#password_update"
36  
-  put "profile/reset_private_token", :to => "profile#reset_private_token"
37  
-  get "profile", :to => "profile#show"
38  
-  get "profile/design", :to => "profile#design"
39  
-  put "profile/update", :to => "profile#update"
40 33
 
41  
-  get "dashboard", :to => "dashboard#index"
42  
-  get "dashboard/issues", :to => "dashboard#issues"
43  
-  get "dashboard/merge_requests", :to => "dashboard#merge_requests"
44  
-  get "dashboard/activities", :to => "dashboard#activities"
  34
+    get "errors/githost"
  35
+    get "profile/password", :to => "profile#password"
  36
+    put "profile/password", :to => "profile#password_update"
  37
+    put "profile/reset_private_token", :to => "profile#reset_private_token"
  38
+    get "profile", :to => "profile#show"
  39
+    get "profile/design", :to => "profile#design"
  40
+    put "profile/update", :to => "profile#update"
45 41
 
46  
-  #get "profile/:id", :to => "profile#show"
  42
+    get "dashboard", :to => "dashboard#index"
  43
+    get "dashboard/issues", :to => "dashboard#issues"
  44
+    get "dashboard/merge_requests", :to => "dashboard#merge_requests"
  45
+    get "dashboard/activities", :to => "dashboard#activities"
47 46
 
48  
-  resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create, :index]
49  
-  resources :keys
  47
+    #get "profile/:id", :to => "profile#show"
50 48
 
51  
-  devise_for :users, :controllers => { :omniauth_callbacks => :omniauth_callbacks }
  49
+    resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create, :index]
  50
+    resources :keys
52 51
 
53  
-  resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
54  
-    member do
55  
-      get "team"
56  
-      get "wall"
57  
-      get "graph"
58  
-      get "files"
59  
-    end
  52
+    devise_for :users, :controllers => { :omniauth_callbacks => :omniauth_callbacks }
60 53
 
61  
-    resources :wikis, :only => [:show, :edit, :destroy, :create] do
  54
+    resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
62 55
       member do
63  
-        get "history"        
  56
+        get "team"
  57
+        get "wall"
  58
+        get "graph"
  59
+        get "files"
64 60
       end
65  
-    end
66 61
 
67  
-    resource :repository do 
68  
-      member do 
69  
-        get "branches"
70  
-        get "tags"
71  
-        get "archive"
  62
+      resources :wikis, :only => [:show, :edit, :destroy, :create] do
  63
+        member do
  64
+          get "history"        
  65
+        end
72 66
       end
73  
-    end
74  
-
75  
-    resources :deploy_keys
76  
-    resources :protected_branches, :only => [:index, :create, :destroy]
77 67
 
78  
-    resources :refs, :only => [], :path => "/" do 
79  
-      collection do 
80  
-        get "switch"
  68
+      resource :repository do 
  69
+        member do 
  70
+          get "branches"
  71
+          get "tags"
  72
+          get "archive"
  73
+        end
81 74
       end
82 75
 
83  
-      member do 
84  
-        get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
85  
-        get "blob", 
86  
-          :constraints => {
87  
-            :id => /[a-zA-Z.0-9\/_\-]+/,
88  
-            :path => /.*/
89  
-          }
90  
-
91  
-
92  
-        # tree viewer
93  
-        get "tree/:path" => "refs#tree",
94  
-          :as => :tree_file,
95  
-          :constraints => {
96  
-            :id => /[a-zA-Z.0-9\/_\-]+/,
97  
-            :path => /.*/
98  
-          }
  76
+      resources :deploy_keys
  77
+      resources :protected_branches, :only => [:index, :create, :destroy]
  78
+
  79
+      resources :refs, :only => [], :path => "/" do 
  80
+        collection do 
  81
+          get "switch"
  82
+        end
  83
+ 
  84
+        member do 
  85
+          get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
  86
+          get "blob", 
  87
+            :constraints => {
  88
+              :id => /[a-zA-Z.0-9\/_\-]+/,
  89
+              :path => /.*/
  90
+            }
  91
+
  92
+
  93
+          # tree viewer
  94
+          get "tree/:path" => "refs#tree",
  95
+            :as => :tree_file,
  96
+            :constraints => {
  97
+              :id => /[a-zA-Z.0-9\/_\-]+/,
  98
+              :path => /.*/
  99
+            }
  100
+        end
99 101
       end
100  
-    end
101 102
 
102  
-    resources :merge_requests do 
103  
-      member do 
104  
-        get :diffs
105  
-      end
  103
+      resources :merge_requests do 
  104
+        member do 
  105
+          get :diffs
  106
+        end
106 107
 
107  
-      collection do 
108  
-        get :branch_from
109  
-        get :branch_to
  108
+        collection do 
  109
+          get :branch_from
  110
+          get :branch_to
  111
+        end
110 112
       end
111  
-    end
112 113
     
113  
-    resources :snippets
114  
-    resources :hooks, :only => [:index, :new, :create, :destroy, :show] do 
115  
-      member do 
116  
-        get :test
  114
+      resources :snippets
  115
+      resources :hooks, :only => [:index, :new, :create, :destroy, :show] do 
  116
+        member do 
  117
+          get :test
  118
+        end
117 119
       end
118  
-    end
119  
-    resources :commits do 
120  
-      collection do 
121  
-        get :compare
  120
+      resources :commits do 
  121
+        collection do 
  122
+          get :compare
  123
+        end
122 124
       end
123  
-    end
124  
-    resources :team_members
125  
-    resources :issues do
126  
-      collection do
127  
-        post  :sort
128  
-        get   :search
  125
+      resources :team_members
  126
+      resources :issues do
  127
+        collection do
  128
+          post  :sort
  129
+          get   :search
  130
+        end
129 131
       end
  132
+      resources :notes, :only => [:index, :create, :destroy]
130 133
     end
131  
-    resources :notes, :only => [:index, :create, :destroy]
  134
+    root :to => "dashboard#index"
132 135
   end
133  
-  root :to => "dashboard#index"
134  
-end
  136
+end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.