Skip to content

Add "Custom Git clone URL for HTTP(S)" setting

Michael Kozono requested to merge geo/mk/add-custom-http-clone-url-root into master

What does this MR do?

Allows customization of project HTTP clone URLs. Is more flexible than !18420 (closed) but doesn't take more work to implement. The impetus for this feature is to remove the caveat at: https://gitlab.com/gitlab-org/gitlab/blob/5c21fe3/doc/administration/geo/replication/location_aware_git_url.md#configure-git-clone-urls-to-use-the-special-git-url

Unfortunately the means to specify a custom HTTP clone URL is not yet implemented. The feature request can be found at...

There is a risk in this implementation that if we want to constrain the flexibility of this field in the future, it would be difficult since people could put anything in there. If we want to constrain the field now, then it will take more work. E.g. customer fills in customschema://nonsense@foo:bar!baz//quz. We have no reasonable migration path forward from that. I think this "ok" but if anyone can foresee real danger, then we can just go with the other MR with the strict solution (only customize host) and add on to that later as needed (i.e. add a "Custom HTTP clone port" field and a "Custom HTTP clone schema" dropdown).

Closes #31949 (closed)

Screenshots

Added to Admin Area > Settings > General > Visibility and access controls below Enabled Git access protocols:

image

When set to https://mike.example.com, the clone panel for a project looks like:

image

Demo

Note: In the gif, since the clone URL is mostly hidden, in order to show the whole URL, I copied and pasted it both times into the browser location bar (I did not hit enter or otherwise attempt to actually navigate to it).

image

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Michael Kozono

Merge request reports