Skip to content

test(apps): independent gateway replica, health and manual failover verifier - #396

Open
ralyodio wants to merge 3 commits into
masterfrom
test/apps-distributed-live-smoke
Open

ralyodio wants to merge 3 commits into
masterfrom
test/apps-distributed-live-smoke

Conversation

@ralyodio

Copy link
Copy Markdown
Collaborator

Distributed container hosting: honest live 3-node verification

The existing c0mpute apps protocol already supports distributed placement, primary/standby, replica snapshots, owner-signed app records, custom domains, CLI and MCP. This PR adds a read-only, operator-run acceptance script rather than claiming a deployment without seeing independent hosts.

What it tests

python3 scripts/verify-distributed-app.py --app-id <20-hex> --gateway https://A --gateway https://B [--gateway https://C] --min-holders 3 --probe

  • Fetch GET /apps/v1/apps/<app-id> from at least two distinct gateway URLs using TLS validation (HTTP only on localhost).
  • Fail closed unless every gateway agrees on exactly the same signed app record, owner, sequence, holder set, primary, promotion epoch and healthy state.
  • Require at least three unique holder peer IDs, primary member of holders, and no app error.
  • Optional --probe requires successful HTTP 2xx routing to the app's health endpoint via each gateway.
  • Manual, non-destructive failover verification with --previous-primary and --previous-epoch; the operator separately stops the prior primary in staging.
  • No Docker commands, credentials, network routing changes, secret data or automatic destruction. Structured JSON output with nonzero failure exit.

Self-tests

python3 scripts/verify-distributed-app.py --self-test tests valid three holders, failover, false health, insufficient/duplicate holders, gateway inconsistency, signature omissions, insecure gateway URLs. GitHub Actions workflow apps-distributed-live-verifier.yml runs Python compilation and these tests.

Limits

This does not itself cryptographically validate Ed25519 signature (the c0mpute gateway must); does not prove physical operator independence; does not verify container host isolation, real data restoration, actual latency or paid hosting. These require operator-controlled 3-host staging, Docker/iptables/IPv6 isolation tests and issue #394 acceptance before launching to arbitrary tenants. PR #393 hardens unguarded network defaults.

Merge only after CI passes.

@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

14 finding(s)

HIGH/CRITICAL: 2 | MEDIUM: 8 | LOW: 4

Severity Rule Location
HIGH js-ssrf-outbound-request apps/web/public/sw.js:24
HIGH sh-remote-script-execution scripts/install.sh:611
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:53
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:109
MEDIUM sql-template-interpolation apps/web/src/lib/chat/convo-store.ts:116
MEDIUM sql-template-interpolation apps/web/src/lib/chat/convo-store.ts:117
MEDIUM sql-template-interpolation apps/web/src/lib/chat/push.ts:476
MEDIUM js-dynamic-code-execution apps/web/src/lib/router/verify.ts:91
MEDIUM sh-remote-script-execution scripts/dev-setup.sh:25
MEDIUM sh-eval-expansion scripts/dev-setup.sh:35
LOW py-ssrf-outbound-request examples/business-strategist-agent/chat.py:37
LOW py-ssrf-outbound-request examples/business-strategist-agent/train.py:54
LOW secret-generic-credential node/crates/c0mpute-core/src/webhook.rs:1171
LOW py-path-traversal node/crates/c0mpute-core/tests/fixtures/fake-infernet-text:29

Snippets are redacted; ThreatCrush never prints matched credential material.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant