Allow protocol selection for Go vanity URLs

Problem to solve

Currently go get vanity URLs are always HTTPs URLs, unless HTTPs is disabled, then they are SSH URLs. (Code)

This means if you are using an SSH workflow, and only have an SSH key set up, you can't go get your dependencies.

Proposal

I'm not actually sure how to solve that in a way that is compatible with everyone's workflow.

For my current workflow it would be enough to just change the default to SSH - which is what I currently sadly do in my local GitLab installation after every update.

Another idea I had was to extend the "Enabled Git access protocols" setting like this:

image

This may or may no apply to the default_clone_protocol for the project details page as well, which currently uses another logic: show SSH if the current user has an SSH key set up, otherwise HTTPs. This logic wouldn't work for go get URLs because there is no current user.

The most flexible way for Omnibus installations, and the way I would prefer, would be a setting in /etc/gitlab/gitlab.rb. However, for GitLab.com it might make more sense to have this as a per-project setting?

Edited Jun 25, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading