silence lemmy output in federation logs
This commit is contained in:
parent
f33577b317
commit
d5955b60c0
3 changed files with 13 additions and 21 deletions
|
@ -102,12 +102,6 @@ services:
|
||||||
POSTGRES_USER: lemmy
|
POSTGRES_USER: lemmy
|
||||||
POSTGRES_PASSWORD: password
|
POSTGRES_PASSWORD: password
|
||||||
|
|
||||||
- name: pictrs
|
|
||||||
image: asonix/pictrs:v0.2.5-r0
|
|
||||||
|
|
||||||
- name: iframely
|
|
||||||
image: dogbin/iframely:latest
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: dieselcli
|
- name: dieselcli
|
||||||
temp: {}
|
temp: {}
|
||||||
|
|
|
@ -26,7 +26,7 @@ LEMMY_HOSTNAME=lemmy-alpha:8541 \
|
||||||
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta,lemmy-gamma,lemmy-delta,lemmy-epsilon \
|
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta,lemmy-gamma,lemmy-delta,lemmy-epsilon \
|
||||||
LEMMY_SETUP__ADMIN_USERNAME=lemmy_alpha \
|
LEMMY_SETUP__ADMIN_USERNAME=lemmy_alpha \
|
||||||
LEMMY_SETUP__SITE_NAME=lemmy-alpha \
|
LEMMY_SETUP__SITE_NAME=lemmy-alpha \
|
||||||
target/lemmy_server &
|
target/lemmy_server >/dev/null 2>&1 &
|
||||||
|
|
||||||
echo "start beta"
|
echo "start beta"
|
||||||
LEMMY_HOSTNAME=lemmy-beta:8551 \
|
LEMMY_HOSTNAME=lemmy-beta:8551 \
|
||||||
|
@ -35,7 +35,7 @@ LEMMY_HOSTNAME=lemmy-beta:8551 \
|
||||||
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-gamma,lemmy-delta,lemmy-epsilon \
|
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-gamma,lemmy-delta,lemmy-epsilon \
|
||||||
LEMMY_SETUP__ADMIN_USERNAME=lemmy_beta \
|
LEMMY_SETUP__ADMIN_USERNAME=lemmy_beta \
|
||||||
LEMMY_SETUP__SITE_NAME=lemmy-beta \
|
LEMMY_SETUP__SITE_NAME=lemmy-beta \
|
||||||
target/lemmy_server &
|
target/lemmy_server >/dev/null 2>&1 &
|
||||||
|
|
||||||
echo "start gamma"
|
echo "start gamma"
|
||||||
LEMMY_HOSTNAME=lemmy-gamma:8561 \
|
LEMMY_HOSTNAME=lemmy-gamma:8561 \
|
||||||
|
@ -44,7 +44,7 @@ LEMMY_HOSTNAME=lemmy-gamma:8561 \
|
||||||
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-beta,lemmy-delta,lemmy-epsilon \
|
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-beta,lemmy-delta,lemmy-epsilon \
|
||||||
LEMMY_SETUP__ADMIN_USERNAME=lemmy_gamma \
|
LEMMY_SETUP__ADMIN_USERNAME=lemmy_gamma \
|
||||||
LEMMY_SETUP__SITE_NAME=lemmy-gamma \
|
LEMMY_SETUP__SITE_NAME=lemmy-gamma \
|
||||||
target/lemmy_server &
|
target/lemmy_server >/dev/null 2>&1 &
|
||||||
|
|
||||||
echo "start delta"
|
echo "start delta"
|
||||||
# An instance with only an allowlist for beta
|
# An instance with only an allowlist for beta
|
||||||
|
@ -54,7 +54,7 @@ LEMMY_HOSTNAME=lemmy-delta:8571 \
|
||||||
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta \
|
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta \
|
||||||
LEMMY_SETUP__ADMIN_USERNAME=lemmy_delta \
|
LEMMY_SETUP__ADMIN_USERNAME=lemmy_delta \
|
||||||
LEMMY_SETUP__SITE_NAME=lemmy-delta \
|
LEMMY_SETUP__SITE_NAME=lemmy-delta \
|
||||||
target/lemmy_server &
|
target/lemmy_server >/dev/null 2>&1 &
|
||||||
|
|
||||||
echo "start epsilon"
|
echo "start epsilon"
|
||||||
# An instance who has a blocklist, with lemmy-alpha blocked
|
# An instance who has a blocklist, with lemmy-alpha blocked
|
||||||
|
@ -64,7 +64,7 @@ LEMMY_HOSTNAME=lemmy-epsilon:8581 \
|
||||||
LEMMY_FEDERATION__BLOCKED_INSTANCES=lemmy-alpha \
|
LEMMY_FEDERATION__BLOCKED_INSTANCES=lemmy-alpha \
|
||||||
LEMMY_SETUP__ADMIN_USERNAME=lemmy_epsilon \
|
LEMMY_SETUP__ADMIN_USERNAME=lemmy_epsilon \
|
||||||
LEMMY_SETUP__SITE_NAME=lemmy-epsilon \
|
LEMMY_SETUP__SITE_NAME=lemmy-epsilon \
|
||||||
target/lemmy_server &
|
target/lemmy_server >/dev/null 2>&1 &
|
||||||
|
|
||||||
echo "wait for all instances to start"
|
echo "wait for all instances to start"
|
||||||
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8541/api/v1/site')" != "200" ]]; do sleep 1; done
|
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8541/api/v1/site')" != "200" ]]; do sleep 1; done
|
||||||
|
|
|
@ -25,7 +25,7 @@ use lemmy_websocket::LemmyContext;
|
||||||
use log::{debug, warn};
|
use log::{debug, warn};
|
||||||
use reqwest::Client;
|
use reqwest::Client;
|
||||||
use serde::{export::fmt::Debug, Deserialize, Serialize};
|
use serde::{export::fmt::Debug, Deserialize, Serialize};
|
||||||
use std::{collections::BTreeMap, future::Future, pin::Pin, env};
|
use std::{collections::BTreeMap, env, future::Future, pin::Pin};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
/// Sends a local activity to a single, remote actor.
|
/// Sends a local activity to a single, remote actor.
|
||||||
|
@ -263,13 +263,11 @@ impl ActixJob for SendActivityTask {
|
||||||
const BACKOFF: Backoff = Backoff::Exponential(2);
|
const BACKOFF: Backoff = Backoff::Exponential(2);
|
||||||
|
|
||||||
fn run(self, state: Self::State) -> Self::Future {
|
fn run(self, state: Self::State) -> Self::Future {
|
||||||
Box::pin(async move {
|
Box::pin(async move { do_send(self, &state.client).await })
|
||||||
do_send(self, &state.client).await
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn do_send(task: SendActivityTask, client: &Client) -> Result<(), Error>{
|
async fn do_send(task: SendActivityTask, client: &Client) -> Result<(), Error> {
|
||||||
let mut headers = BTreeMap::<String, String>::new();
|
let mut headers = BTreeMap::<String, String>::new();
|
||||||
headers.insert("Content-Type".into(), "application/json".into());
|
headers.insert("Content-Type".into(), "application/json".into());
|
||||||
let result = sign_and_send(
|
let result = sign_and_send(
|
||||||
|
@ -280,15 +278,15 @@ async fn do_send(task: SendActivityTask, client: &Client) -> Result<(), Error>{
|
||||||
&task.actor_id,
|
&task.actor_id,
|
||||||
task.private_key.to_owned(),
|
task.private_key.to_owned(),
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
if let Err(e) = result {
|
if let Err(e) = result {
|
||||||
warn!("{}", e);
|
warn!("{}", e);
|
||||||
return Err(anyhow!(
|
return Err(anyhow!(
|
||||||
"Failed to send activity {} to {}",
|
"Failed to send activity {} to {}",
|
||||||
&task.activity,
|
&task.activity,
|
||||||
task.inbox
|
task.inbox
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue