Commit 4232291b 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 61244ce4
......@@ -244,6 +244,8 @@ module ProjectsHelper
end
def default_url_to_repo(project = @project)
# always HTTP:
return project.http_url_to_repo
case default_clone_protocol
when 'ssh'
project.ssh_url_to_repo
......@@ -253,8 +255,11 @@ module ProjectsHelper
end
def default_clone_protocol
if allowed_protocols_present?
enabled_protocol
#if allowed_protocols_present?
# enabled_protocol
# always HTTP:
if true # !current_user || current_user.require_ssh_key?
"http"
else
if !current_user || current_user.require_ssh_key?
gitlab_config.protocol
......
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