Start the web dashboard.
(
host: str = typer.Option("0.0.0.0", "--host", "-h", help="Host to bind"),
port: int = typer.Option(8080, "--port", "-p", help="Port to bind"),
)
| 1559 | secsuite serve --port 9000 --api-key mysecretkey |
| 1560 | """ |
| 1561 | try: |
| 1562 | import uvicorn |
| 1563 | except ImportError: |
| 1564 | console.print("[red]uvicorn is not installed.[/red]") |
| 1565 | console.print("[dim]Run: pip install 'security-suite[dashboard]'[/dim]") |
| 1566 | raise typer.Exit(1) from None |
| 1567 | |
| 1568 | import os |
| 1569 | if api_key: |
| 1570 | os.environ["SECSUITE_API_KEY"] = api_key |
| 1571 | console.print("[yellow]API key protection enabled.[/yellow]") |
| 1572 | console.print(f"[dim]Send header: X-API-Key: {api_key}[/dim]") |
| 1573 | |
| 1574 | console.print(f"[bold]Starting Security Suite API[/bold] on http://{host}:{port}") |
| 1575 | console.print(f"[dim]Interactive docs: http://{'localhost' if host == '0.0.0.0' else host}:{port}/docs[/dim]") |
| 1576 | console.print("[dim]Press Ctrl+C to stop[/dim]\n") |
| 1577 | |
| 1578 | uvicorn.run( |
| 1579 | "api.server:create_app", |
| 1580 | factory=True, |
nothing calls this directly
no test coverage detected