Skip to content

Commit 1c00f2f

Browse files
committed
feat(settings): custom tracking domain per team
A team can put open, click, unsubscribe and view-in-browser links on its own subdomain. The domain is verified by its CNAME and an HTTPS probe, rechecked hourly while pending and daily once verified, and falls back to the API host after three failed daily checks. Retired domains keep being served so links in sent emails keep working. On a tracking domain only the tracking routes answer; /tls/ask lets an on-demand TLS proxy issue certificates for teams' domains. REST, MCP, dashboard card and docs included. The domain authentication dialog now names the bounce (Return-Path) domain in its SPF section. Closes #50
1 parent c8d3934 commit 1c00f2f

33 files changed

Lines changed: 12422 additions & 33 deletions

‎apps/api/.env.example‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ GOOGLE_CLIENT_SECRET=
174174
# CONTENT_SCAN=heuristic # off | heuristic | ai (default ai when ANTHROPIC_API_KEY is set)
175175
# ANTHROPIC_API_KEY=
176176

177+
# Custom tracking domains (#50). Teams point a CNAME at this host; defaults to
178+
# the host in DOMAIN. Your proxy must serve those hosts over HTTPS; see
179+
# apps/docs self-hosting/tracking-domains.
180+
# TRACKING_DOMAIN_CNAME_TARGET=
181+
177182
# Test sends (all deployments). Every recipient counts once; windows are rolling.
178183
# TEST_SEND_DAILY_LIMIT=100 # per team, any 24 hours
179184
# TEST_SEND_BURST_LIMIT=50 # per team, any TEST_SEND_BURST_HOURS
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ALTER TABLE "settings" ADD COLUMN "tracking_domain" text;--> statement-breakpoint
2+
ALTER TABLE "settings" ADD COLUMN "tracking_domain_status" text;--> statement-breakpoint
3+
ALTER TABLE "settings" ADD COLUMN "tracking_domain_error" text;--> statement-breakpoint
4+
ALTER TABLE "settings" ADD COLUMN "tracking_domain_verified_at" timestamp with time zone;--> statement-breakpoint
5+
ALTER TABLE "settings" ADD COLUMN "tracking_domain_checked_at" timestamp with time zone;--> statement-breakpoint
6+
ALTER TABLE "settings" ADD COLUMN "tracking_domain_failures" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
7+
ALTER TABLE "settings" ADD COLUMN "retired_tracking_domains" text[] DEFAULT '{}'::text[] NOT NULL;--> statement-breakpoint
8+
ALTER TABLE "settings" ADD CONSTRAINT "settings_tracking_domain_unique" UNIQUE("tracking_domain");

0 commit comments

Comments
 (0)