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

Include ssh keys and tls certs into gitconfig #613

Closed
Tracked by #20830
sleshchenko opened this issue Sep 24, 2021 · 7 comments
Closed
Tracked by #20830

Include ssh keys and tls certs into gitconfig #613

sleshchenko opened this issue Sep 24, 2021 · 7 comments
Assignees
Labels
sprint/current Is assigned to issues which are planned to work on in the current team sprint
Milestone

Comments

@sleshchenko
Copy link
Member

Description

Currently, DWO generates gitconfig with personal access tokens, but it does not propagate SSH keys secrets, nor TLS certs.

@max-cx
Copy link

max-cx commented Nov 15, 2021

Hi, a question to the assignee of this issue:

Will the outcome require any changes to the relevant content of the Installation Guide or Administration Guide or End-user Guide?

Yes/No?

@JPinkney
Copy link
Contributor

SSH support can be enabled by:

cat > /tmp/gitconfig <<EOF
host *
  IdentityFile /.ssh/id_rsa
  StrictHostKeyChecking = no
EOF

kubectl create secret generic git-ssh-key \
  --from-file=id_rsa=/path/to/private-key \
  --from-file=id_rsa.pub=/path/to/public-key \
  --from-file=config=/tmp/gitconfig

kubectl patch secret git-ssh-key --type merge -p \
  '{"metadata": {
     "labels": {
        "controller.devfile.io/mount-to-devworkspace": "true",
        "controller.devfile.io/watch-secret": "true"
      }, 
      "annotations": {
        "controller.devfile.io/mount-path": "/.ssh/"
      }
    }
  }'

TLS cert support can be enabled by:

apiVersion: v1
kind: ConfigMap
metadata:
  name: tls-configmap-test
  namespace: devworkspace-controller
  labels:
    "controller.devfile.io/git-tls-credential": "true"
    "controller.devfile.io/watch-configmap": "true"
  annotations:
    controller.devfile.io/mount-path: /home/theia/tls
data:
  host: https://github.com # this is optional, if its not set then the certificate will be applied to all git servers
  certificate: asdfasdfasdfasdfasdfasdfasdfasdf # this is the public certificate that you can download through your browser

@ibuziuk
Copy link
Contributor

ibuziuk commented Dec 1, 2021

@skabashnyuk my understanding that this issue is done from the DevWorkspace perspective, the follow-up work should be part of eclipse-che/che#20832

@metlos
Copy link
Contributor

metlos commented Dec 2, 2021

Researching this, I could not find a mention of the git-tls-credential label anywhere in the DWO codebase main branch... Has the support for this been merged already?

@ibuziuk
Copy link
Contributor

ibuziuk commented Dec 6, 2021

@skabashnyuk
Copy link

@ibuziuk is there something left for this issue?

@JPinkney
Copy link
Contributor

No, my PR as been merged a bit ago I just forgot to close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sprint/current Is assigned to issues which are planned to work on in the current team sprint
Projects
None yet
Development

No branches or pull requests

7 participants