mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-21 16:02:28 +00:00
fix: java + rust only relies on /tmp, + https proxy improvement for java
This commit is contained in:
@@ -185,6 +185,7 @@ pub async fn resolve<'a>(
|
||||
.current_dir(job_dir.to_owned())
|
||||
.env("PATH", PATH_ENV.as_str())
|
||||
.env("HOME", JAVA_HOME_DIR)
|
||||
.env("COURSIER_CACHE", COURSIER_CACHE_DIR)
|
||||
.envs(PROXY_ENVS.clone());
|
||||
|
||||
// Configure proxies
|
||||
@@ -206,6 +207,7 @@ pub async fn resolve<'a>(
|
||||
cmd.arg(&format!("-Dhttp.nonProxyHosts=\"{}\"", val));
|
||||
}
|
||||
}
|
||||
cmd.arg(&format!("-Duser.home={}", JAVA_HOME_DIR));
|
||||
if metadata(TRUST_STORE_PATH.clone()).await.is_ok() {
|
||||
cmd.args(&[
|
||||
&format!("-Djavax.net.ssl.trustStore={}", *TRUST_STORE_PATH),
|
||||
@@ -332,6 +334,7 @@ async fn install<'a>(
|
||||
.current_dir(&job_dir)
|
||||
.env("PATH", PATH_ENV.as_str())
|
||||
.env("HOME", JAVA_HOME_DIR)
|
||||
.env("COURSIER_CACHE", COURSIER_CACHE_DIR)
|
||||
.envs(PROXY_ENVS.clone());
|
||||
// Configure proxies
|
||||
{
|
||||
@@ -353,6 +356,7 @@ async fn install<'a>(
|
||||
}
|
||||
}
|
||||
|
||||
cmd.arg(&format!("-Duser.home={}", JAVA_HOME_DIR));
|
||||
if trust_store_metadata.is_ok() {
|
||||
cmd.args(&[
|
||||
&format!("-Djavax.net.ssl.trustStore={}", *TRUST_STORE_PATH),
|
||||
@@ -744,18 +748,15 @@ fn parse_proxy() -> anyhow::Result<JavaProxySettings> {
|
||||
for (ident, mut val) in PROXY_ENVS.clone() {
|
||||
match ident {
|
||||
"HTTPS_PROXY" => {
|
||||
if val.contains("http://") {
|
||||
bail!("HTTPS_PROXY url cannot contain http scheme.");
|
||||
}
|
||||
if !val.contains("https://") {
|
||||
if !val.contains("://") {
|
||||
val = format!("https://{val}");
|
||||
}
|
||||
let mut url = url::Url::parse(&val)?;
|
||||
let port = url.port();
|
||||
// Make sure port and schema is not included in final url
|
||||
{
|
||||
url.set_port(None).unwrap_or_default();
|
||||
jps.https_host = Some(url.as_str().replace("https://", ""));
|
||||
let host = url.as_str().replace("https://", "").replace("http://", "");
|
||||
jps.https_host = Some(host);
|
||||
if let Some(port) = port {
|
||||
jps.https_port = Some(format!("{}", port));
|
||||
}
|
||||
|
||||
@@ -163,12 +163,19 @@ pub async fn generate_cargo_lockfile(
|
||||
let mut gen_lockfile_cmd = Command::new(CARGO_PATH.as_str());
|
||||
gen_lockfile_cmd
|
||||
.current_dir(job_dir)
|
||||
.env_clear()
|
||||
.env("PATH", PATH_ENV.as_str())
|
||||
.env("HOME", HOME_ENV.as_str())
|
||||
.env("CARGO_HOME", CARGO_HOME.as_str())
|
||||
.env("RUSTUP_HOME", RUSTUP_HOME.as_str())
|
||||
.envs(PROXY_ENVS.clone())
|
||||
.args(vec!["generate-lockfile"])
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped());
|
||||
#[cfg(windows)]
|
||||
{
|
||||
gen_lockfile_cmd.env("SystemRoot", SYSTEM_ROOT.as_str());
|
||||
gen_lockfile_cmd.env("USERPROFILE", crate::USERPROFILE_ENV.as_str());
|
||||
gen_lockfile_cmd.env(
|
||||
"TMP",
|
||||
std::env::var("TMP").unwrap_or_else(|_| "C:\\tmp".to_string()),
|
||||
|
||||
Reference in New Issue
Block a user