2023-09-09 16:25:03 +00:00
|
|
|
use clap::Parser;
|
2024-09-10 17:36:03 +00:00
|
|
|
use lemmy_server::{start_lemmy_server, CmdArgs};
|
2024-11-15 13:18:52 +00:00
|
|
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
2024-09-10 17:36:03 +00:00
|
|
|
use tracing::level_filters::LevelFilter;
|
|
|
|
use tracing_subscriber::EnvFilter;
|
2022-06-02 14:33:41 +00:00
|
|
|
|
2024-07-22 02:33:42 +00:00
|
|
|
pub extern crate rustls;
|
|
|
|
|
2023-06-26 08:24:11 +00:00
|
|
|
#[tokio::main]
|
2024-04-10 14:14:11 +00:00
|
|
|
pub async fn main() -> LemmyResult<()> {
|
2024-09-10 17:36:03 +00:00
|
|
|
let filter = EnvFilter::builder()
|
|
|
|
.with_default_directive(LevelFilter::INFO.into())
|
|
|
|
.from_env_lossy();
|
|
|
|
tracing_subscriber::fmt().with_env_filter(filter).init();
|
|
|
|
|
2023-09-09 16:25:03 +00:00
|
|
|
let args = CmdArgs::parse();
|
|
|
|
|
2024-07-22 02:33:42 +00:00
|
|
|
rustls::crypto::ring::default_provider()
|
|
|
|
.install_default()
|
2024-11-15 14:13:43 +00:00
|
|
|
.map_err(|_e| LemmyErrorType::Unknown("Failed to install rustls crypto provider".into()))?;
|
2024-07-22 02:33:42 +00:00
|
|
|
|
2023-09-09 16:25:03 +00:00
|
|
|
start_lemmy_server(args).await?;
|
2023-01-20 17:46:49 +00:00
|
|
|
Ok(())
|
2019-03-21 01:22:31 +00:00
|
|
|
}
|