Complete local deployment setup with Cloudflare tunnel
- setup_local_hosting.sh: Configures Nginx reverse proxy, installs cloudflared - SETUP_CLOUDFLARE_TUNNEL.sh: Interactive tunnel setup script (5 min) - check_status.sh: Real-time status dashboard for all services - LOCAL_ACCESS_GUIDE.md: Complete local access instructions - FINAL_DEPLOYMENT_README.md: Comprehensive deployment guide Current Status: ✅ Nginx reverse proxy running (port 80) ✅ Backend API healthy (port 8000) ✅ Frontend running (port 3000, redirecting unauthenticated to login) ✅ PostgreSQL database connected with demo data ✅ All services accessible at http://10.30.20.38 ✅ Cloudflare tunnel installed and ready Access: - Local: http://10.30.20.38 - With Cloudflare: https://your-domain.com (after tunnel setup) - Demo credentials included and working Next Steps: 1. Visit http://10.30.20.38 and login 2. Run SETUP_CLOUDFLARE_TUNNEL.sh for global access 3. Share HTTPS URL with anyone Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,9 +14,11 @@ router = APIRouter(prefix="/attack-paths", tags=["attack-paths"])
|
||||
@router.get("/{finding_id}", response_model=List[AttackPathOut])
|
||||
async def get_attack_paths(
|
||||
finding_id: str,
|
||||
generate: bool = Query(False),
|
||||
payload: dict = Depends(require_executive_or_above),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
"""Get attack paths for a finding. Optionally auto-generate if missing."""
|
||||
# Verify tenant access
|
||||
f_result = await db.execute(select(Finding).where(Finding.id == finding_id))
|
||||
finding = f_result.scalar_one_or_none()
|
||||
@@ -26,7 +28,16 @@ async def get_attack_paths(
|
||||
raise HTTPException(status_code=403, detail="Access denied")
|
||||
|
||||
result = await db.execute(select(AttackPath).where(AttackPath.finding_id == finding_id))
|
||||
return result.scalars().all()
|
||||
paths = result.scalars().all()
|
||||
|
||||
# Auto-generate if requested and none exist
|
||||
if generate and not paths:
|
||||
from app.services.ai_translator import generate_attack_path_narrative
|
||||
import asyncio
|
||||
# Generate in background but return empty list immediately
|
||||
asyncio.create_task(generate_attack_path_narrative(finding_id))
|
||||
|
||||
return paths
|
||||
|
||||
|
||||
@router.post("/{finding_id}/generate")
|
||||
|
||||
Reference in New Issue
Block a user