Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
21e55ca3
Commit
21e55ca3
authored
Dec 28, 2012
by
Chris Frohoff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added RAILS_RELATIVE_URL_ROOT support
parent
e9394c48
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
7 deletions
+16
-7
app/mailers/notify.rb
app/mailers/notify.rb
+1
-0
config.ru
config.ru
+4
-1
config/gitlab.yml.example
config/gitlab.yml.example
+3
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+3
-1
config/routes.rb
config/routes.rb
+1
-1
config/unicorn.rb.example
config/unicorn.rb.example
+4
-0
lib/gitlab/backend/grack_auth.rb
lib/gitlab/backend/grack_auth.rb
+0
-4
No files found.
app/mailers/notify.rb
View file @
21e55ca3
...
...
@@ -6,6 +6,7 @@ class Notify < ActionMailer::Base
default_url_options
[
:host
]
=
Gitlab
.
config
.
gitlab
.
host
default_url_options
[
:protocol
]
=
Gitlab
.
config
.
gitlab
.
protocol
default_url_options
[
:port
]
=
Gitlab
.
config
.
gitlab
.
port
if
Gitlab
.
config
.
gitlab_on_non_standard_port?
default_url_options
[
:script_name
]
=
Gitlab
.
config
.
gitlab
.
relative_url_root
default
from:
Gitlab
.
config
.
gitlab
.
email_from
...
...
config.ru
View file @
21e55ca3
# This file is used by Rack-based servers to start the application.
require
::
File
.
expand_path
(
'../config/environment'
,
__FILE__
)
run
Gitlab
::
Application
map
ENV
[
'RAILS_RELATIVE_URL_ROOT'
]
||
"/"
do
run
Gitlab
::
Application
end
config/gitlab.yml.example
View file @
21e55ca3
...
...
@@ -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
...
...
config/initializers/1_settings.rb
View file @
21e55ca3
...
...
@@ -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
)
...
...
config/routes.rb
View file @
21e55ca3
...
...
@@ -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
...
...
config/unicorn.rb.example
View file @
21e55ca3
# 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
...
...
lib/gitlab/backend/grack_auth.rb
View file @
21e55ca3
...
...
@@ -17,10 +17,6 @@ module Grack
# Pass Gitolite update hook
ENV
[
'GL_BYPASS_UPDATE_HOOK'
]
=
"true"
# Need this patch due to the rails mount
@env
[
'PATH_INFO'
]
=
@request
.
path
@env
[
'SCRIPT_NAME'
]
=
""
# Find project by PATH_INFO from env
if
m
=
/^\/([\w\.\/-]+)\.git/
.
match
(
@request
.
path_info
).
to_a
self
.
project
=
Project
.
find_with_namespace
(
m
.
last
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment