From 14e4402e7a7736dfa6a5ca0cb51b5f68579efb06 Mon Sep 17 00:00:00 2001 From: April John Date: Mon, 3 Feb 2025 14:15:19 +0100 Subject: [PATCH] add favicon --- Cargo.lock | 36 ++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/main.rs | 5 +++++ static/favicon.ico | Bin 0 -> 3262 bytes 4 files changed, 42 insertions(+) create mode 100644 static/favicon.ico 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 0000000000000000000000000000000000000000..44353af2013c2b50272d4c9bbcbdf3bfb6cd7547 GIT binary patch literal 3262 zcmb`JU1%Id9Kd(?HhW)td&~8jjZM?La&5V$T+O8=^q>UsO3BN;+{4L1nh%>O1`Gv3 zP4S^B3dL%Lrqz^2rGkiP(NYa+0+mn_nkXtnAt{)&w80`t`e3a>vi_1ux9cUCAWm<# zvortw{Xb_Wk|gsl9+!AlNFVBwR4z$UlFpR$2z_yW&F1s@>g((4R%@9|G8B5IwbeF^ zH?!ICLx=9w*N^G?E1Aq_ON*^2kFNupojP+3`-rg=4u=i*>Ja3N!w=6!xT7E8ur z7m~>@^Z8#0j-o8md_FIka+=@o4=go&$GkNa8HPcKQYkAMZMCfTDl0FkYDQ5!9*+zY zlCJCFaM-e}WHN~*l!R#MbedP52%t+<)m3$QyF}nBA*eWcswTLF|wtlWqf?Rt*tGUN;yga_V)JLwmmQ~(AU>j zC=|pJGH%Nmd%Z6d3cmrjtgmvp=|JE$(>!AsIu_C}{^re_Gcz-zqob&(uC9iIk?js1H+JsaNpYS$c@ju}fB(UQ z2hoB$VP{822lF&!rlzLu-o49S&StYEd__5InjgbA%}+9!pHabi7>V?;@8j_}USGL# z1<3I5Fnbor`Sa&VDJr_Ux|qLs@gn;UK4W1&tCXMPf~s~@Rt~`T`;R9QgSvi(L<9oe zoMTm0n~TNb(9jUyPE1T}*sy^>UA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