A production-minded control plane that turns any HTTPS PWA into Android TWA and iOS WKWebView apps, orchestrated through GitHub Actions. It provides secure secrets management, project metadata, GitHub repo integration, workflow dispatching, and build/run tracking — all protected by API key authentication, IP banning, and rate limiting.
This repository is the backend “control plane”. Your mobile wrappers, Fastlane scripts, and GitHub Actions workflows live in the target repo(s) that the control plane provisions and manages.
- Developer API Key auth with HMAC hashing.
- IP ban after N failed attempts (with TTL) and global + per-key rate limits.
- AES-256-GCM encryption for all sensitive secrets (Apple/Google/Android keystore/OAuth tokens).
- Project management (PWA domain, Android package, iOS bundle info).
- GitHub integration to:
- store PAT securely
- sync secrets into repo Actions secrets
- dispatch workflows
- list workflow runs / retrieve run details
- Audit logging for sensitive actions (secret updates and downloads).
Control Plane (this repo):
- Stores project metadata, encrypted secrets, and audit logs.
- Secures access with API keys, rate limiting, and IP bans.
- Talks to GitHub Actions to inject secrets and trigger builds.
Execution Plane (your repo):
- Contains the actual mobile wrappers (TWA / WKWebView) and Fastlane automation.
- GitHub Actions workflows build and upload to Google Play and Apple TestFlight / App Store.
- Node.js + TypeScript
- Fastify for the API server
- Postgres for persistent data (Prisma ORM)
- Redis for rate limits and IP ban tracking
- Octokit for GitHub API
- AES-256-GCM encryption for secrets
pwa-control-plane/
docker-compose.yml
package.json
tsconfig.json
.env.example
prisma/
schema.prisma
src/
server.ts
env.ts
crypto.ts
http.ts
plugins/
auth.ts
rate.ts
routes/
health.ts
devkeys.ts
projects.ts
credentials.ts
github.ts
integrations/
github.ts
scripts/
bootstrap.ts
npm installdocker compose up -dCopy .env.example to .env and set the required values:
cp .env.example .envGenerate keys:
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"Set in .env:
MASTER_KEY_B64APIKEY_HMAC_SECRET_B64
npm run prisma:generate
npm run prisma:migratenpm run bootstrapnpm run devOpen docs:
http://localhost:8080/docs
- English docs:
docs/README.md - Arabic docs:
docs/README-ar.md - Beginner guide (EN/AR):
docs/guides/publishing-guide-en.md,docs/guides/publishing-guide-ar.md - Privacy policy templates:
docs/templates/privacy-policy-en.md,docs/templates/privacy-policy-ar.md
- The secret download endpoint returns decrypted values; restrict it by role and keep audit logs.
- Run behind a WAF / reverse proxy (Cloudflare / Nginx) for extra DDoS protection.
- Prefer GitHub App installations for production. PAT is easier to start but less secure.
/v1/projects/:id/pwa/validateto check manifest, service worker, HTTPS./v1/templates/repoto bootstrap wrapper repos automatically./v1/projects/:id/releasesto track TestFlight / Play releases.