diff --git a/lnbits/app.py b/lnbits/app.py index bc38ba3d..19bd71f4 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -57,6 +57,7 @@ def create_app() -> FastAPI: app = FastAPI( title="LNbits API", description="API for LNbits, the free and open source bitcoin wallet and accounts system with plugins.", + version=settings.version, license_info={ "name": "MIT License", "url": "https://raw.githubusercontent.com/lnbits/lnbits/main/LICENSE", @@ -305,6 +306,7 @@ def register_startup(app: FastAPI): def log_server_info(): logger.info("Starting LNbits") + logger.info(f"Version: {settings.version}") logger.info(f"Baseurl: {settings.lnbits_baseurl}") logger.info(f"Host: {settings.host}") logger.info(f"Port: {settings.port}") diff --git a/lnbits/settings.py b/lnbits/settings.py index 447b4d4e..62751b4f 100644 --- a/lnbits/settings.py +++ b/lnbits/settings.py @@ -1,4 +1,5 @@ import importlib +import importlib.metadata import inspect import json import subprocess @@ -225,6 +226,7 @@ class EnvSettings(LNbitsSettings): lnbits_path: str = Field(default=".") lnbits_commit: str = Field(default="unknown") super_user: str = Field(default="") + version: str = Field(default="0.0.0") class SaaSSettings(LNbitsSettings): @@ -366,6 +368,7 @@ try: except: settings.lnbits_commit = "docker" +settings.version = importlib.metadata.version("lnbits") # printing environment variable for debugging if not settings.lnbits_admin_ui: