mirror of
https://github.com/LemmyNet/activitypub-federation-rust
synced 2024-11-27 13:51:29 +00:00
51443aa57c
* make prepare_raw, sign_raw, send_raw functions public * remove in-memory activity queue * rename module * comment * don"t clone * fix doc comment * remove send_activity function --------- Co-authored-by: Nutomic <me@nutomic.com>
906 B
906 B
Configuration
Next we need to do some configuration. Most importantly we need to specify the domain where the federated instance is running. It should be at the domain root and available over HTTPS for production. See the documentation for a list of config options. The parameter user_data
is for anything that your application requires in handler functions, such as database connection handle, configuration etc.
# use activitypub_federation::config::FederationConfig;
# let db_connection = ();
# tokio::runtime::Runtime::new().unwrap().block_on(async {
let config = FederationConfig::builder()
.domain("example.com")
.app_data(db_connection)
.build().await?;
# Ok::<(), anyhow::Error>(())
# }).unwrap()
debug
is necessary to test federation with http and localhost URLs, but it should never be used in production. url_verifier
can be used to implement a domain blacklist.