Compare commits

...

5 Commits

Author SHA1 Message Date
c200bf0cc6 Add CSS classes for styling registration status 2022-11-28 10:29:48 +01:00
ce8ee40b2a Add anchor to joining section 2022-11-28 10:29:12 +01:00
asonix
4d8e1a7241 Enable lazy loading for images 2022-11-23 13:32:27 -06:00
asonix
89a9e20d4a Bump version 2022-11-23 12:58:29 -06:00
asonix
39b8b1d3fa Add compression middleware - not zstd 2022-11-23 12:57:56 -06:00
6 changed files with 50 additions and 9 deletions

40
Cargo.lock generated
View File

@ -68,10 +68,12 @@ dependencies = [
"ahash",
"base64",
"bitflags",
"brotli",
"bytes",
"bytestring",
"derive_more",
"encoding_rs",
"flate2",
"futures-core",
"h2",
"http",
@ -260,6 +262,21 @@ dependencies = [
"memchr",
]
[[package]]
name = "alloc-no-stdlib"
version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3"
[[package]]
name = "alloc-stdlib"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece"
dependencies = [
"alloc-no-stdlib",
]
[[package]]
name = "ammonia"
version = "3.2.1"
@ -281,7 +298,7 @@ checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6"
[[package]]
name = "ap-relay"
version = "0.3.65"
version = "0.3.66"
dependencies = [
"activitystreams",
"activitystreams-ext",
@ -610,6 +627,27 @@ dependencies = [
"cipher",
]
[[package]]
name = "brotli"
version = "3.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68"
dependencies = [
"alloc-no-stdlib",
"alloc-stdlib",
"brotli-decompressor",
]
[[package]]
name = "brotli-decompressor"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80"
dependencies = [
"alloc-no-stdlib",
"alloc-stdlib",
]
[[package]]
name = "bumpalo"
version = "3.11.1"

View File

@ -1,7 +1,7 @@
[package]
name = "ap-relay"
description = "A simple activitypub relay"
version = "0.3.65"
version = "0.3.66"
authors = ["asonix <asonix@asonix.dog>"]
license = "AGPL-3.0"
readme = "README.md"
@ -25,6 +25,8 @@ anyhow = "1.0"
actix-rt = "2.7.0"
actix-web = { version = "4.0.1", default-features = false, features = [
"rustls",
"compress-brotli",
"compress-gzip",
] }
actix-webfinger = "0.4.0"
activitystreams = "0.7.0-alpha.19"

View File

@ -2,7 +2,7 @@
#![allow(clippy::needless_borrow)]
use activitystreams::iri_string::types::IriString;
use actix_web::{web, App, HttpServer};
use actix_web::{middleware::Compress, web, App, HttpServer};
use collector::MemoryCollector;
#[cfg(feature = "console")]
use console_subscriber::ConsoleLayer;
@ -224,7 +224,8 @@ async fn do_server_main(
app
};
app.wrap(TracingLogger::default())
app.wrap(Compress::default())
.wrap(TracingLogger::default())
.wrap(Timings)
.service(web::resource("/").route(web::get().to(index)))
.service(web::resource("/media/{path}").route(web::get().to(routes::media)))

View File

@ -6,7 +6,7 @@
<div class="admin">
<div class="left">
<figure class="avatar">
<img src="@contact.avatar" alt="@contact.display_name's avatar">
<img loading="lazy" src="@contact.avatar" alt="@contact.display_name's avatar">
</figure>
</div>
<div class="right">

View File

@ -54,7 +54,7 @@ templates::{info, instance, statics::index_css},
}
</article>
}
<article>
<article id="joining">
<h3>Joining</h3>
<section class="joining">
@if config.restricted_mode() {

View File

@ -10,12 +10,12 @@
Running @software, version @instance.version.
}
@if instance.reg {
<br>Registration is open.
<br><span class="reg-open">Registration is open.</span>
@if instance.requires_approval {
Accounts must be approved by an admin.
<span class="reg-moderated">Accounts must be approved by an admin.</span>
}
} else{
Registration is closed
<span class="reg-closed">Registration is closed</span>
}
</p>
@if !instance.description.trim().is_empty() || contact.is_some() {