mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 16:02:14 +00:00
handle default base_url in instance settings
This commit is contained in:
+10
-7
@@ -505,22 +505,25 @@ pub async fn reload_base_url_setting(db: &DB) -> error::Result<()> {
|
||||
.fetch_optional(db)
|
||||
.await?;
|
||||
|
||||
let std_base_url = std::env::var("BASE_URL")
|
||||
.ok()
|
||||
.unwrap_or_else(|| "http://localhost".to_string());
|
||||
let base_url = if let Some(q) = q_base_url {
|
||||
if let Ok(v) = serde_json::from_value::<String>(q.value.clone()) {
|
||||
v
|
||||
if v != "" {
|
||||
v
|
||||
} else {
|
||||
std_base_url
|
||||
}
|
||||
} else {
|
||||
tracing::error!(
|
||||
"Could not parse base_url setting as a string, found: {:#?}",
|
||||
&q.value
|
||||
);
|
||||
std::env::var("BASE_URL")
|
||||
.ok()
|
||||
.unwrap_or_else(|| "http://localhost".to_string())
|
||||
std_base_url
|
||||
}
|
||||
} else {
|
||||
std::env::var("BASE_URL")
|
||||
.ok()
|
||||
.unwrap_or_else(|| "http://localhost".to_string())
|
||||
std_base_url
|
||||
};
|
||||
|
||||
let q_oauth = sqlx::query!(
|
||||
|
||||
Reference in New Issue
Block a user