|
|
@ -9,7 +9,6 @@ use crate::{code_migrations::run_advanced_migrations, root_span_builder::Quieter
|
|
|
|
use activitypub_federation::config::{FederationConfig, FederationMiddleware};
|
|
|
|
use activitypub_federation::config::{FederationConfig, FederationMiddleware};
|
|
|
|
use actix_cors::Cors;
|
|
|
|
use actix_cors::Cors;
|
|
|
|
use actix_web::{middleware, web::Data, App, HttpServer, Result};
|
|
|
|
use actix_web::{middleware, web::Data, App, HttpServer, Result};
|
|
|
|
use doku::json::{AutoComments, CommentsStyle, Formatting, ObjectsStyle};
|
|
|
|
|
|
|
|
use lemmy_api_common::{
|
|
|
|
use lemmy_api_common::{
|
|
|
|
context::LemmyContext,
|
|
|
|
context::LemmyContext,
|
|
|
|
lemmy_db_views::structs::SiteView,
|
|
|
|
lemmy_db_views::structs::SiteView,
|
|
|
@ -25,11 +24,7 @@ use lemmy_db_schema::{
|
|
|
|
utils::{build_db_pool, get_database_url, run_migrations},
|
|
|
|
utils::{build_db_pool, get_database_url, run_migrations},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
use lemmy_routes::{feeds, images, nodeinfo, webfinger};
|
|
|
|
use lemmy_routes::{feeds, images, nodeinfo, webfinger};
|
|
|
|
use lemmy_utils::{
|
|
|
|
use lemmy_utils::{error::LemmyError, rate_limit::RateLimitCell, settings::SETTINGS};
|
|
|
|
error::LemmyError,
|
|
|
|
|
|
|
|
rate_limit::RateLimitCell,
|
|
|
|
|
|
|
|
settings::{structs::Settings, SETTINGS},
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
use reqwest::Client;
|
|
|
|
use reqwest::Client;
|
|
|
|
use reqwest_middleware::ClientBuilder;
|
|
|
|
use reqwest_middleware::ClientBuilder;
|
|
|
|
use reqwest_tracing::TracingMiddleware;
|
|
|
|
use reqwest_tracing::TracingMiddleware;
|
|
|
@ -47,21 +42,6 @@ pub(crate) const REQWEST_TIMEOUT: Duration = Duration::from_secs(10);
|
|
|
|
/// Placing the main function in lib.rs allows other crates to import it and embed Lemmy
|
|
|
|
/// Placing the main function in lib.rs allows other crates to import it and embed Lemmy
|
|
|
|
pub async fn start_lemmy_server() -> Result<(), LemmyError> {
|
|
|
|
pub async fn start_lemmy_server() -> Result<(), LemmyError> {
|
|
|
|
let args: Vec<String> = env::args().collect();
|
|
|
|
let args: Vec<String> = env::args().collect();
|
|
|
|
if args.get(1) == Some(&"--print-config-docs".to_string()) {
|
|
|
|
|
|
|
|
let fmt = Formatting {
|
|
|
|
|
|
|
|
auto_comments: AutoComments::none(),
|
|
|
|
|
|
|
|
comments_style: CommentsStyle {
|
|
|
|
|
|
|
|
separator: "#".to_owned(),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
objects_style: ObjectsStyle {
|
|
|
|
|
|
|
|
surround_keys_with_quotes: false,
|
|
|
|
|
|
|
|
use_comma_as_separator: false,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
println!("{}", doku::to_json_fmt_val(&fmt, &Settings::default()));
|
|
|
|
|
|
|
|
return Ok(());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let scheduled_tasks_enabled = args.get(1) != Some(&"--disable-scheduled-tasks".to_string());
|
|
|
|
let scheduled_tasks_enabled = args.get(1) != Some(&"--disable-scheduled-tasks".to_string());
|
|
|
|
|
|
|
|
|
|
|
|