Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Custom Gitlab Instance #965

Merged
merged 1 commit into from
Jun 3, 2024
Merged

Support Custom Gitlab Instance #965

merged 1 commit into from
Jun 3, 2024

Conversation

4xpl0r3r
Copy link
Contributor

Summary:
This PR makes the code supporting custom Gitlab instance, merged 3 GITLAB_ENTERPRISE_* configs into 1 GITLAB_HOST.

Description for the changelog:

  1. merge 3 GITLAB_ENTERPRISE_* configs into 1 GITLAB_HOST.
  2. add the host parameter for Gitlab clientOptions to support custom Gitlab instances.

Other info:
I have tested the code, it works well with my community edition gitlab instance. It seems like the config names GITLAB_ENTERPRISE_*, which are similar to the Github's, are not proper names for Gitlab because there could be both community edition and enterprise edition of custom Gitlab. Therefore, I merged these 3 configs into 1 GITLAB_HOST.

Have a nice day.

Signed-off-by: Kainan(Kris) Zhang <4xpl0r3r@gmail.com>
@4xpl0r3r
Copy link
Contributor Author

This is my example of env file

GITLAB_CLIENT_ID=0000000000000000000000000000000
GITLAB_CLIENT_SECRET=gloas-0000000000000000000000000000000
GITLAB_SCOPE=read_user read_repository write_repository profile read_api api
GITLAB_REDIRECT_URI=http://threat-dragon-instance/api/oauth/return
GITLAB_HOST=http://gitlab-instance

@4xpl0r3r
Copy link
Contributor Author

#947 Ref

@jgadsden jgadsden self-requested a review May 31, 2024 15:24
@jgadsden jgadsden added enhancement New feature or request version-2.3 labels May 31, 2024
@jgadsden jgadsden added this to the Version 2.3 milestone May 31, 2024
@jgadsden
Copy link
Collaborator

apologies for being slow to review this @4xpl0r3r , the pull request is much appreciated and I hope to look at it this weekend

@4xpl0r3r
Copy link
Contributor Author

apologies for being slow to review this @4xpl0r3r , the pull request is much appreciated and I hope to look at it this weekend

Don’t mind, no problem.

Copy link
Collaborator

@jgadsden jgadsden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@4xpl0r3r I thought we needed the env variables 'ENTERPRISE_HOSTNAME', 'ENTERPRISE_PROTOCOL' and 'ENTERPRISE_PORT' for running gitlab enterprise?
This is being discussed in #947 if I understand correctly @steve-winter and @fdellwing ?

@4xpl0r3r
Copy link
Contributor Author

4xpl0r3r commented Jun 3, 2024

@4xpl0r3r I thought we needed the env variables 'ENTERPRISE_HOSTNAME', 'ENTERPRISE_PROTOCOL' and 'ENTERPRISE_PORT' for running gitlab enterprise? This is being discussed in #947 if I understand correctly @steve-winter and @fdellwing ?

I believe we should merge GITLAB_ENTERPRISE_* into GITLAB_HOST because of the following reasons:

  1. There could be both community and enterprise edition of self-hosted gitlab instances. ENTERPRISE might be misleading.
  2. The underlaying gitbeaker is using clientOptions.auth['host'] to indicate the Gitlab instance to connect, pass the direct host option could be more clear than 3 options.

Just my personal understanding, it is ok to keep the original names in case there is any concern I missed.

@fdellwing
Copy link

I totally missed this PR, so sorry for the late response and thanks for the ping.

I tested the PR and it seems to work fine.

I'm in support of merging the 3 keys into GITLAB_HOST. There was no need to use 3 keys in the first place, as all they there used for was to construct the host itself.

@jgadsden
Copy link
Collaborator

jgadsden commented Jun 3, 2024

OK, thanks @fdellwing and @4xpl0r3r I will go ahead and merge
Could either of you provide a step by step on how to access GitLab? We have an open issue in the documentation: Add step by step for gitlab access #81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request version-2.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants