From bea1408b65f419abd565f6df67ae36f4e6febcc9 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 18 Oct 2023 16:34:56 -0400 Subject: [PATCH] Adding /version route. Fixes #2914 --- crates/routes/src/nodeinfo.rs | 7 +++---- docker/nginx.conf | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/routes/src/nodeinfo.rs b/crates/routes/src/nodeinfo.rs index 736ab4e04..bd7d50ad6 100644 --- a/crates/routes/src/nodeinfo.rs +++ b/crates/routes/src/nodeinfo.rs @@ -12,11 +12,10 @@ use serde::{Deserialize, Serialize}; use url::Url; pub fn config(cfg: &mut web::ServiceConfig) { + let nodeinfo_json_route = || web::get().to(node_info).wrap(cache_1hour()); cfg - .route( - "/nodeinfo/2.0.json", - web::get().to(node_info).wrap(cache_1hour()), - ) + .route("/nodeinfo/2.0.json", nodeinfo_json_route()) + .route("/version", nodeinfo_json_route()) .route( "/.well-known/nodeinfo", web::get().to(node_info_well_known).wrap(cache_3days()), diff --git a/docker/nginx.conf b/docker/nginx.conf index fd52ec84e..61256e21d 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -56,7 +56,7 @@ http { } # backend - location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known) { + location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known|version) { proxy_pass "http://lemmy"; # proxy common stuff proxy_http_version 1.1;