- NodeInfo at /.well-known/nodeinfo + /nodeinfo/2.0
- Hashtags #MoviesDiary + #MovieTitle on review posts; /tags/{tag} redirect
- Domain blocking: blocked_domains table, admin API + HTML, inbox enforcement
- Per-actor blocking: blocked_actors table, user API + HTML, BlockActivity send/receive
- Delivery filter excludes blocked actors and blocked-domain inboxes
45 lines
1.2 KiB
Rust
45 lines
1.2 KiB
Rust
use std::sync::Arc;
|
|
|
|
use crate::content::ApObjectHandler;
|
|
use crate::repository::FederationRepository;
|
|
use crate::user::ApUserRepository;
|
|
|
|
#[derive(Clone)]
|
|
pub struct FederationData {
|
|
pub(crate) federation_repo: Arc<dyn FederationRepository>,
|
|
pub(crate) user_repo: Arc<dyn ApUserRepository>,
|
|
pub(crate) object_handler: Arc<dyn ApObjectHandler>,
|
|
pub(crate) base_url: String,
|
|
pub(crate) domain: String,
|
|
pub(crate) allow_registration: bool,
|
|
pub(crate) software_name: String,
|
|
}
|
|
|
|
impl FederationData {
|
|
pub fn new(
|
|
federation_repo: Arc<dyn FederationRepository>,
|
|
user_repo: Arc<dyn ApUserRepository>,
|
|
object_handler: Arc<dyn ApObjectHandler>,
|
|
base_url: String,
|
|
allow_registration: bool,
|
|
software_name: String,
|
|
) -> Self {
|
|
let domain = base_url
|
|
.trim_start_matches("https://")
|
|
.trim_start_matches("http://")
|
|
.split('/')
|
|
.next()
|
|
.unwrap_or("")
|
|
.to_string();
|
|
Self {
|
|
federation_repo,
|
|
user_repo,
|
|
object_handler,
|
|
base_url,
|
|
domain,
|
|
allow_registration,
|
|
software_name,
|
|
}
|
|
}
|
|
}
|