diff --git a/Cargo.lock b/Cargo.lock index 93cbc23..9f3705a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,6 +72,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "actix-files" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0773d59061dedb49a8aed04c67291b9d8cf2fe0b60130a381aab53c6dd86e9be" +dependencies = [ + "actix-http", + "actix-service", + "actix-utils", + "actix-web", + "bitflags 2.6.0", + "bytes", + "derive_more", + "futures-core", + "http-range", + "log", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "v_htmlescape", +] + [[package]] name = "actix-http" version = "3.8.0" @@ -1579,6 +1602,12 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-range" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" + [[package]] name = "http-signature-normalization" version = "0.7.0" @@ -3872,6 +3901,12 @@ dependencies = [ "serde", ] +[[package]] +name = "v_htmlescape" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e8257fbc510f0a46eb602c10215901938b5c2a7d5e70fc11483b1d3c9b5b18c" + [[package]] name = "vcpkg" version = "0.2.15" @@ -3884,6 +3919,7 @@ version = "0.1.0" dependencies = [ "activitypub_federation", "activitystreams-kinds", + "actix-files", "actix-web", "actix-web-prom", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 4981d17..aa8190b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,6 +37,7 @@ base64-url = "3.0.0" webfinger = "0.5.1" regex = "1.10.6" once_cell = "1.19.0" +actix-files = "0.6.6" [dependencies.sea-orm] version = "0.12.0" diff --git a/src/main.rs b/src/main.rs index d33de76..6111279 100644 --- a/src/main.rs +++ b/src/main.rs @@ -132,6 +132,11 @@ async fn post_manually( Ok(HttpResponse::Ok().json(Response { health: true })) } +#[get("/favicon")] +async fn favicon() -> actix_web::Result { + Ok(actix_files::NamedFile::open("static/favicon.ico")?) +} + #[get("/test/follow/{user}")] async fn follow_manually( path: web::Path, diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..44353af Binary files /dev/null and b/static/favicon.ico differ