Skip to content

Commit 1ddc2f3

Browse files
fix(prod): wire MARKETING_URL + COOKIE_DOMAIN into config template (#5)
Step C of the OSS restructure (66c8f59) removed the automatic https://instanode.devhttps://api.instanode.dev swap that the old code used to paper over a misconfigured APP_URL. With the swap gone, the prod deploy has three regressions driven by config.prod.yaml.tpl never threading the new fields through: 1. POST /webhook/new returns a receive_url on instanode.dev (the static marketing host, which 405s POST) instead of api.instanode.dev. 2. OAuth login redirects to http://localhost:5173/dashboard.html (the default for MarketingURL when the env var isn't set). 3. Dashboard upgrade URL points at localhost:5173 for the same reason. This PR adds the three fields to the prod template so DO's envsubst step populates them from env vars. The AllowedOrigins list is hardcoded here (not env-driven) because YAML-list envsubst is awkward and the production origins are stable. The actual DO env var updates (APP_URL → api.instanode.dev, new MARKETING_URL + COOKIE_DOMAIN, rotated NEWRELIC_LICENSE_KEY as SECRET) are ops actions and must happen before this PR merges so the first deploy after merge reads populated values. Runbook in the PR description.
1 parent a2f4030 commit 1ddc2f3

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

config.prod.yaml.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
server:
55
port: "8080"
66
base_url: "${APP_URL}"
7+
# MarketingURL is the public website host. Used for post-OAuth
8+
# redirects, dashboard upgrade links, and email CTAs. On this
9+
# deployment: api.instanode.dev is the API, instanode.dev is the
10+
# static marketing site on GitHub Pages.
11+
marketing_url: "${MARKETING_URL}"
12+
# CookieDomain shares the session cookie across api.example.com
13+
# and example.com. Empty = scoped to API host only.
14+
cookie_domain: "${COOKIE_DOMAIN}"
15+
# CORS exact-match allowlist. The marketing host needs to be here
16+
# so dashboard.html fetch() calls with credentials:'include' work.
17+
allowed_origins:
18+
- "https://instanode.dev"
19+
- "http://localhost:5173"
20+
- "http://localhost:3000"
721
read_timeout: "30s"
822
write_timeout: "60s"
923
idle_timeout: "120s"

0 commit comments

Comments
 (0)