stuntman / environments
One Stuntman. An environment per branch.
Each environment has its own plugins, state, rules, inboxes, base URLs and MCP endpoint. Pause it and the state is kept; clone it for a pull request and let it expire.

The life of pr-5462.
- Cloned from stg-aservices, rules, inboxes and seeds; no traffic history
- The pipeline points the appprovider URLs at *.pr-5462.stuntman.local
- An agent tests the branchover /e/pr-5462/mcp
- Paused for reviewcalls answer 503; the state is kept
- Expires by itselfdeleted, state and all
curl -X POST localhost:8025/api/environments \
-H "content-type: application/json" \
-d '{"name": "pr-5462", "from": "stg-a", "expires": "24h"}'A request finds its environment.
A request that matches none of these goes to the default environment.
By host name
otp.pr-5462.stuntman.localBy path prefix
localhost:8025/e/pr-5462/mcpBy gRPC metadata
x-stuntman-env: pr-5462One server for every branch.
Make each environment from a template with its values, share one SMTP port, hand the app its settings by name, and give people one public address where each environment lives under /e/<name>/.
From a template
{"name": "pr-5462", "from": "acme-preview",
"vars": {"domain": "preview.acme.example"}}One public address
STUNTMAN_PUBLIC_URL=https://stuntman.example.com
/e/pr-5462/ screens
/e/pr-5462/mcp MCP
/e/pr-5462/login/ sign-in pagesWhat the app sets
GET /api/environments/pr-5462/connections
SMTP_USER=pr-5462
IDENTITY_AUTHORITY=https://…/e/pr-5462/…Clone, start empty or start from files.
Pick what comes along: services and their files, rules, inboxes, secrets and, optionally, the state. Set how long it lives and where its callbacks go.
