Add env var to disable outbound federation
This commit is contained in:
parent
0884fe7589
commit
6843df46f0
|
@ -4,7 +4,7 @@ use anyhow::anyhow;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use http_signature_normalization::Config;
|
use http_signature_normalization::Config;
|
||||||
use hyper::header::CONTENT_TYPE;
|
use hyper::header::CONTENT_TYPE;
|
||||||
use log::{debug, error};
|
use log::{debug, error, info};
|
||||||
use openssl::{hash::MessageDigest, pkey::PKey, sha::Sha256, sign::Signer};
|
use openssl::{hash::MessageDigest, pkey::PKey, sha::Sha256, sign::Signer};
|
||||||
use reqwest::header::{ACCEPT, DATE, HOST};
|
use reqwest::header::{ACCEPT, DATE, HOST};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
@ -25,6 +25,11 @@ pub async fn sign_and_send<Kind: serde::Serialize>(
|
||||||
activity: &ActorAndObject<Kind>,
|
activity: &ActorAndObject<Kind>,
|
||||||
inbox: &str,
|
inbox: &str,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
|
if std::env::var("SKIP_FEDERATE").is_ok() {
|
||||||
|
info!("Skipping federation");
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
let inbox_url = Url::parse(inbox)?;
|
let inbox_url = Url::parse(inbox)?;
|
||||||
|
|
||||||
let body = serde_json::to_string(activity)?;
|
let body = serde_json::to_string(activity)?;
|
||||||
|
|
Loading…
Reference in New Issue