diff --git a/src/main.rs b/src/main.rs index bd88a12..266c598 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,7 +35,7 @@ async fn main() -> Result<(), anyhow::Error> { if config.debug() { std::env::set_var( "RUST_LOG", - "debug,tokio_postgres=info,h2=info,trust_dns_resolver=info,trust_dns_proto=info,rustls=info", + "debug,tokio_postgres=info,h2=info,trust_dns_resolver=info,trust_dns_proto=info,rustls=info,html5ever=info", ) } else { std::env::set_var("RUST_LOG", "info") diff --git a/src/routes/index.rs b/src/routes/index.rs index 6d9e564..3271de8 100644 --- a/src/routes/index.rs +++ b/src/routes/index.rs @@ -1,13 +1,15 @@ use crate::{config::Config, data::State, error::MyError}; use actix_web::{web, HttpResponse}; use log::error; +use rand::{seq::SliceRandom, thread_rng}; use std::io::BufWriter; pub async fn route( state: web::Data, config: web::Data, ) -> Result { - let nodes = state.node_cache().nodes().await; + let mut nodes = state.node_cache().nodes().await; + nodes.shuffle(&mut thread_rng()); let mut buf = BufWriter::new(Vec::new()); crate::templates::index(&mut buf, &nodes, &config)?; diff --git a/templates/index.rs.html b/templates/index.rs.html index e764185..dee297e 100644 --- a/templates/index.rs.html +++ b/templates/index.rs.html @@ -9,7 +9,8 @@ - + + @config.hostname() | ActivityPub Relay