diff --git a/justfile b/justfile index d39c4cb2..f761e5ee 100644 --- a/justfile +++ b/justfile @@ -69,6 +69,8 @@ build-notebook-lifecycle-observe: (build-features "notebook,lifecycle,observe") build-notebook-lifecycle-mcp: (build-features "notebook,lifecycle,mcp") +build-no-observe: (build-features "notebook,lifecycle,mcp,openwebui") + build-full: (build-features "notebook,lifecycle,observe,mcp,openwebui") # --- Frontend & Minification --- diff --git a/src/logger/observability.rs b/src/logger/observability.rs index 8792a91c..faef0dfa 100644 --- a/src/logger/observability.rs +++ b/src/logger/observability.rs @@ -178,7 +178,7 @@ impl ObserveEvents { } pub fn send_message(&self, event: ObserveEventEntry) { - let message = format!("{:?}", &event); + let message = format!("{:?}", event); if let Err(e) = self.sender.try_send(event) { match e { tokio::sync::mpsc::error::TrySendError::Full(_) => warn!( diff --git a/src/web/route/auth/mod.rs b/src/web/route/auth/mod.rs index e47a7e23..94cabeeb 100644 --- a/src/web/route/auth/mod.rs +++ b/src/web/route/auth/mod.rs @@ -30,8 +30,9 @@ use crate::{ helper::{self}, }, }; +use crate::config::CONFIG; #[cfg(feature = "observe")] -use crate::{config::CONFIG, logger::MESSAGE_DELIMITER}; +use crate::logger::MESSAGE_DELIMITER; pub use self::oauth::generate_token_with_cookie; use self::{ diff --git a/src/web/route/openwebui/mod.rs b/src/web/route/openwebui/mod.rs index facd661a..e8f79028 100644 --- a/src/web/route/openwebui/mod.rs +++ b/src/web/route/openwebui/mod.rs @@ -1,4 +1,7 @@ -use std::{borrow::Cow, collections::HashSet, marker::PhantomData, str::FromStr, sync::LazyLock, time::Duration}; +use std::{ + borrow::Cow, collections::HashSet, marker::PhantomData, str::FromStr, sync::LazyLock, + time::Duration, +}; use actix_web::{ HttpRequest, HttpResponse, delete, @@ -15,6 +18,8 @@ use tera::{Context, Tera}; use tracing::{instrument, warn}; use url::Url; +#[cfg(feature = "observe")] +use crate::web::helper::observability_post; use crate::{ config::CONFIG, db::{ @@ -27,7 +32,7 @@ use crate::{ web::{ bridge_middleware::{CookieCheck, Htmx}, bson, - helper::{self, forwarding, observability_post}, + helper::{self, forwarding}, }, }; @@ -258,6 +263,7 @@ async fn create_owui( ) .await?; + #[cfg(feature = "observe")] if let Some(bc) = bcookie { observability_post("owui instance has been created", &bc); } @@ -331,6 +337,7 @@ async fn delete_owui( ) .await?; + #[cfg(feature = "observe")] if let Some(bc) = bcookie { observability_post("owui instance has been deleted", &bc); } diff --git a/src/web/route/portal/helper.rs b/src/web/route/portal/helper.rs index 240234e9..3213be48 100644 --- a/src/web/route/portal/helper.rs +++ b/src/web/route/portal/helper.rs @@ -91,7 +91,7 @@ where #[cfg(feature = "openwebui")] pub(super) async fn owui_bookkeeping(user: &User) -> (Option, bool) { let id = user._id.to_string(); - let name = format!("u{}-openwebui", &id); + let name = format!("u{}-openwebui", id); let pod_name = format!("u{}-openwebui-0", id); let pvc_name = format!("owui1-u{}-openwebui-0", id); diff --git a/src/web/route/resource/mod.rs b/src/web/route/resource/mod.rs index 91cb5cd0..6b10df14 100644 --- a/src/web/route/resource/mod.rs +++ b/src/web/route/resource/mod.rs @@ -39,7 +39,7 @@ pub async fn resource_http( client: Data, ) -> Result { let (mut bridge_cookie, resource) = resource.into_inner(); - let prefix = format!("/resource/{}", &resource); + let prefix = format!("/resource/{}", resource); let path = req .uri() .path()