feat: rename to FabledScryer, multi-dashboard system, plugin management, branding
- 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>
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@ import pytest
|
||||
import pytest_asyncio
|
||||
from pathlib import Path
|
||||
import textwrap
|
||||
from fablednetmon.app import create_app
|
||||
from fabledscryer.app import create_app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from fablednetmon.app import create_app
|
||||
from fabledscryer.app import create_app
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
+6
-6
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
import bcrypt
|
||||
from unittest.mock import AsyncMock, patch
|
||||
from fablednetmon.models.users import User, UserRole
|
||||
from fabledscryer.models.users import User, UserRole
|
||||
|
||||
|
||||
def make_user(role=UserRole.admin):
|
||||
@@ -23,7 +23,7 @@ async def test_login_page_returns_200(client):
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_login_redirects_to_setup_when_no_users(client, app):
|
||||
with patch("fablednetmon.auth.routes.get_user_count", new=AsyncMock(return_value=0)):
|
||||
with patch("fabledscryer.auth.routes.get_user_count", new=AsyncMock(return_value=0)):
|
||||
response = await client.get("/login")
|
||||
assert response.status_code == 302
|
||||
assert "/setup" in response.headers["Location"]
|
||||
@@ -32,8 +32,8 @@ async def test_login_redirects_to_setup_when_no_users(client, app):
|
||||
@pytest.mark.asyncio
|
||||
async def test_login_success_redirects_to_dashboard(client, app):
|
||||
user = make_user()
|
||||
with patch("fablednetmon.auth.routes.get_user_count", new=AsyncMock(return_value=1)), \
|
||||
patch("fablednetmon.auth.routes.get_user_by_username", new=AsyncMock(return_value=user)):
|
||||
with patch("fabledscryer.auth.routes.get_user_count", new=AsyncMock(return_value=1)), \
|
||||
patch("fabledscryer.auth.routes.get_user_by_username", new=AsyncMock(return_value=user)):
|
||||
response = await client.post("/login", form={"username": "admin", "password": "password"})
|
||||
assert response.status_code == 302
|
||||
assert "/" in response.headers["Location"]
|
||||
@@ -42,8 +42,8 @@ async def test_login_success_redirects_to_dashboard(client, app):
|
||||
@pytest.mark.asyncio
|
||||
async def test_login_failure_returns_400(client, app):
|
||||
user = make_user()
|
||||
with patch("fablednetmon.auth.routes.get_user_count", new=AsyncMock(return_value=1)), \
|
||||
patch("fablednetmon.auth.routes.get_user_by_username", new=AsyncMock(return_value=user)):
|
||||
with patch("fabledscryer.auth.routes.get_user_count", new=AsyncMock(return_value=1)), \
|
||||
patch("fabledscryer.auth.routes.get_user_by_username", new=AsyncMock(return_value=user)):
|
||||
response = await client.post("/login", form={"username": "admin", "password": "wrong"})
|
||||
assert response.status_code == 400
|
||||
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
import os
|
||||
import textwrap
|
||||
import pytest
|
||||
from fablednetmon.config import load_bootstrap
|
||||
from fabledscryer.config import load_bootstrap
|
||||
|
||||
|
||||
def test_load_bootstrap_from_yaml(tmp_path):
|
||||
cfg_file = tmp_path / "config.yaml"
|
||||
cfg_file.write_text(textwrap.dedent("""\
|
||||
database:
|
||||
url: postgresql+asyncpg://user:pass@localhost/fablednetmon
|
||||
url: postgresql+asyncpg://user:pass@localhost/fabledscryer
|
||||
secret_key: test-secret
|
||||
"""))
|
||||
cfg = load_bootstrap(cfg_file)
|
||||
assert cfg["database_url"] == "postgresql+asyncpg://user:pass@localhost/fablednetmon"
|
||||
assert cfg["database_url"] == "postgresql+asyncpg://user:pass@localhost/fabledscryer"
|
||||
assert cfg["secret_key"] == "test-secret"
|
||||
|
||||
|
||||
def test_env_var_database_url_overrides_yaml(tmp_path, monkeypatch):
|
||||
cfg_file = tmp_path / "config.yaml"
|
||||
cfg_file.write_text("database:\n url: original\nsecret_key: s\n")
|
||||
monkeypatch.setenv("FABLEDNETMON_DATABASE_URL", "overridden")
|
||||
monkeypatch.setenv("FABLEDSCRYER_DATABASE_URL", "overridden")
|
||||
cfg = load_bootstrap(cfg_file)
|
||||
assert cfg["database_url"] == "overridden"
|
||||
|
||||
@@ -27,7 +27,7 @@ def test_env_var_database_url_overrides_yaml(tmp_path, monkeypatch):
|
||||
def test_env_var_secret_key_overrides_yaml(tmp_path, monkeypatch):
|
||||
cfg_file = tmp_path / "config.yaml"
|
||||
cfg_file.write_text("database:\n url: x\nsecret_key: from-yaml\n")
|
||||
monkeypatch.setenv("FABLEDNETMON_SECRET_KEY", "from-env")
|
||||
monkeypatch.setenv("FABLEDSCRYER_SECRET_KEY", "from-env")
|
||||
cfg = load_bootstrap(cfg_file)
|
||||
assert cfg["secret_key"] == "from-env"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from fablednetmon.models.users import User, UserRole
|
||||
from fabledscryer.models.users import User, UserRole
|
||||
|
||||
|
||||
def test_user_model_fields():
|
||||
|
||||
Reference in New Issue
Block a user