mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-08-07 09:12:57 +02:00
feat: Add dynamic Git-based versioning system
- Add app/version.py module generating version from Git metadata - Format: YYYY.MM.DD+<commit_hash> (e.g., 2025.01.18+576c8ca9) - Add +dirty suffix for uncommitted changes (ignores .env, technotes/) - Add /api/version endpoint for monitoring - Display version in hamburger menu - Add freeze mechanism for Docker builds Deploy command updated: git push && ssh ... "cd ~/mc-webui && git pull && python -m app.version freeze && docker compose up -d --build" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ from flask_socketio import SocketIO, emit
|
||||
from app.config import config, runtime_config
|
||||
from app.routes.views import views_bp
|
||||
from app.routes.api import api_bp
|
||||
from app.version import VERSION_STRING
|
||||
from app.archiver.manager import schedule_daily_archiving
|
||||
from app.meshcore.cli import fetch_device_name_from_bridge
|
||||
|
||||
@@ -43,6 +44,11 @@ def create_app():
|
||||
app.config['DEBUG'] = config.FLASK_DEBUG
|
||||
app.config['SECRET_KEY'] = 'mc-webui-secret-key-change-in-production'
|
||||
|
||||
# Inject version into all templates
|
||||
@app.context_processor
|
||||
def inject_version():
|
||||
return {'version': VERSION_STRING}
|
||||
|
||||
# Register blueprints
|
||||
app.register_blueprint(views_bp)
|
||||
app.register_blueprint(api_bp)
|
||||
|
||||
Reference in New Issue
Block a user