Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
chore(preview): bootstrap the preview gateway on macro-agent-gateway.com (#7169)
Wolf Mermelsteina3c503fccf14
diff --git a/.github/services-config.json b/.github/services-config.jsonindex 9a26758174..d6b48ac0a8 100644--- a/.github/services-config.json+++ b/.github/services-config.json@@ -299,7 +299,6 @@"stack_path": "infra/stacks/kafka-cluster/**"},"preview-gateway": {- "bootstrap_pending": "Requires an isolated preview domain, Pulumi stacks, and Doppler configs; see services/preview_gateway/README.md","source_paths": ["services/preview_gateway/**","crates/agent_preview/**"diff --git a/infra/stacks/preview-gateway/Pulumi.dev.yaml b/infra/stacks/preview-gateway/Pulumi.dev.yamlnew file mode 100644index 0000000000..f0bb334531--- /dev/null+++ b/infra/stacks/preview-gateway/Pulumi.dev.yaml@@ -0,0 +1,7 @@+config:+ aws:region: us-east-1+ aws-native:region: us-east-1+ preview-gateway:preview_domain: dev.macro-agent-gateway.com+ preview-gateway:preview_zone_id: Z02409452IBB8642CNAGC+ doppler:dopplerToken:+ secure: AAABAFBFq1qtlf6BBmHecVLz/D5mHSXzMR31qqk9bGtIPNIvA6lVYFMFvJ7jXMiC/7dcjBhDMBvmZOUlRzn5aaDIBldrILigtGoTKZi87nlzdiff --git a/infra/stacks/preview-gateway/Pulumi.prod.yaml b/infra/stacks/preview-gateway/Pulumi.prod.yamlnew file mode 100644index 0000000000..1c587778ef--- /dev/null+++ b/infra/stacks/preview-gateway/Pulumi.prod.yaml@@ -0,0 +1,7 @@+config:+ aws:region: us-east-1+ aws-native:region: us-east-1+ preview-gateway:preview_domain: macro-agent-gateway.com+ preview-gateway:preview_zone_id: Z02409452IBB8642CNAGC+ doppler:dopplerToken:+ secure: AAABAIShlLbr8nqVYhy6UMCE3fgXfBvrP+GCeAZnJEUnC+ffIHawkVAO82TXEyBsEv/mb2fQpyfUX1sVFPxsyYoU4pX+IXuagq32n91k2rsfdiff --git a/infra/stacks/preview-gateway/index.ts b/infra/stacks/preview-gateway/index.tsindex a650a08a47..269fe27734 100644--- a/infra/stacks/preview-gateway/index.ts+++ b/infra/stacks/preview-gateway/index.ts@@ -15,6 +15,8 @@ import {import { get_coparse_api_vpc } from '../../packages/vpc';const name = 'preview-gateway';+// Load balancer and target group names are capped at 32 characters, auto-suffix included.+const shortName = 'pvgw';const tags = {environment: stack,env: stack,@@ -125,7 +127,7 @@ const control = new ServiceTargetGroup(`${name}-${stack}`, {serviceSecurityGroupId: taskSg.id,albSecurityGroupId: gateway.albSecurityGroupId,});-const httpAlb = new aws.lb.LoadBalancer(`${name}-http-${stack}`, {+const httpAlb = new aws.lb.LoadBalancer(`${shortName}-http-${stack}`, {loadBalancerType: 'application',subnets: vpc.publicSubnetIds,securityGroups: [albSg.id],@@ -133,7 +135,7 @@ const httpAlb = new aws.lb.LoadBalancer(`${name}-http-${stack}`, {dropInvalidHeaderFields: true,tags,});-const httpTarget = new aws.lb.TargetGroup(`${name}-http-${stack}`, {+const httpTarget = new aws.lb.TargetGroup(`${shortName}-http-${stack}`, {port: 8111,protocol: 'HTTP',targetType: 'ip',@@ -151,14 +153,14 @@ const httpListener = new aws.lb.Listener(`${name}-https-${stack}`, {defaultActions: [{ type: 'forward', targetGroupArn: httpTarget.arn }],tags,});-const sshNlb = new aws.lb.LoadBalancer(`${name}-ssh-${stack}`, {+const sshNlb = new aws.lb.LoadBalancer(`${shortName}-ssh-${stack}`, {loadBalancerType: 'network',subnets: vpc.publicSubnetIds,securityGroups: [sshSg.id],enableCrossZoneLoadBalancing: true,tags,});-const sshTarget = new aws.lb.TargetGroup(`${name}-ssh-${stack}`, {+const sshTarget = new aws.lb.TargetGroup(`${shortName}-ssh-${stack}`, {port: 2222,protocol: 'TCP',targetType: 'ip',@@ -210,10 +212,6 @@ const deploymentConfig = {ENVIRONMENT: stack,PREVIEW_DOMAIN: domain,PREVIEW_SSH_HOST: sshHost,- // Local stacks reach their SSH listener through a Cloudflare quick tunnel;- // a deployed gateway is dialled directly and rejects a proxy host outright.- // Present-but-empty because MacroConfig does not merge missing JSON keys.- PREVIEW_SSH_PROXY_HOST: '',PREVIEW_APP_ORIGIN:stack === 'prod' ? 'https://macro.com' : 'https://dev.macro.com',PREVIEW_CONTROL_HOSTS:diff --git a/services/preview_gateway/README.md b/services/preview_gateway/README.mdindex cc70eac673..6230689f41 100644--- a/services/preview_gateway/README.md+++ b/services/preview_gateway/README.md@@ -87,35 +87,23 @@ runs **one replica**, with non-overlapping replacements and no autoscaling:SSH, HTTP, and control requests must reach the same in-memory registry. Scalingrequires explicit ownership/routing across gateways first.-Before first deployment:--The service has a `bootstrap_pending` reason in `.github/services-config.json`-until these prerequisites are ready. CI still builds, lints, and tests its Rust-and TypeScript, but explicitly defers live Doppler validation and Pulumi preview;-automatic deployment excludes it and the manual service deployment workflow-rejects it. Direct Pulumi commands remain available for bootstrap. Other services'-checks remain strict, including failures caused by missing configuration.--1. Initialize `macro-inc/preview-gateway/dev` and `macro-inc/preview-gateway/prod`- Pulumi stacks. Choose a separate preview domain and its Route 53 zone. Set Pulumi- `preview_domain` and `preview_zone_id` for the dev or prod stack. Dev and prod- should use distinct DNS suffixes.-2. Deploy the Doppler projects stack to create `preview-gateway` and its secret- sync. In its `dev` / `prd` config, set `DATABASE_URL` and `INTERNAL_API_KEY`- using the existing service secret references. Generate a persistent ed25519- key with `ssh-keygen -t ed25519 -N '' -f <private-temporary-path>` and store- its private PEM as `PREVIEW_SSH_HOST_KEY` in Doppler. Do not commit the key.-3. The preview stack manages `PORT`, `ENVIRONMENT`, `PREVIEW_DOMAIN`,- `PREVIEW_SSH_HOST`, `PREVIEW_APP_ORIGIN`, and `PREVIEW_CONTROL_HOSTS` in Doppler.- They must be present in the synced `APP_SECRETS_JSON` before a task can become- healthy. MacroConfig does not merge missing JSON keys from ECS environment- variables. Run `preview_gateway_doppler_config` to validate service config.-4. Remove `bootstrap_pending` from the service inventory and open a PR. This- inventory-only change triggers live Doppler validation and Pulumi previews- before enabling the normal deployment pipeline; do not remove it before dev- and prod configuration are ready. Deploy gateway, harness, and web changes.- Confirm `/preview/health`, call SharePreview,- execute the script, and verify a page edit over HMR and Stop sharing.+Bootstrap (done 2026-09-28):++- Domain: `macro-agent-gateway.com` (Route 53 zone `Z02409452IBB8642CNAGC`).+ Prod serves `*.macro-agent-gateway.com` and `ssh.macro-agent-gateway.com`; dev+ serves `*.dev.macro-agent-gateway.com` and `ssh.dev.macro-agent-gateway.com`.+- Pulumi stacks `macro-inc/preview-gateway/{dev,prod}` carry `preview_domain`,+ `preview_zone_id` and the encrypted `doppler:dopplerToken` the stack's Doppler+ writes need.+- Doppler project `preview-gateway` (created by the `doppler-projects` stack) has+ `DATABASE_URL`, `INTERNAL_API_KEY` and a persistent ed25519+ `PREVIEW_SSH_HOST_KEY` in `dev`/`prd`; the preview stack manages `PORT`,+ `ENVIRONMENT`, `PREVIEW_DOMAIN`, `PREVIEW_SSH_HOST`, `PREVIEW_APP_ORIGIN` and+ `PREVIEW_CONTROL_HOSTS`. MacroConfig reads `APP_SECRETS_JSON` as the complete+ configuration, so those keys must be synced before a task can become healthy.++After a deploy, confirm `/preview/health`, call SharePreview, execute the script,+and verify a page edit over HMR and Stop sharing.A domain, DNS zone, and production secrets are deployment prerequisites, notembedded defaults. Rotating the host key invalidates previously issued scripts;