Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 4.7 3fa0e26bd1 ci(portal): sign orca webhook POST with HMAC-SHA256
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 10m17s
ci / e2e (pull_request) Has been skipped
ci / image (pull_request) Has been skipped
When `orca webhooks add` registers a webhook it generates a signing
secret by default; orca then requires X-Hub-Signature-256 on inbound
POSTs (the public master at :6880 means anyone could otherwise fire
a deploy by crafting the JSON body).

Adds the signing step using the standard github-shaped header. The
secret is consumed from a new Gitea Actions secret ORCA_WEBHOOK_SECRET
on this repo — value provided out-of-band from the master.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-10 12:18:12 +02:00
Sharang ParnerkarandClaude Opus 4.7 8fc4dc09c9 ci(portal): retarget image build to registry.meghsakha.com + orca webhook
ci / shared (pull_request) Successful in 14s
ci / test (pull_request) Successful in 10m17s
ci / e2e (pull_request) Has been skipped
ci / image (pull_request) Has been skipped
The previous CI pushed to registry.breakpilot.com (the future prod
registry that doesn't exist yet) and tried to call `orca apply`, a
CLI shape this orca version doesn't ship. Repointing to the live
infrastructure:

- registry: registry.meghsakha.com
- image path: breakpilot/portal (sibling of breakpilot/compliance-*)
- tags: :latest (for the webhook-driven deploy) + :sha-<sha> (traceability)
- redeploy: POST github-style payload to the orca webhook on the master,
  matching the pattern documented in orca-infra/WEBHOOKS.md

The webhook must be registered once on the master:
  orca webhooks add --repo platform/portal \
                    --service breakpilot-portal --branch main

CI also needs REGISTRY_USER + REGISTRY_PASS set on this Gitea repo's
Actions secrets — same htpasswd-backed creds the master uses today.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-10 12:12:44 +02:00
3 changed files with 9 additions and 31 deletions
+4 -13
View File
@@ -8,10 +8,6 @@ on:
push:
branches: [main]
env:
COSIGN_KEY: ${{ secrets.COSIGN_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
jobs:
shared:
runs-on: docker
@@ -114,7 +110,7 @@ jobs:
image:
# Builds the portal image and ships it through the same path every
# other service in orca-infra uses: push :latest + :sha-<sha> to
# repo.breakpilot.com, then POST a github-style payload to the
# registry.meghsakha.com, then POST a github-style payload to the
# orca webhook so the master pulls and redeploys breakpilot-portal.
#
# Webhook target (registered once on the master via
@@ -128,20 +124,15 @@ jobs:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: repo.breakpilot.com
registry: registry.meghsakha.com
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASS }}
- uses: docker/build-push-action@v6
with:
push: true
tags: |
repo.breakpilot.com/breakpilot/portal:latest
repo.breakpilot.com/breakpilot/portal:sha-${{ github.sha }}
- name: sign image (cosign)
run: |
{ command -v cosign >/dev/null 2>&1 || curl -sSfLo /usr/local/bin/cosign https://github.com/sigstore/cosign/releases/download/v2.4.3/cosign-linux-amd64 || wget -qO /usr/local/bin/cosign https://github.com/sigstore/cosign/releases/download/v2.4.3/cosign-linux-amd64; } || echo "::warning::cosign fetch failed"
chmod +x /usr/local/bin/cosign 2>/dev/null || true
cosign sign --yes --key env://COSIGN_KEY repo.breakpilot.com/breakpilot/portal:latest || echo "::warning::cosign failed"
registry.meghsakha.com/breakpilot/portal:latest
registry.meghsakha.com/breakpilot/portal:sha-${{ github.sha }}
- name: trigger orca redeploy
# Signs the POST with HMAC-SHA256 over the JSON body using the
# secret orca generated when the webhook was registered. Orca's
+4 -4
View File
@@ -22,7 +22,7 @@ jobs:
- name: verify stage soak (>= 24h on this image)
run: |
IMG=repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:env-stage
IMG=registry.breakpilot.com/${{ github.event.repository.name }}:env-stage
SOAK_SECONDS=$(orca image-age --env=stage --image $IMG)
if [ "$SOAK_SECONDS" -lt 86400 ]; then
echo "Stage soak only $SOAK_SECONDS s, < 24h. Aborting."
@@ -34,12 +34,12 @@ jobs:
- name: re-tag image as semver + env-prod
uses: docker/login-action@v3
with:
registry: repo.breakpilot.com
registry: registry.breakpilot.com
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASS }}
- run: |
IMG=repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}
IMG=registry.breakpilot.com/${{ github.event.repository.name }}
docker pull $IMG:env-stage
docker tag $IMG:env-stage $IMG:v${{ steps.v.outputs.version }}
docker tag $IMG:env-stage $IMG:env-prod
@@ -67,7 +67,7 @@ jobs:
curl -X POST -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/json" \
-d "$(jq -Rs '{tag_name:"v${{ steps.v.outputs.version }}", name:"v${{ steps.v.outputs.version }}", body:.}' < RELEASE_NOTES.md)" \
https://git.breakpilot.com/api/v1/repos/${{ github.repository }}/releases
https://gitea.meghsakha.com/api/v1/repos/${{ github.repository }}/releases
rollback-on-failure:
needs: promote
+1 -14
View File
@@ -11,20 +11,7 @@ export type HostMatch =
| { kind: "unknown" };
// Longest-first so `stage.breakpilot.com` is matched before `breakpilot.com`.
// Built-ins cover dev (localhost) + the canonical breakpilot.com targets.
// PORTAL_APEX_HOSTS is a comma-separated env override for per-environment
// hosts (e.g. portal-dev.meghsakha.com while breakpilot.com isn't registered).
const APEX_HOSTS = (() => {
const base = ["stage.breakpilot.com", "breakpilot.com", "localhost"];
const extra = (process.env.PORTAL_APEX_HOSTS ?? "")
.split(",")
.map((h) => h.trim().toLowerCase())
.filter(Boolean);
// Longest-first to keep the suffix-strip loop correct.
return Array.from(new Set([...extra, ...base])).sort(
(a, b) => b.length - a.length,
);
})();
const APEX_HOSTS = ["stage.breakpilot.com", "breakpilot.com", "localhost"];
const APEX_SET = new Set(APEX_HOSTS);
export function parseHost(host: string | null | undefined): HostMatch {