diff --git a/backend/windmill-api/src/settings.rs b/backend/windmill-api/src/settings.rs index b825286b43..30e113618a 100644 --- a/backend/windmill-api/src/settings.rs +++ b/backend/windmill-api/src/settings.rs @@ -96,6 +96,7 @@ pub async fn test_s3_bucket( Json(test_s3_bucket): Json, ) -> error::Result { use bytes::Bytes; + use futures::StreamExt; use windmill_common::ee::{get_license_plan, LicensePlan}; if matches!(get_license_plan().await, LicensePlan::Pro) { @@ -107,6 +108,15 @@ pub async fn test_s3_bucket( require_super_admin(&db, &authed.email).await?; let client = build_object_store_from_settings(test_s3_bucket).await?; + let mut list = client.list(Some(&object_store::path::Path::from("".to_string()))); + let first_file = list + .next() + .await + .ok_or_else(|| { + error::Error::InternalErr("Failed to list files in blob storage".to_string()) + })? + .map_err(|e| anyhow::anyhow!("error listing bucket: {e}"))?; + tracing::info!("Listed files: {:?}", first_file); let path = object_store::path::Path::from(format!( "/test-s3-bucket-{uuid}", uuid = uuid::Uuid::new_v4() @@ -115,7 +125,7 @@ pub async fn test_s3_bucket( client .put(&path, Bytes::from_static(b"hello")) .await - .map_err(to_anyhow)?; + .map_err(|e| anyhow::anyhow!("error writing file to {path}: {e}"))?; let content = client .get(&path) .await diff --git a/backend/windmill-common/src/variables.rs b/backend/windmill-common/src/variables.rs index cb761b4643..8b105d76cc 100644 --- a/backend/windmill-common/src/variables.rs +++ b/backend/windmill-common/src/variables.rs @@ -6,6 +6,7 @@ * LICENSE-AGPL for a copy of the license. */ +use chrono::format; use magic_crypt::{MagicCrypt256, MagicCryptTrait}; use serde::{Deserialize, Serialize}; use sqlx::{Postgres, Transaction}; @@ -161,7 +162,7 @@ pub async fn get_reserved_variables( ) } else if let Some(script_path) = path.clone() { let script_path = if script_path.ends_with("/") { - "noname".to_string() + format!("{script_path}state") } else { script_path }; diff --git a/frontend/src/lib/components/FlowStatusViewerInner.svelte b/frontend/src/lib/components/FlowStatusViewerInner.svelte index d5807de3de..9ab7bf0398 100644 --- a/frontend/src/lib/components/FlowStatusViewerInner.svelte +++ b/frontend/src/lib/components/FlowStatusViewerInner.svelte @@ -204,11 +204,12 @@ console.error(e) } } - if (job?.type !== 'CompletedJob' && errorCount < 4) { + if (job?.type !== 'CompletedJob' && errorCount < 4 && !destroyed) { timeout = setTimeout(() => loadJobInProgress(), reducedPolling ? 5000 : 1000) } } + let destroyed = false async function updateJobId() { if (jobId !== job?.id) { $localModuleStates = {} @@ -244,6 +245,7 @@ $: isListJob = flowJobIds != undefined && Array.isArray(flowJobIds?.flowJobs) onDestroy(() => { + destroyed = true timeout && clearTimeout(timeout) }) diff --git a/frontend/src/lib/components/ObjectStoreConfigSettings.svelte b/frontend/src/lib/components/ObjectStoreConfigSettings.svelte index fa1734abc2..a66b640486 100644 --- a/frontend/src/lib/components/ObjectStoreConfigSettings.svelte +++ b/frontend/src/lib/components/ObjectStoreConfigSettings.svelte @@ -13,6 +13,7 @@ access_key: string secret_key: string endpoint: string + allow_http?: boolean } type AzureConfig = { @@ -28,13 +29,18 @@ export let bucket_config: S3Config | AzureConfig | undefined = undefined + $: bucket_config?.type == 'S3' && + bucket_config.allow_http == undefined && + (bucket_config.allow_http = true) let loading = false async function testConnection() { loading = true try { if (bucket_config) { - await SettingService.testObjectStorageConfig({ requestBody: bucket_config }) + await SettingService.testObjectStorageConfig({ + requestBody: bucket_config + }) sendUserToast('Connection successful', false) } } catch (e) { @@ -151,6 +157,12 @@ > +
+ Disable if using https only policy +
+ +
+
{:else if bucket_config.type === 'Azure'}