-
- Downloads
Fix gitlab-shell not handling relative URLs over UNIX sockets
From https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/4498#note_397401883, if you specify a relative path such as: ``` external_url 'http://gitlab.example.com/gitlab' ``` gitlab-shell doesn't have a way to pass the `/gitlab` to the host. For example, let's say we have: ``` gitlab_url: "http+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsocket" ``` If we have `/gitlab` as the relative path, how do we specify what is the UNIX socket path and what is the relative path? If we specify: ``` gitlab_url: "http+unix:///var/opt/gitlab/gitlab-workhorse.socket/gitlab ``` This is ambiguous. Is the socket in `/var/opt/gitlab/gitlab-workhorse.socket/gitlab` or in `/var/opt/gitlab/gitlab-workhorse.socket`? To fix this, this merge request adds an optional `gitlab_relative_url_root` config parameter: ``` gitlab_url: "http+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsocket" gitlab_relative_url_root: /gitlab ``` This is only used with UNIX domain sockets to disambiguate the socket and base URL path. If `gitlab_url` uses `http://` or `https://`, then `gitlab_relative_url_root` is ignored. Relates to https://gitlab.com/gitlab-org/gitlab-shell/-/issues/476
Showing
- client/client_test.go 75 additions, 52 deletionsclient/client_test.go
- client/httpclient.go 11 additions, 5 deletionsclient/httpclient.go
- client/httpclient_test.go 2 additions, 2 deletionsclient/httpclient_test.go
- client/httpsclient_test.go 1 addition, 1 deletionclient/httpsclient_test.go
- config.yml.example 4 additions, 0 deletionsconfig.yml.example
- internal/config/config.go 12 additions, 10 deletionsinternal/config/config.go
Please register or sign in to comment