""" List all available FQDN domains (custom hostnames) Usage: uv run python scripts/list_domains.py """ import sys from pathlib import Path project_root = Path(__file__).parent.parent sys.path.insert(0, str(project_root)) from src.database.session import db_manager from src.database.models import SiteDeployment def list_domains(): """List all site deployments with custom hostnames""" session = db_manager.get_session() try: sites = session.query(SiteDeployment).filter( SiteDeployment.custom_hostname.isnot(None) ).order_by(SiteDeployment.site_name).all() print(f"\nFound {len(sites)} domains with custom hostnames:\n") print(f"{'ID':<5} {'Site Name':<35} {'Custom Hostname'}") print("-" * 80) for s in sites: print(f"{s.id:<5} {s.site_name:<35} {s.custom_hostname}") print() finally: session.close() if __name__ == "__main__": list_domains()