Skip to content

unable to access repository present inside an organization's gitlab account (visibility private) #20962

Closed

Description

@Divine1

Summary

The project repository i'm working on is maintained under gitlab.company.com. The gitlab.company.com is accessible only within the corporate network and sso is required to login into the gitlab.company.com. i can add ssh keys/generate accessTokens but this will be valid only inside corporate network.

The visibility of the project repository is private

i'm maintaining thedevfile.yaml inside the same project repository.

i have eclipseche installed in minikube. The installation is successful and i'm able to clone a public / private github repository in this eclipseche instance.

the problem i face is with private gitlab.company.com repository that is accessible only within corporate network.

i get below error message when i try to open the workspace.

Please let me know how to resolve this issue

image

Relevant information

No response

Activity

  1. added
    kind/question
    on Dec 22, 2021
  2. added
    status/need-triage
    on Dec 22, 2021
  3. skabashnyuk commented on Dec 22, 2021

    @skabashnyuk
    Contributor

    @Divine1 thank you for the question. At this stage, it's important to decide the flow you want to follow.

    • Is it OAuth2 integration - then you can use factories with automated authorization flow.
    • SSH flow - then you have to create a workspace, set up ssh keys. After that, you'll be able to do clone/push.

    Wich way do you want to follow?

  4. Divine1 commented on Dec 22, 2021

    @Divine1
    Author

    @skabashnyuk i would like to follow ssh flow.

  5. skabashnyuk commented on Dec 22, 2021

    @skabashnyuk
    Contributor

    @skabashnyuk i would like to follow ssh flow.

    Ok. Now, what Che version do you have, and what workspace engine are you using. Che7 or devWrksapce, Devfile v1 or Devfile v2?

    is accessible only within the corporate network

    Does that mean you need to set up HTTP proxy?

  6. Divine1 commented on Dec 22, 2021

    @Divine1
    Author

    @skabashnyuk
    image: quay.io/eclipse/che-server:7.40.2
    devfile v1

    HTTP proxy is not required.

    Che7 or devWrksapce - what is the difference? i have installed eclipse-che via minikube. i'm with the understanding that both are same

    i installed via below link

    https://www.eclipse.org/che/docs/che-7/installation-guide/installing-che-on-minikube/

  7. skabashnyuk commented on Dec 22, 2021

    @skabashnyuk
    Contributor

    I found only this guide on how to mount a file https://www.eclipse.org/che/docs/che-7/end-user-guide/mounting-a-secret-as-a-file-or-an-environment-variable-into-a-workspace-container/. If you are able to create secrets in your k8s namespace I think you can follow it to mount ssh files.

    @vinokurig @svor do you remember if we have documentation about how to manage ssh keys from the Theia?

  8. Divine1 commented on Dec 22, 2021

    @Divine1
    Author

    @skabashnyuk i have access to create secrets in my k8s namespace.

    i have a doubt in the value present for settings.xml in the docs.

    As per the docs, Should i encode(base64) all the data present inside settings.xml and paste it as a value for settings.xml ?

    data:
      settings.xml: <base64 encoded data content here>
    
    

    image

    incase of ssh public key, should i encode(base64) the content of publickey file and put it as below ?

    data:
      id_rsa.pub: <base64 encoded data content here>
    
    
  9. vinokurig commented on Dec 22, 2021

    @vinokurig
    Contributor
  10. removed
    status/need-triage
    on Dec 22, 2021
  11. skabashnyuk commented on Dec 22, 2021

    @skabashnyuk
    Contributor

    incase of ssh public key, should i encode(base64) the content of publickey file and put it as below ?

    I think you need both. git client inside the Theia container has to have access to the private par. The public part would be checked on the opposite side (on gitlab)

    However @vinokurig 's variant I like more.

  12. Divine1 commented on Dec 22, 2021

    @Divine1
    Author

    incase of ssh public key, should i encode(base64) the content of publickey file and put it as below ?

    I think you need both. git client inside the Theia container has to have access to the private par. The public part would be checked on the opposite side (on gitlab)

    However @vinokurig 's variant I like more.

    the devfile.yaml will also be present inside the repository of gitlab.company.com with visibility private. Will this approach mentioned in this or this work for my scenario?

    @skabashnyuk

  13. skabashnyuk commented on Dec 22, 2021

    @skabashnyuk
    Contributor

    the devfile.yaml will also be present inside the repository of gitlab.company.com with visibility private. Will this approach mentioned in this or this work for my scenario?

    I think you are referring to factory flow. It's not the silky smooth player with ssh way scenario.
    I recommend considering OAuth integration flow in this case.

  14. Divine1 commented on Dec 22, 2021

    @Divine1
    Author

    @skabashnyuk could you share the doc link for OAuth integration flow ?

  15. nils-mosbach commented on Dec 22, 2021

    @nils-mosbach

    @Divine1 Since we had the same issue, I can share some information what works in our case. :) We're quite happy with the OAuth Integration flow. Since i wrote down everything for another ticket, here's a quick summary what I did to get it working.

    Have a look here: https://www.eclipse.org/che/docs/che-7/administration-guide/configuring-authorization/#configuring-gitlab-oauth2_che

    My intention was to allow cloning private projects for all of our developers using GitLab OAuth without the need of defining SSH-Tokens or Kubernetes secrets on user side. So basically add a button to all GitLab Project-Pages (like "Open in Che") which will does the trick (Login, clone, etc.) without user interaction. Git-urls in devfiles must be http-only of course.

    Thanks to the work of @skabashnyuk it now works like a charm in v7.40. Thanks a lot! (#20790)

    We've setup GitLab/Keycloak/Che as described in the documentation.

    Our Keycloak Identity Provider config:
    image

    I installed Che using chectl. Deployment: Operator.

    operator-config.yaml:

    spec:
      server:
        tlsSupport: true
        customCheProperties:
          CHE_SYSTEM_SUPER__PRIVILEGED__MODE: "true"
          CHE_LIMITS_USER_WORKSPACES_RUN_COUNT: "-1"
          CHE_LIMITS_WORKSPACE_IDLE_TIMEOUT: "9000000" 
          CHE_SYSTEM_ADMIN__NAME: mosbachn
          CHE_INTEGRATION_GITLAB_SERVER__ENDPOINTS: "https://git.company.dev/"
          CHE_INTEGRATION_GITLAB_OAUTH__ENDPOINT: "https://git.company.dev/"
        cheImagePullPolicy: Always
        devfileRegistryPullPolicy: Always
        pluginRegistryPullPolicy: Always
        
      database:
        externalDb: false
        postgresImagePullPolicy: Always
    
      storage:
        pvcStrategy: per-workspace
        pvcClaimSize: '5Gi'
    
      auth:
          externalIdentityProvider: true
          identityProviderURL: 'https://auth.company.dev/auth'
          identityProviderRealm: 'git-dev'
          identityProviderClientId: 'che'
          openShiftoAuth: false
    
      k8s:
          ingressDomain: 'company.dev'
          ingressStrategy: 'multi-host'
          tlsSecretName: 'tls-company-dev'

    That's it. Nice and smooth without dealing with SSH tokens! :)

  16. Divine1 commented on Dec 22, 2021

    @Divine1
    Author

    @nils-mosbach thank you for details. this is very helpful.. i have below doubt.

    I installed Che using chectl. Deployment: Operator.
    
    operator-config.yaml:
    
    

    i have already installed eclipse-che using chectl in minikube for exploring the capabilities

    https://www.eclipse.org/che/docs/che-7/installation-guide/installing-che-on-minikube/

    in this case, how to update operator-config.yaml which you have shared?

  17. nils-mosbach commented on Dec 22, 2021

    @nils-mosbach

    Depends on your configuration. --che-operator-cr-patch-yaml merges the changes. That's what we use for updating our configuration on a rancher provisioned cluster. Not sure if --skip-kubernetes-health-check still necessary, there was an issue with ranchers rbac implementation a while ago.

    chectl server:update  \
      --deployment-name=dev-studio \
      --platform=k8s \
      --installer=operator \
      --che-operator-cr-patch-yaml=./operator-config.yaml  \
      --chenamespace=dev-studio \
      --skip-kubernetes-health-check \
      --batch
    

    If users from OIDC are linked i would start fresh, just in case...

  18. Divine1 commented on Dec 22, 2021

    @Divine1
    Author

    Depends on your configuration. --che-operator-cr-patch-yaml merges the changes. That's what we use for updating our configuration on a rancher provisioned cluster. Not sure if --skip-kubernetes-health-check still necessary, there was an issue with ranchers rbac implementation a while ago.

    chectl server:update  \
      --deployment-name=dev-studio \
      --platform=k8s \
      --installer=operator \
      --che-operator-cr-patch-yaml=./operator-config.yaml  \
      --chenamespace=dev-studio \
      --skip-kubernetes-health-check \
      --batch
    

    If users from OIDC are linked i would start fresh, just in case...

    i will try this out and share the feedback.

  19. Divine1 commented on Jan 3, 2022

    @Divine1
    Author

    @nils-mosbach

    my project repository is present in https://git.company.com/ can be accessed only within corporate network (using global protect software ). i have installed the eclipse-che on minikube cluster in my personal laptop

    the installation is successful. To verify if all components are working fine i opened a sample project in eclipse-che workspace
    image

    the vscode editor opened successfully. but when i try to clone a repository from the https://git.company.com/ link, by opening a terminal in vscode launched via eclipse-che, i get below 443 error (error is shown in vscode terminal in screenshot). please let me know how to overcome this network issue.

    image

    @skabashnyuk

  20. skabashnyuk commented on Jan 3, 2022

    @skabashnyuk
    Contributor

    my project repository is present in https://git.company.com/ can be accessed only within corporate network (using global protect software ).

    Is this an HTTP proxy?
    CC @tolusha

  21. Divine1 commented on Jan 3, 2022

    @Divine1
    Author

    my project repository is present in https://git.company.com/ can be accessed only within corporate network (using global protect software ).

    Is this an HTTP proxy? CC @tolusha

    i dont use any proxy urls.

    i have to connect my laptop using global protect to be inside the corporate network inorder to access the https://git.company.com/ website.

    i have installed eclipse-che in a minikube cluster in my laptop, but looks like eclipse-che is not able to make use of the corporate network @tolusha @skabashnyuk

  22. skabashnyuk commented on Jan 3, 2022

    @skabashnyuk
    Contributor

    i have to connect my laptop using global protect to be inside the corporate network inorder to access the https://git.company.com/ website.

    Can you try to run any container (without using che) with git inside and try to clone https://git.company.com/. Does it work for you?

  23. Divine1 commented on Jan 4, 2022

    @Divine1
    Author

    @skabashnyuk

    yes i'm able to clone a repository fromhttps://git.company.com/ inside the ubuntu docker container with corporate network enabled (i was able to clone by creating a personal accesstoken in gitlab.company.com as my organization uses ssoBasedLogin inorder to login into gitlab)

    i disabled corporate network and tried to clone a repository fromhttps://git.company.com/ inside the ubuntu docker container. but this time the cloning process failed fatal: unable to access .... couldn't resolve host .....

  24. tolusha commented on Jan 5, 2022

    @tolusha
    Contributor

    @Divine1
    Does accessing to the repository require any certificates?
    Any specific git configuration inside ubuntu docker container for clonning?

  25. Divine1 commented on Jan 11, 2022

    @Divine1
    Author

    @skabashnyuk @tolusha @nils-mosbach

    i used the private accestoken to resolve this issue. may be this is not the best solution compared to the solution suggested by @nils-mosbach . but i was not able to make the solution shared by @nils-mosbach to work....

    Thank you everybody for the support . Takecare

    i'm facing few other problems, will created another ticket for it.

    https://www.eclipse.org/che/docs/che-7/end-user-guide/authenticating-on-scm-server-with-a-personal-access-token/#configuring_gitlab_authentication_che

    closing this ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions