-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CHE-14527: Support git clone for repos with self-signed SSL certs #15084
Conversation
Signed-off-by: Vitalii Parfonov <[email protected]>
Signed-off-by: Vitalii Parfonov <[email protected]>
Signed-off-by: Vitalii Parfonov <[email protected]>
Signed-off-by: Vitalii Parfonov <[email protected]>
Signed-off-by: Vitalii Parfonov <[email protected]>
Signed-off-by: Vitalii Parfonov <[email protected]>
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Single User on K8S (minikube v1.1.1) ℹ️ |
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
Co-Authored-By: Sergii Leshchenko <[email protected]>
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Single User on K8S (minikube v1.1.1) ℹ️ |
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general LGTM.
The idea with multiple self-signed certs definitely can be implemented in the scope of a separate issue if it's valid and important.
Let me know when my inline comments are addressed and PR is ready to review.
|
||
# If git-self-signed-cert is used then configure Che Server with certificate content | ||
# to propagate it to trust store | ||
{{- if .Values.global.useGitSelfSignedCerts }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can with minimal changes support multiple self-signed certs for different hosts?
On one hand it's quite easy to imagine config map like
data:
my-git.com:9232: --BEGINCERT adssaxxxxxx --
my-another-git.org:3716: --BEGINCERT adssaxxxxxx --
On another hand, it's not clear how to inject each property to the server. Ways I see:
- Just configure SecretName for Che Server, and then Che Server will ready it from K8s API and propagate to workspaces.
- Mount whole secret as a folder, where files names are hosts, and content - is ca.cert. And let Che Server know where these folder is mount.
private final PreviewUrlExposer<KubernetesEnvironment> previewUrlExposer; | ||
private VcsSslCertificateProvisioner vcsSslCertificateProvisioner; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add final
static final String CHE_GIT_SELF_SIGNED_CERT_CONFIG_MAP_SUFFIX = "-che-git-self-signed-cert"; | ||
static final String CHE_GIT_SELF_SIGNED_VOLUME = "che-git-self-signed-cert"; | ||
static final String CERT_MOUNT_PATH = "/etc/che/git/cert/"; | ||
static final String CA_CERT_FILE = "cert.pem"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate on what is the purpose of injecting ca.crt
and propagate it as cert.pem
.
Would not it be more straightforward to propagate certificate as initially configured ca.crt
?
this.host = host; | ||
} | ||
|
||
/** @return true only if */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true only if what? 😄
|
||
public String getGitServerHost() { | ||
if (isNullOrEmpty(host)) { | ||
return nullToEmpty(host); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate more about what will happen if host is empty? Is it a valid case? Then git will use such a certificate for everything?
return CERT_MOUNT_PATH + CA_CERT_FILE; | ||
} | ||
|
||
public String getGitServerHost() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not expect from this method to return server host with escaped "
.
I think it's specific to gitconfig constructing and you append "
in GitConfigProvisioner
instead
@@ -1,10 +1,13 @@ | |||
{ | |||
"name": "@eclipse-che/api", | |||
"version": "7.4.0-SNAPSHOT", | |||
"version": "7.4.0-7a47579", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems it's not related to changes that you described in PR description
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
Signed-off-by: Vitalii Parfonov <[email protected]>
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Single User on K8S (minikube v1.1.1) ℹ️ |
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Single User on K8S (minikube v1.1.1) ℹ️ |
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
What does this PR do?
Support git clone for repos with self-signed SSL certs
CHE-14527: Support git clone for repos with self-signed SSL certs
How it works:
For testing on my laptop I setup local git server which support cloning my https (e.g. https://gogs.io/) pretty easy for installation.
After successfully deploy Eclipse on minikube need to execute next command:
kubectl create configmap che-git-self-signed-cert --from-file=ca.crt --from-literal=githost={host}:{port} -n=che
where:
Now you can create and start new workspace.
On each container of your workspace will be mount special volume that contains file with your self-signed certificate and to the
gitconfig
section with information about git server host and path to the certificate. E.g.What issues does this PR fix or reference?
#14527
Release Notes
Docs PR