diff --git a/backend/windmill-worker/src/bun_executor.rs b/backend/windmill-worker/src/bun_executor.rs index e03140c6e8..15cb6d1d82 100644 --- a/backend/windmill-worker/src/bun_executor.rs +++ b/backend/windmill-worker/src/bun_executor.rs @@ -243,11 +243,35 @@ pub async fn install_lockfile( .stdout(Stdio::piped()) .stderr(Stdio::piped()); if npm_mode { + logs.push_str("NPM mode\n") + } + let has_file = if npm_mode { let registry = NPM_CONFIG_REGISTRY.read().await.clone(); if let Some(registry) = registry { - child_cmd.env("NPM_CONFIG_REGISTRY", registry); + let content = registry + .trim_start_matches("https:") + .trim_start_matches("http:"); + + let mut splitted = registry.split(":_authToken="); + let custom_registry = splitted.next().unwrap_or_default(); + logs.push_str(&format!( + "Using custom npm registry: {custom_registry} {}\n", + if splitted.next().is_some() { + "with authToken" + } else { + "without authToken" + } + )); + + child_cmd.env("NPM_CONFIG_REGISTRY", custom_registry); + write_file(job_dir, ".npmrc", content).await?; + true + } else { + false } - } + } else { + false + }; let child_process = start_child_process(child_cmd, &*BUN_PATH).await?; @@ -267,6 +291,11 @@ pub async fn install_lockfile( false, ) .await?; + + if has_file { + tokio::fs::remove_file(format!("{job_dir}/.npmrc")).await?; + } + Ok(()) } diff --git a/frontend/src/lib/components/InstanceSettings.svelte b/frontend/src/lib/components/InstanceSettings.svelte index dbcc2d8a7c..4b6b00905d 100644 --- a/frontend/src/lib/components/InstanceSettings.svelte +++ b/frontend/src/lib/components/InstanceSettings.svelte @@ -63,7 +63,7 @@ values['base_url'] = window.location.origin } if (values['retention_period_secs'] == undefined) { - values['retention_period_secs'] = 60 * 60 * 24 * 60 + values['retention_period_secs'] = 60 * 60 * 24 * 30 } if (values['base_url'] == undefined) { values['base_url'] = 'http://localhost' @@ -368,7 +368,7 @@ {#if setting.ee_only != undefined && !$enterpriseLicense}
- EE only {setting.ee_only} + EE only {#if setting.ee_only != ''}{setting.ee_only}{/if}
{/if}