Revert "Add static file serving for suite UI"

This reverts commit dfd0dded23.
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-12-10 21:52:43 -03:00
parent dfd0dded23
commit 88d629e310
2 changed files with 4 additions and 30 deletions

View file

@ -1,7 +1,7 @@
{ {
"base_url": "http://localhost:8080", "base_url": "http://localhost:8080",
"default_org": { "default_org": {
"id": "350496350137221134", "id": "350493764617240590",
"name": "default", "name": "default",
"domain": "default.localhost" "domain": "default.localhost"
}, },
@ -13,8 +13,8 @@
"first_name": "Admin", "first_name": "Admin",
"last_name": "User" "last_name": "User"
}, },
"admin_token": "1Mjv1cz99jRBeVX0NQu952oxB7b-KRipXfbIHunkQJPk84VtAU2sv8IXRAULNATqDK50eHQ", "admin_token": "PQV0tJlkYiGwiXCbaGDszHZZEJ5zNeCppXq4C8Ryi4A_astZuM_aYZUEq1PnNbn6g7Mcc_A",
"project_id": "", "project_id": "",
"client_id": "350496350741266446", "client_id": "350493765221285902",
"client_secret": "kT6p8ekl4XtYGyW2esFeLlWHQMoxVUQzxcafiglFKA5X8DzTMtNhbOoUMkIGRtoi" "client_secret": "KHKXlgoRPdVLhwjnjoy0DvCSREdGv5ukRA2ZhTeSyCjRZrSkZKEc6aQ2pG351nlM"
} }

View file

@ -278,24 +278,6 @@ async fn run_axum_server(
// Add OAuth authentication routes // Add OAuth authentication routes
api_router = api_router.merge(crate::core::oauth::routes::configure()); api_router = api_router.merge(crate::core::oauth::routes::configure());
// Serve static files for suite UI
// Look for UI files in multiple locations (dev vs installed)
let ui_paths = vec![
"../botui/ui/suite", // Development: sibling project
"./botserver-stack/ui/suite", // Installed: in stack
"./ui/suite", // Local: in botserver dir
];
let ui_service = ui_paths
.iter()
.find(|p| std::path::Path::new(p).exists())
.map(|p| {
info!("Serving suite UI from: {}", p);
tower_http::services::ServeDir::new(p).not_found_service(
tower_http::services::ServeFile::new(format!("{}/index.html", p)),
)
});
let app = Router::new() let app = Router::new()
// API routes // API routes
.merge(api_router.with_state(app_state.clone())) .merge(api_router.with_state(app_state.clone()))
@ -304,14 +286,6 @@ async fn run_axum_server(
.layer(cors) .layer(cors)
.layer(TraceLayer::new_for_http()); .layer(TraceLayer::new_for_http());
// Add static file serving if UI directory exists
let app = if let Some(ui) = ui_service {
app.fallback_service(ui)
} else {
warn!("Suite UI not found in any of: {:?}", ui_paths);
app
};
// Always use HTTPS - load certificates from botserver-stack // Always use HTTPS - load certificates from botserver-stack
let cert_dir = std::path::Path::new("./botserver-stack/conf/system/certificates"); let cert_dir = std::path::Path::new("./botserver-stack/conf/system/certificates");
let cert_path = cert_dir.join("api/server.crt"); let cert_path = cert_dir.join("api/server.crt");