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.
dont_send_karma
Dessalines 2023-10-24 04:49:52 -04:00 committed by GitHub
parent 5bfa4e9358
commit 1596aee724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -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()),

View File

@ -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;