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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
4016a457
Commit
4016a457
authored
Aug 23, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only include base URL in OmniAuth full_host parameter
Closes #2335
parent
97cc91d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
9 deletions
+20
-9
CHANGELOG
CHANGELOG
+1
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+18
-8
config/initializers/7_omniauth.rb
config/initializers/7_omniauth.rb
+1
-1
No files found.
CHANGELOG
View file @
4016a457
Please view this file on the master branch, on stable branches it's out of date.
Please view this file on the master branch, on stable branches it's out of date.
v 8.0.0 (unreleased)
v 8.0.0 (unreleased)
- Only include base URL in OmniAuth full_host parameter (Stan Hu)
- Only show recent push event if the branch still exists or a recent merge request has not been created (Stan Hu)
- Only show recent push event if the branch still exists or a recent merge request has not been created (Stan Hu)
- Remove satellites
- Remove satellites
- Better performance for web editor (switched from satellites to rugged)
- Better performance for web editor (switched from satellites to rugged)
...
...
config/initializers/1_settings.rb
View file @
4016a457
...
@@ -8,7 +8,7 @@ class Settings < Settingslogic
...
@@ -8,7 +8,7 @@ class Settings < Settingslogic
def
gitlab_on_standard_port?
def
gitlab_on_standard_port?
gitlab
.
port
.
to_i
==
(
gitlab
.
https
?
443
:
80
)
gitlab
.
port
.
to_i
==
(
gitlab
.
https
?
443
:
80
)
end
end
# get host without www, thanks to http://stackoverflow.com/a/6674363/1233435
# get host without www, thanks to http://stackoverflow.com/a/6674363/1233435
def
get_host_without_www
(
url
)
def
get_host_without_www
(
url
)
url
=
URI
.
encode
(
url
)
url
=
URI
.
encode
(
url
)
...
@@ -32,14 +32,12 @@ class Settings < Settingslogic
...
@@ -32,14 +32,12 @@ class Settings < Settingslogic
end
end
end
end
def
build_base_gitlab_url
base_gitlab_url
.
join
(
''
)
end
def
build_gitlab_url
def
build_gitlab_url
custom_port
=
gitlab_on_standard_port?
?
nil
:
":
#{
gitlab
.
port
}
"
(
base_gitlab_url
+
[
gitlab
.
relative_url_root
]).
join
(
''
)
[
gitlab
.
protocol
,
"://"
,
gitlab
.
host
,
custom_port
,
gitlab
.
relative_url_root
].
join
(
''
)
end
end
# check that values in `current` (string or integer) is a contant in `modul`.
# check that values in `current` (string or integer) is a contant in `modul`.
...
@@ -64,6 +62,17 @@ class Settings < Settingslogic
...
@@ -64,6 +62,17 @@ class Settings < Settingslogic
end
end
value
value
end
end
private
def
base_gitlab_url
custom_port
=
gitlab_on_standard_port?
?
nil
:
":
#{
gitlab
.
port
}
"
[
gitlab
.
protocol
,
"://"
,
gitlab
.
host
,
custom_port
]
end
end
end
end
end
...
@@ -123,6 +132,7 @@ Settings.gitlab['email_enabled'] ||= true if Settings.gitlab['email_enabled'].ni
...
@@ -123,6 +132,7 @@ Settings.gitlab['email_enabled'] ||= true if Settings.gitlab['email_enabled'].ni
Settings
.
gitlab
[
'email_from'
]
||=
"gitlab@
#{
Settings
.
gitlab
.
host
}
"
Settings
.
gitlab
[
'email_from'
]
||=
"gitlab@
#{
Settings
.
gitlab
.
host
}
"
Settings
.
gitlab
[
'email_display_name'
]
||=
"GitLab"
Settings
.
gitlab
[
'email_display_name'
]
||=
"GitLab"
Settings
.
gitlab
[
'email_reply_to'
]
||=
"noreply@
#{
Settings
.
gitlab
.
host
}
"
Settings
.
gitlab
[
'email_reply_to'
]
||=
"noreply@
#{
Settings
.
gitlab
.
host
}
"
Settings
.
gitlab
[
'base_url'
]
||=
Settings
.
send
(
:build_base_gitlab_url
)
Settings
.
gitlab
[
'url'
]
||=
Settings
.
send
(
:build_gitlab_url
)
Settings
.
gitlab
[
'url'
]
||=
Settings
.
send
(
:build_gitlab_url
)
Settings
.
gitlab
[
'user'
]
||=
'git'
Settings
.
gitlab
[
'user'
]
||=
'git'
Settings
.
gitlab
[
'user_home'
]
||=
begin
Settings
.
gitlab
[
'user_home'
]
||=
begin
...
...
config/initializers/7_omniauth.rb
View file @
4016a457
...
@@ -11,7 +11,7 @@ if Gitlab::LDAP::Config.enabled?
...
@@ -11,7 +11,7 @@ if Gitlab::LDAP::Config.enabled?
end
end
end
end
OmniAuth
.
config
.
full_host
=
Settings
.
gitlab
[
'url'
]
OmniAuth
.
config
.
full_host
=
Settings
.
gitlab
[
'
base_
url'
]
OmniAuth
.
config
.
allowed_request_methods
=
[
:post
]
OmniAuth
.
config
.
allowed_request_methods
=
[
:post
]
#In case of auto sign-in, the GET method is used (users don't get to click on a button)
#In case of auto sign-in, the GET method is used (users don't get to click on a button)
OmniAuth
.
config
.
allowed_request_methods
<<
:get
if
Gitlab
.
config
.
omniauth
.
auto_sign_in_with_provider
.
present?
OmniAuth
.
config
.
allowed_request_methods
<<
:get
if
Gitlab
.
config
.
omniauth
.
auto_sign_in_with_provider
.
present?
...
...
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