Provisions and manages customer infrastructure (EC2, DNS, notifications) for Crimata
  • Go 60.2%
  • Shell 25.2%
  • HCL 13.9%
  • Dockerfile 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-16 20:16:00 +00:00
.github/workflows Switch to SSH provisioning, embed provision.sh, add terraform and scripts 2026-02-25 15:38:58 -05:00
cmd/server Replace AWS SES with Resend for email delivery 2026-03-01 22:08:26 -05:00
internal Update provision.sh to install crimata-agent and fix nginx routing 2026-03-02 15:52:21 -05:00
terraform Switch to SSH provisioning, embed provision.sh, add terraform and scripts 2026-02-25 15:38:58 -05:00
.env.example Initial commit 2026-02-22 13:31:38 -05:00
.gitignore Switch to SSH provisioning, embed provision.sh, add terraform and scripts 2026-02-25 15:38:58 -05:00
deprovision.sh Switch to SSH provisioning, embed provision.sh, add terraform and scripts 2026-02-25 15:38:58 -05:00
Dockerfile Switch to SSH provisioning, embed provision.sh, add terraform and scripts 2026-02-25 15:38:58 -05:00
fly.toml Switch to SSH provisioning, embed provision.sh, add terraform and scripts 2026-02-25 15:38:58 -05:00
go.mod Replace AWS SES with Resend for email delivery 2026-03-01 22:08:26 -05:00
go.sum Replace AWS SES with Resend for email delivery 2026-03-01 22:08:26 -05:00
LICENSE Refactor customer → instance package, add dock service, update provision.sh 2026-02-26 23:51:43 -05:00
provision.sh Switch to SSH provisioning, embed provision.sh, add terraform and scripts 2026-02-25 15:38:58 -05:00
README.md Add README 2026-07-16 20:16:00 +00:00

crimata-infra

Backend service that provisions and manages actual customer infrastructure for Crimata: spins up an EC2 instance, points DNS at it (Route 53), sends the customer a notification (via Resend), and can export their data to S3.

What it does

Exposes a small HTTP API (Go, chi router):

  • POST /instances — provision a new customer instance (called by crimata-website's Stripe webhook)
  • GET /instances/:slug — look up an instance
  • DELETE /instances/:slug — tear one down

provision.sh is the bootstrap script that actually runs on the new EC2 instance — currently just installs nginx and a placeholder welcome page, a work in progress.

Running it

Needs Postgres, an AWS account (EC2 + Route53 + S3 permissions), and a Resend API key.

cp .env.example .env   # fill in DATABASE_URL, AWS credentials, EC2/DNS/S3 config
go run ./cmd/server

There's also a terraform/ directory for provisioning the supporting AWS resources (VPC, security groups, etc.) this service depends on.