--- /dev/null
+use doku::json::{AutoComments, CommentsStyle, Formatting, ObjectsStyle};
+use lemmy_utils::settings::structs::Settings;
+fn main() {
+ 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()));
+}
use activitypub_federation::config::{FederationConfig, FederationMiddleware};
use actix_cors::Cors;
use actix_web::{middleware, web::Data, App, HttpServer, Result};
-use doku::json::{AutoComments, CommentsStyle, Formatting, ObjectsStyle};
use lemmy_api_common::{
context::LemmyContext,
lemmy_db_views::structs::SiteView,
utils::{build_db_pool, get_database_url, run_migrations},
};
use lemmy_routes::{feeds, images, nodeinfo, webfinger};
-use lemmy_utils::{
- error::LemmyError,
- rate_limit::RateLimitCell,
- settings::{structs::Settings, SETTINGS},
-};
+use lemmy_utils::{error::LemmyError, rate_limit::RateLimitCell, settings::SETTINGS};
use reqwest::Client;
use reqwest_middleware::ClientBuilder;
use reqwest_tracing::TracingMiddleware;
/// Placing the main function in lib.rs allows other crates to import it and embed Lemmy
pub async fn start_lemmy_server() -> Result<(), LemmyError> {
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());