Commit 63760985 authored by Kirill Smelkov's avatar Kirill Smelkov Committed by Alain Takoudjou

NXD Make HTTP to be the default clone protocol

Both fetch and push are possible over https, which is selected by http if
gitlab was configured to use https in external url.

This way to reduce security vectors and possible ways to interact with gitlab
we use https only without ssh at all.
parent 6d90a6a3
...@@ -477,6 +477,8 @@ module ProjectsHelper ...@@ -477,6 +477,8 @@ module ProjectsHelper
end end
def default_url_to_repo(project = @project) def default_url_to_repo(project = @project)
# always HTTP:
return project.http_url_to_repo
case default_clone_protocol case default_clone_protocol
when 'ssh' when 'ssh'
project.ssh_url_to_repo project.ssh_url_to_repo
...@@ -490,8 +492,9 @@ module ProjectsHelper ...@@ -490,8 +492,9 @@ module ProjectsHelper
end end
def default_clone_protocol def default_clone_protocol
# always HTTP:
if allowed_protocols_present? if allowed_protocols_present?
enabled_protocol "http"
else else
extra_default_clone_protocol extra_default_clone_protocol
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment