From 1596aee724339c7112d5efa42fa37e838e87d93c Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 24 Oct 2023 04:49:52 -0400 Subject: [PATCH] Adding /version route. Fixes #2914 (#4059) * Adding /version route. Fixes #2914 * Using a simple version string. * Use nginx rewriting to solve version. * Forgot to remove version. * Using an actix redirect. --- crates/routes/src/nodeinfo.rs | 1 + docker/nginx.conf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/routes/src/nodeinfo.rs b/crates/routes/src/nodeinfo.rs index 736ab4e04..06d4c2dd6 100644 --- a/crates/routes/src/nodeinfo.rs +++ b/crates/routes/src/nodeinfo.rs @@ -17,6 +17,7 @@ pub fn config(cfg: &mut web::ServiceConfig) { "/nodeinfo/2.0.json", web::get().to(node_info).wrap(cache_1hour()), ) + .service(web::redirect("/version", "/nodeinfo/2.0.json")) .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..529e64a2a 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|version|.well-known) { proxy_pass "http://lemmy"; # proxy common stuff proxy_http_version 1.1;