};
use doku::json::{AutoComments, Formatting};
use lemmy_api::match_websocket_operation;
-use lemmy_api_common::blocking;
+use lemmy_api_common::{blocking, check_private_instance_and_federation_enabled};
use lemmy_api_crud::match_websocket_operation_crud;
use lemmy_apub_lib::activity_queue::create_activity_queue;
use lemmy_db_schema::{get_database_url_from_env, source::secret::Secret};
api_routes,
code_migrations::run_advanced_migrations,
init_tracing,
+ root_span_builder::QuieterRootSpanBuilder,
scheduled_tasks,
};
use lemmy_utils::{
};
use lemmy_websocket::{chat_server::ChatServer, LemmyContext};
use reqwest::Client;
+use reqwest_middleware::ClientBuilder;
+use reqwest_tracing::TracingMiddleware;
use std::{env, sync::Arc, thread};
use tokio::sync::Mutex;
use tracing_actix_web::TracingLogger;
.user_agent(build_user_agent(&settings))
.build()?;
- let queue_manager = create_activity_queue();
+ let client = ClientBuilder::new(client).with(TracingMiddleware).build();
+
+ let queue_manager = create_activity_queue(client.clone());
let activity_queue = queue_manager.queue_handle().clone();
+ check_private_instance_and_federation_enabled(&pool, &settings).await?;
+
let chat_server = ChatServer::startup(
pool.clone(),
rate_limiter.clone(),
);
let rate_limiter = rate_limiter.clone();
App::new()
- .wrap(TracingLogger::default())
+ .wrap(actix_web::middleware::Logger::default())
+ .wrap(TracingLogger::<QuieterRootSpanBuilder>::new())
.app_data(Data::new(context))
// The routes
.configure(|cfg| api_routes::config(cfg, &rate_limiter))
.configure(|cfg| lemmy_apub::http::routes::config(cfg, &settings))
.configure(feeds::config)
- .configure(|cfg| images::config(cfg, &rate_limiter))
+ .configure(|cfg| images::config(cfg, client.clone(), &rate_limiter))
.configure(nodeinfo::config)
.configure(|cfg| webfinger::config(cfg, &settings))
})