Open pversteijnen opened 6 years ago
Hi Pieter,
It's interesting to see that the proxy settings do work for GitHub, but not for GitLab. Have you a concrete example of the options you're using (after obfuscation of sensitive data of course)?
As for a PR, there is of course no issue ; it will be welcome. Just note that I'll be in holidays in the next two weeks so it'll have to wait.
Best regards, Damien.
We are just trying to setup the connection between Ontrack and GitLab using the configuration section in Ontrack as administrator. Eventually we get a connection timeout. After viewing the log files and experiments using curl or wget we narrowed it down to the GitLab extention not setting the proxy on the GitLabApi object. In this file https://github.com/nemerosa/ontrack/blob/master/ontrack-extension-gitlab/src/main/java/net/nemerosa/ontrack/extension/gitlab/client/DefaultOntrackGitLabClient.java
Support is availalbe as stated here https://github.com/timols/java-gitlab-api/pull/193/files
Understood. So you'd like to have the proxy configurable at the GitLab configuration level (together with other parameters like URL, etc.)? For GitHub, you were able to do otherwise?
Basically when the proxy is configured in the Docker container or on the host the GitLab configuration should pick this up and use it when connecting to GitLab.
Thank you for the fast feedback!
Apperently the GitHub connector does this already?
What are the Java options that you pass at container level to enable the proxy?
# Ontrack container
ontrack:
image: nemerosa/ontrack:3
volumes:
- /var/ontrack/site/data:/var/ontrack/data
- /var/ontrack/site/conf:/var/ontrack/conf
environment:
PROFILE: prod
JAVA_OPTIONS: '-Dhttp.proxyHost=http://proxy.blabla.com -Dhttp.proxyPort=3128 -Dhttps.proxyHost=http://proxy.blabla.com -Dhttps.proxyPort=31$
JAVA_OPTS: '-Djavax.net.ssl.trustStore'
http_proxy: http://proxy.blabla.com:3128
https_proxy: http://proxy.blabla.com:3128
links:
- "postgresql:postgresql"
ports:
- "80:8080"
- "443:443"
So using the docker-compose file we include the proxy settings using JAVA_OPTIONS and also as environment settings
org.eclipse.egit.github.core.client.GitHubClient
which must have a layer accepting the proxy options from the JVMorg.gitlab.api.GitlabAPI
but this one seems to have to be configured explicitly for proxy settings.That can be corrected. I'd like to align the proxy settings source of course but that might not be trivial. What would you prefer? Reusing the JVM system properties (like http.proxyHost
) or an explicit configuration in the configuration. I'd rather reuse the JVM settings.
As I said, I won't be able to perform any code change before January but I can always review a PR.
I would like the JVM settings as well so no additionl proxy settings are required. Maybe it is good to validate this for other extentions as well.
We will see if we have time for the PR else we will see the change in the next version of Ontrack ;-)
Yes indeed, any other connector (JIRA, Artifactory, other) might potentially need this. I'll do this for January.
Thank you have a nice vacation!
We did not found the time to work on a solution. Did you already had time to look into this? @dcoraboeuf ?
Hi, I had no time to work on this. Any chance you could make a contribution to the code?
Hello,
We are trying to use Ontrack in combination with GitLab. However this does not seem to work due to the extention not picking up the Proxy Settings.
What do we have:
What did we do:
Can this be fixed? Or can we do a pull request when we fixed it?
Kind regards, Pieter
(Credits go to Henk Bakker for figuring out why it did not work)