1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Add git commit hash to version info on HTTP servers

This commit is contained in:
NG (Graham)
2025-05-30 23:11:51 -04:00
parent 50cc0cc3a9
commit 093bc42e97
8 changed files with 33 additions and 3 deletions

View File

@@ -15,3 +15,4 @@ log.workspace = true
env_logger.workspace = true
tokio = { version = "1.43", features = [ "rt-multi-thread" ] }
zip = "4"
git-version.workspace = true

View File

@@ -7,10 +7,11 @@ use actix_web::{App, HttpServer, Responder};
async fn index() -> impl Responder {
let name = env!("CARGO_PKG_NAME");
let version = env!("CARGO_PKG_VERSION");
let git_version = git_version::git_version!(args = ["--always", "--dirty=+"]);
let authors = env!("CARGO_PKG_AUTHORS");
let license = env!("CARGO_PKG_LICENSE");
let repo = env!("CARGO_PKG_REPOSITORY");
format!("{} {} by [{}]\n{}\n{}", name, version, authors, license, repo)
format!("{} {}{} by [{}]\n{}\n{}", name, version, git_version, authors, license, repo)
}
#[actix_web::main]