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() {
|
if config.debug() {
|
||||||
std::env::set_var(
|
std::env::set_var(
|
||||||
"RUST_LOG",
|
"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 {
|
} else {
|
||||||
std::env::set_var("RUST_LOG", "info")
|
std::env::set_var("RUST_LOG", "info")
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
use crate::{config::Config, data::State, error::MyError};
|
use crate::{config::Config, data::State, error::MyError};
|
||||||
use actix_web::{web, HttpResponse};
|
use actix_web::{web, HttpResponse};
|
||||||
use log::error;
|
use log::error;
|
||||||
|
use rand::{seq::SliceRandom, thread_rng};
|
||||||
use std::io::BufWriter;
|
use std::io::BufWriter;
|
||||||
|
|
||||||
pub async fn route(
|
pub async fn route(
|
||||||
state: web::Data<State>,
|
state: web::Data<State>,
|
||||||
config: web::Data<Config>,
|
config: web::Data<Config>,
|
||||||
) -> Result<HttpResponse, MyError> {
|
) -> 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());
|
let mut buf = BufWriter::new(Vec::new());
|
||||||
|
|
||||||
crate::templates::index(&mut buf, &nodes, &config)?;
|
crate::templates::index(&mut buf, &nodes, &config)?;
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head lang="en">
|
<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>
|
<title>@config.hostname() | ActivityPub Relay</title>
|
||||||
<link rel="stylesheet" href="/static/@index_css.name" type="text/css" />
|
<link rel="stylesheet" href="/static/@index_css.name" type="text/css" />
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in a new issue