Provide information on how to use with a typical self hosted GitLab

Created by: Gaibhne

Describe the feature or problem you'd like to solve I've only spent half an hour researching, but I could not figure out how to get GLab to work with our not all that non-standard GL CE instance. Scattered through some issues were comments about how to adjust a config to support either a custom port or plain HTTP, but none of the resources I found gave me enough to fight my way through glab auth login without it aborting due to errors over incorrectly parsing our hostname (which looks like http://1.2.3.4:5678), and the advice I found seemed to expect a working config where one just wanted to change the port, but due to never being able to finish the original auth attempt, I have no config to modify.

Auth attemps played out like this:

[me@pc ~]$ glab auth login
? What GitLab instance do you want to log into? GitLab Self-hosted Instance
X Sorry, your reply was invalid: invalid hostname "http://1.2.3.4:10080"
? GitLab hostname: 1.2.3.4
? API hostname: 1.2.3.4
- Logging into 1.2.3.4

Tip: you can generate a Personal Access Token here https://1.2.3.4/-/profile/personal_access_tokens
The minimum required scopes are 'api' and 'write_repository'.
? Paste your authentication token: ********************
? Choose default git protocol HTTP
? Authenticate Git with your GitLab credentials? Yes
? Choose host API protocol HTTP
- glab config set -h 1.2.3.4 git_protocol http
✓ Configured git protocol
- glab config set -h 1.2.3.4 api_protocol http
✓ Configured API protocol
error using api: GET http://1.2.3.4/api/v4/user: 404 failed to parse unknown error format

[...]

[me@pc]$ glab auth login --hostname 1.2.3.4:10080
- Logging into 1.2.3.4:10080

Tip: you can generate a Personal Access Token here https://1.2.3.4:10080/-/profile/personal_access_tokens
The minimum required scopes are 'api' and 'write_repository'.
? Paste your authentication token: ********************
? Choose default git protocol SSH
- glab config set -h 1.2.3.4:10080 git_protocol ssh
✓ Configured git protocol
- glab config set -h 1.2.3.4:10080 api_protocol https
✓ Configured API protocol
error using api: Get "https://1.2.3.4:10080/api/v4/user": http: server gave HTTP response to HTTPS client

[...]

[me@pc]$ glab auth login --hostname http://1.2.3.4:10080
error parsing --hostname: invalid hostname "http://1.2.3.4:10080"

You can see how there are various instances of it not parsing the url correctly, or instantly discarding part of it.

I stumbled my way through about a dozen issues and attempted to copy and paste together a working config file, but all attempts left me with:

[me@pc]$ glab issue list
none of the git remotes configured for this repository points to a known GitLab host. Please use `glab auth login` to authenticate and configure a new host for glab

with the exception of attempting to supply the repo manually, which again resulted in part of the URL being discarded and replaced by https, as well as the port getting discarded:

[me@pc]$ glab issue list --repo http://1.2.3.4:10080/ourrepo
Get "https://1.2.3.4/api/v4/projects/ourrepo/issues?in=title%2Cdescription&page=1&per_page=30&state=opened": dial tcp 1.2.3.4:443: connect: connection refused

Propose a Solution As I was unable to figure out whether using GLab with a custom port on plain HTTP is possible at all, I don't know if a solution exists, but at the very least, a paragraph about the lack of support (or a description of the solution) should be added to the documentation.

Additional context

[me@pc]$ glab --version
glab version 1.21.1 (2021-09-28)
Edited by Kai Armstrong