From dbb024edbda73b3ff11cd1790e92fe6ff6c22c1d Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Mon, 4 Jul 2022 21:45:23 +0200 Subject: [PATCH] Use semver --- app/config.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/config.py b/app/config.py index 2029ad8..9d9a143 100644 --- a/app/config.py +++ b/app/config.py @@ -1,4 +1,5 @@ import os +import subprocess from pathlib import Path import bcrypt @@ -16,7 +17,13 @@ ROOT_DIR = Path().parent.resolve() _CONFIG_FILE = os.getenv("MICROBLOGPUB_CONFIG_FILE", "me.toml") -VERSION = "2.0" +VERSION_COMMIT = ( + subprocess.check_output(["git", "rev-parse", "--short=8", "HEAD"]) + .split()[0] + .decode() +) + +VERSION = f"2.0.0+{VERSION_COMMIT}" USER_AGENT = f"microblogpub/{VERSION}" AP_CONTENT_TYPE = "application/activity+json"