230b542015
- Rename package fablednetmon → fabledscryer throughout - Multi-dashboard: ownership, per-user defaults, HTMX edit (add/remove/reorder) - Read-only share tokens scoped to individual dashboards - Dashboard edit is HTMX-driven (no page reloads) - Plugin management system: remote catalog, download/install, hot-reload, in-app restart - plugin_index.py: fetch/cache remote index.yaml; default URL → bvandeusen/fabledscryer-plugins - plugin_manager.py: download_and_install_plugin, hot_reload_plugin, restart_app - ZIP extraction handles GitHub archive formats (name-v1.0.0/, name-main/) - Settings split into tabbed sections: General, Notifications, Ansible, Plugins - Plugins tab: catalog browser (HTMX), install/activate/update/restart actions - UI/branding: dark palette (#07071a), crystal ball SVG logo, animated star field, Libertinus Serif applied to headings, nav, labels, and section titles - Widget registry (core/widgets.py) for dashboard plugin integration - UPS widget.html (dashboard card) and settings/_tabs.html include - Migrations 0005–0008: dashboards, is_default, ownership, share tokens - docs/plugins/: writing-a-plugin.md updated with publishing guide, index.yaml.example template for fabledscryer-plugins repo Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 lines
841 B
Python
25 lines
841 B
Python
from __future__ import annotations
|
|
from pathlib import Path
|
|
|
|
|
|
def get_core_head() -> str:
|
|
"""Return the current head revision ID of the core migration scripts.
|
|
|
|
Called at migration authoring time (when running ``alembic revision``),
|
|
not at application runtime. The returned ID should be captured statically
|
|
in a plugin's ``depends_on`` field.
|
|
"""
|
|
from alembic.config import Config
|
|
from alembic.script import ScriptDirectory
|
|
|
|
migrations_dir = Path(__file__).parent.parent / "migrations"
|
|
cfg = Config()
|
|
cfg.set_main_option("script_location", str(migrations_dir))
|
|
script = ScriptDirectory.from_config(cfg)
|
|
heads = script.get_heads()
|
|
if len(heads) != 1:
|
|
raise RuntimeError(
|
|
f"Expected exactly 1 core migration head, got {len(heads)}: {heads}"
|
|
)
|
|
return heads[0]
|