forked from mirrors/relay
Quiet html5ever, shuffle servers, mobile scaling
This commit is contained in:
parent
bcfe8b14a3
commit
d445177c69
3 changed files with 6 additions and 3 deletions
|
@ -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")
|
||||
|
|
|
@ -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<State>,
|
||||
config: web::Data<Config>,
|
||||
) -> Result<HttpResponse, MyError> {
|
||||
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)?;
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="utf-8"/>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>@config.hostname() | ActivityPub Relay</title>
|
||||
<link rel="stylesheet" href="/static/@index_css.name" type="text/css" />
|
||||
</head>
|
||||
|
|
Loading…
Reference in a new issue