feat: add environment variable support to CLI and backend metadata

- Update CLI to use configurable app name and version from settings
- Make backend package metadata configurable via environment variables
- Add CONTACT_EMAIL environment variable support
- Ensure consistent branding across CLI, API, and web interface
This commit is contained in:
William Valentin
2025-09-14 15:57:25 -07:00
parent 5eee1beb8d
commit f3b3562e6a
2 changed files with 8 additions and 5 deletions

View File

@@ -11,9 +11,11 @@ The backend is designed to be modular and can be used both as a standalone
library and as part of the web application. library and as part of the web application.
""" """
__version__ = "1.1.0" import os
__version__ = os.getenv("APP_VERSION", "1.1.0")
__author__ = "UnitForge Team" __author__ = "UnitForge Team"
__email__ = "contact@unitforge.dev" __email__ = os.getenv("CONTACT_EMAIL", "contact@unitforge.dev")
# Package metadata # Package metadata
__all__ = [ __all__ = [

View File

@@ -18,15 +18,16 @@ if _backend_path not in sys.path:
sys.path.insert(0, _backend_path) sys.path.insert(0, _backend_path)
# Import our modules after path setup # Import our modules after path setup
from app.core.config import settings # noqa: E402
from app.core.templates import template_registry # noqa: E402 from app.core.templates import template_registry # noqa: E402
from app.core.unit_file import SystemdUnitFile, UnitType, create_unit_file # noqa: E402 from app.core.unit_file import SystemdUnitFile, UnitType, create_unit_file # noqa: E402
@click.group() @click.group()
@click.version_option(version="1.0.0") @click.version_option(version=settings.app_version)
def cli(): def cli():
""" f"""
UnitForge - Create, validate, and manage systemd unit files. {settings.app_name} - Create, validate, and manage systemd unit files.
A comprehensive tool for working with systemd unit files from the command line. A comprehensive tool for working with systemd unit files from the command line.
""" """