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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
a410bc12
Commit
a410bc12
authored
Aug 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4670 from anezi/relative-url-patch
More fixes for supporting Relative URL
parents
1a3ca6b1
39d8a64d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
4 deletions
+18
-4
app/assets/javascripts/wall.js.coffee
app/assets/javascripts/wall.js.coffee
+1
-1
app/uploaders/attachment_uploader.rb
app/uploaders/attachment_uploader.rb
+1
-1
config/application.rb
config/application.rb
+4
-0
config/gitlab.yml.example
config/gitlab.yml.example
+1
-0
config/initializers/session_store.rb
config/initializers/session_store.rb
+2
-1
lib/gitlab/backend/grack_auth.rb
lib/gitlab/backend/grack_auth.rb
+9
-1
No files found.
app/assets/javascripts/wall.js.coffee
View file @
a410bc12
...
...
@@ -64,7 +64,7 @@ class Wall
template
=
template
.
replace
(
'{{text}}'
,
simpleFormat
(
note
.
body
))
if
note
.
attachment
file
=
'<i class="icon-paper-clip"/><a href="/files/note/'
+
note
.
id
+
'/'
+
note
.
attachment
+
'">'
+
note
.
attachment
+
'</a>'
file
=
'<i class="icon-paper-clip"/><a href="
'
+
gon
.
relative_url_root
+
'
/files/note/'
+
note
.
id
+
'/'
+
note
.
attachment
+
'">'
+
note
.
attachment
+
'</a>'
else
file
=
''
template
=
template
.
replace
(
'{{file}}'
,
file
)
...
...
app/uploaders/attachment_uploader.rb
View file @
a410bc12
...
...
@@ -21,7 +21,7 @@ class AttachmentUploader < CarrierWave::Uploader::Base
end
def
secure_url
"/files/
#{
model
.
class
.
to_s
.
underscore
}
/
#{
model
.
id
}
/
#{
file
.
filename
}
"
Gitlab
.
config
.
gitlab
.
relative_url_root
+
"/files/
#{
model
.
class
.
to_s
.
underscore
}
/
#{
model
.
id
}
/
#{
file
.
filename
}
"
end
def
file_storage?
...
...
config/application.rb
View file @
a410bc12
...
...
@@ -67,5 +67,9 @@ module Gitlab
# Version of your assets, change this if you want to expire all your assets
config
.
assets
.
version
=
'1.0'
# Uncomment this if you are using a subdirectory
# Note that ENV['RAILS_RELATIVE_URL_ROOT'] in config/puma.rb may need to be changed
# config.relative_url_root = "/gitlab"
end
end
config/gitlab.yml.example
View file @
a410bc12
...
...
@@ -21,6 +21,7 @@ production: &base
# WARNING: This feature is no longer supported
# Uncomment and customize to run in non-root path
# Note that ENV['RAILS_RELATIVE_URL_ROOT'] in config/puma.rb may need to be changed
# You need to uncomment config.relative_url_root in config/application.rb
# relative_url_root: /gitlab
# Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
...
...
config/initializers/session_store.rb
View file @
a410bc12
...
...
@@ -2,7 +2,8 @@
Gitlab
::
Application
.
config
.
session_store
:cookie_store
,
key:
'_gitlab_session'
,
secure:
Gitlab
::
Application
.
config
.
force_ssl
,
httponly:
true
httponly:
true
,
path:
(
Rails
.
application
.
config
.
relative_url_root
.
nil?
)
?
'/'
:
Rails
.
application
.
config
.
relative_url_root
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
...
...
lib/gitlab/backend/grack_auth.rb
View file @
a410bc12
...
...
@@ -15,7 +15,15 @@ module Grack
@auth
=
Request
.
new
(
env
)
# Need this patch due to the rails mount
# Need this if under RELATIVE_URL_ROOT
unless
Gitlab
.
config
.
gitlab
.
relative_url_root
.
empty?
# If website is mounted using relative_url_root need to remove it first
@env
[
'PATH_INFO'
]
=
@request
.
path
.
sub
(
Gitlab
.
config
.
gitlab
.
relative_url_root
,
''
)
else
@env
[
'PATH_INFO'
]
=
@request
.
path
end
@env
[
'SCRIPT_NAME'
]
=
""
auth!
...
...
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