feat: initial corvid — standalone ticket service extracted from homelab-dashboard
Extracts the ticket/attachment system into a reusable pip-installable package. Centralises homelab MCP server (tickets, attachments, system logs) here. - corvid package: models, router (make_router factory), config, standalone main - Alembic migration chain for fresh standalone deployments - Docker Compose for standalone deployment (port 8090) - mcp_server.py: moved from homelab-dashboard, CORVID_REPO_PATH configurable Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
37b2c21720
27 changed files with 1072 additions and 0 deletions
33
alembic/env.py
Normal file
33
alembic/env.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import asyncio
|
||||
from logging.config import fileConfig
|
||||
|
||||
from sqlalchemy.ext.asyncio import create_async_engine
|
||||
|
||||
from alembic import context
|
||||
|
||||
alembic_cfg = context.config
|
||||
|
||||
if alembic_cfg.config_file_name is not None:
|
||||
fileConfig(alembic_cfg.config_file_name)
|
||||
|
||||
from corvid import config as app_config
|
||||
from corvid.models import Base # noqa: E402 — registers models
|
||||
|
||||
target_metadata = Base.metadata
|
||||
|
||||
|
||||
def do_run_migrations(connection):
|
||||
context.configure(connection=connection, target_metadata=target_metadata)
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
||||
|
||||
async def run_async_migrations():
|
||||
engine = create_async_engine(app_config.DATABASE_URL)
|
||||
async with engine.begin() as conn:
|
||||
await conn.run_sync(do_run_migrations)
|
||||
await engine.dispose()
|
||||
|
||||
|
||||
run_migrations_online = lambda: asyncio.run(run_async_migrations())
|
||||
run_migrations_online()
|
||||
Loading…
Add table
Add a link
Reference in a new issue