2020-04-19 22:08:25 +00:00
|
|
|
use crate::api::{Oper, Perform};
|
2020-04-21 14:25:29 +00:00
|
|
|
use crate::apub::get_apub_protocol_string;
|
2020-04-19 22:08:25 +00:00
|
|
|
use crate::db::site_view::SiteView;
|
2020-04-20 03:59:07 +00:00
|
|
|
use crate::rate_limit::rate_limiter::RateLimiter;
|
2020-04-19 22:08:25 +00:00
|
|
|
use crate::websocket::{server::ChatServer, WebsocketInfo};
|
|
|
|
use crate::{get_ip, markdown_to_html, version, Settings};
|
|
|
|
use actix::prelude::*;
|
|
|
|
use actix_files::NamedFile;
|
2020-04-21 20:40:03 +00:00
|
|
|
use actix_web::{body::Body, error::ErrorBadRequest, web::Query, *};
|
2020-04-19 22:08:25 +00:00
|
|
|
use actix_web_actors::ws;
|
|
|
|
use chrono::{DateTime, NaiveDateTime, Utc};
|
|
|
|
use diesel::{
|
|
|
|
r2d2::{ConnectionManager, Pool},
|
|
|
|
PgConnection,
|
|
|
|
};
|
|
|
|
use log::{error, info};
|
|
|
|
use regex::Regex;
|
|
|
|
use rss::{CategoryBuilder, ChannelBuilder, GuidBuilder, Item, ItemBuilder};
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use serde_json::json;
|
|
|
|
use std::str::FromStr;
|
|
|
|
use std::sync::{Arc, Mutex};
|
|
|
|
use std::time::{Duration, Instant};
|
|
|
|
use strum::ParseError;
|
2020-04-21 14:25:29 +00:00
|
|
|
use url::Url;
|
2020-04-19 22:08:25 +00:00
|
|
|
|
|
|
|
pub type DbPoolParam = web::Data<Pool<ConnectionManager<PgConnection>>>;
|
|
|
|
pub type RateLimitParam = web::Data<Arc<Mutex<RateLimiter>>>;
|
|
|
|
pub type ChatServerParam = web::Data<Addr<ChatServer>>;
|
|
|
|
|
2020-01-15 15:37:25 +00:00
|
|
|
pub mod api;
|
2019-12-31 12:55:33 +00:00
|
|
|
pub mod federation;
|
|
|
|
pub mod feeds;
|
|
|
|
pub mod index;
|
|
|
|
pub mod nodeinfo;
|
|
|
|
pub mod webfinger;
|
|
|
|
pub mod websocket;
|