Commit 3e7e0120 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.

Conflicts:
	app/helpers/projects_helper.rb
parent 28534389
......@@ -340,6 +340,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
......@@ -349,8 +351,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
extra_default_clone_protocol
end
......
  • @kirr @alain.takoudjou while looking at the admin settings area, I noticed that there's now an option to control which protocols are available:

    image

    I don't know if we wrote this patch because this option did not exist at the time or if there was something wrong for us with this option.

  • @jerome thanks for heads up. I wrote the patch because there was no such option at that time.

  • Thanks @kirr next time we revisit this we can maybe drop the patch and just use the configuration, if it's really enough for us.

  • Good idea.

  • Thanks @kirr next time we revisit this we can maybe drop the patch and just use the configuration, if it's really enough for us.

    Yes Jerome, I saw the options last week. I will be good to use it instead of patch, I'm testing it on clone instance.

  • Tested on https://softinst90376.host.vifib.net/. Enable Only HTTP(S) completely removed ssh option on interface. This allow to remove 3 patches: 02761a98 433d2b36 faafaa98

  • Good. @alain.takoudjou thanks for checking.

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