Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

fix(api): unblock startup + bake marketplace/index.json into api build

Beenu Arora563abbb9a8e3
diff --git a/.gitignore b/.gitignore
index bc38517ed..8415f8f49 100644
--- a/.gitignore
+++ b/.gitignore
@@ -88,3 +88,10 @@ apps/docs/build/
# Local QA artifacts (screenshots from manual UI checks)
apps/web/.qa-screenshots/
+
+# Marketplace index staged into the API service build context at deploy time
+# (see infra/fly/fly-demo-deploy.sh). The canonical source is marketplace/index.json
+# at the repo root; the API Dockerfile only sees its own dir as build context, so
+# the deploy script copies the index in just-in-time. We never commit the copy.
+services/api/marketplace/
+
diff --git a/apps/web/public/marketplace/index.json b/apps/web/public/marketplace/index.json
index 671bcaf82..896357e13 100644
--- a/apps/web/public/marketplace/index.json
+++ b/apps/web/public/marketplace/index.json
@@ -1,7 +1,7 @@
{
"$schema": "https://example.com/schemas/marketplace/v1.json",
"version": "1.0.0",
- "generated": "2026-05-09T01:35:17Z",
+ "generated": "2026-05-09T14:55:50Z",
"categories": [
{
"id": "playbooks",
diff --git a/infra/fly/fly-demo-deploy.sh b/infra/fly/fly-demo-deploy.sh
index 351851943..c72fd7ace 100755
--- a/infra/fly/fly-demo-deploy.sh
+++ b/infra/fly/fly-demo-deploy.sh
@@ -216,6 +216,34 @@ attach_redis() {
}
# 1. api build context = services/api/
+#
+# Stage marketplace/index.json into the api build context. The api Dockerfile
+# does `COPY . .` against services/api/, so anything outside that dir is
+# invisible to the image. The runtime marketplace endpoint
+# (services/api/app/api/v1/endpoints/marketplace.py) looks for
+# /app/marketplace/index.json and returns HTTP 503 if the file is missing.
+# Without this step, /api/v1/marketplace serves "Service Unavailable" on every
+# fresh deploy.
+#
+# We rebuild the index from source on every deploy (instead of copying a
+# possibly-stale checked-in file) so plugin metadata changes always flip live
+# in the same release as the code change. The staged copy is gitignored.
+stage_marketplace_index() {
+ local src="$REPO_ROOT/marketplace/index.json"
+ local dst_dir="$REPO_ROOT/services/api/marketplace"
+ local dst="$dst_dir/index.json"
+ log "rebuilding marketplace/index.json from plugins/*/plugin.yaml"
+ ( cd "$REPO_ROOT" && python3 scripts/build_marketplace.py >/dev/null )
+ if [[ ! -f "$src" ]]; then
+ err "marketplace/index.json missing after build cannot stage for api deploy"
+ exit 1
+ fi
+ mkdir -p "$dst_dir"
+ cp "$src" "$dst"
+ log " staged $(wc -c < "$dst" | tr -d ' ') bytes $dst"
+}
+stage_marketplace_index
+
ensure_app aisoc-demo-api
attach_pg aisoc-demo-api
attach_redis aisoc-demo-api
diff --git a/marketplace/index.json b/marketplace/index.json
index 671bcaf82..896357e13 100644
--- a/marketplace/index.json
+++ b/marketplace/index.json
@@ -1,7 +1,7 @@
{
"$schema": "https://example.com/schemas/marketplace/v1.json",
"version": "1.0.0",
- "generated": "2026-05-09T01:35:17Z",
+ "generated": "2026-05-09T14:55:50Z",
"categories": [
{
"id": "playbooks",
diff --git a/services/api/app/api/v1/endpoints/oauth.py b/services/api/app/api/v1/endpoints/oauth.py
index 8ad2d7d85..82c587b2d 100644
--- a/services/api/app/api/v1/endpoints/oauth.py
+++ b/services/api/app/api/v1/endpoints/oauth.py
@@ -603,7 +603,7 @@ async def upsert_oauth_app(
)
[email protected]("/app/{connector_type}", status_code=status.HTTP_204_NO_CONTENT)
[email protected]("/app/{connector_type}", status_code=status.HTTP_204_NO_CONTENT, response_model=None)
async def delete_oauth_app(
connector_type: str,
current_user: Annotated[AuthUser, Depends(require_permission("connectors:write"))],