Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

update env var names

Steven Tey53923ca368ef
diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright.yaml
index b6790749e3..c342690c45 100644
--- a/.github/workflows/playwright.yaml
+++ b/.github/workflows/playwright.yaml
@@ -57,7 +57,7 @@ jobs:
SMTP_USER: "smtpUser"
SMTP_PASSWORD: "smtpPassword"
- EMBEDDING_SYNC_SECRET: "xx"
+ CRON_SECRET: "xx"
ANTHROPIC_API_KEY: "xx"
STRIPE_SECRET_KEY: "xx"
diff --git a/apps/web/.env.example b/apps/web/.env.example
index 9d949abb22..7ee64dc3d7 100644
--- a/apps/web/.env.example
+++ b/apps/web/.env.example
@@ -37,7 +37,7 @@ TINYBIRD_API_URL=https://api.tinybird.co
# Learn how to set this up: https://vercel.com/templates/next.js/domains-api
PROJECT_ID_VERCEL=
TEAM_ID_VERCEL=
-AUTH_BEARER_TOKEN=
+VERCEL_API_KEY=
# Required for email login
# Get your Resend API Key here: https://resend.com/api-keys
@@ -144,8 +144,7 @@ NEXT_PUBLIC_IS_DUB=
# For cron jobs
CRON_SECRET=
-# For support docs embedding sync
-EMBEDDING_SYNC_SECRET=
+# For storing vector embeddings (/api/support/chat)
UPSTASH_VECTOR_REST_URL=
UPSTASH_VECTOR_REST_TOKEN=
diff --git a/apps/web/app/(ee)/api/admin/refresh-domain/route.ts b/apps/web/app/(ee)/api/admin/refresh-domain/route.ts
index bee85c7a46..5a207c738c 100644
--- a/apps/web/app/(ee)/api/admin/refresh-domain/route.ts
+++ b/apps/web/app/(ee)/api/admin/refresh-domain/route.ts
@@ -7,10 +7,10 @@ export const POST = withAdmin(async ({ req }) => {
const { domain } = await req.json();
const remove = await fetch(
- `https://api.vercel.com/v9/projects/${process.env.PROJECT_ID_VERCEL}/domains/${domain}?teamId=${process.env.TEAM_ID_VERCEL}`,
+ `https://api.vercel.com/v9/projects/${process.env.VERCEL_PROJECT_ID}/domains/${domain}?teamId=${process.env.TEAM_ID_VERCEL}`,
{
headers: {
- Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
},
method: "DELETE",
},
diff --git a/apps/web/app/api/ai/sync-embeddings/route.ts b/apps/web/app/api/ai/sync-embeddings/route.ts
index 6368faab8a..a19ee28be3 100644
--- a/apps/web/app/api/ai/sync-embeddings/route.ts
+++ b/apps/web/app/api/ai/sync-embeddings/route.ts
@@ -27,11 +27,11 @@ const schema = z.object({
// Triggers re-embedding of a single docs/help article.
// Called by the docs GitHub Action when a .mdx file changes.
//
-// Auth: Authorization: Bearer <EMBEDDING_SYNC_SECRET>
+// Auth: Authorization: Bearer <CRON_SECRET>
// Body: { url: string; delay?: number }
export const POST = async (req: Request) => {
const authHeader = req.headers.get("Authorization");
- const secret = process.env.EMBEDDING_SYNC_SECRET;
+ const secret = process.env.CRON_SECRET;
if (!secret || authHeader !== `Bearer ${secret}`) {
return new Response("Unauthorized", { status: 401 });
diff --git a/apps/web/lib/api/domains/add-domain-vercel.ts b/apps/web/lib/api/domains/add-domain-vercel.ts
index 096b246fd8..4f7d0d8c25 100644
--- a/apps/web/lib/api/domains/add-domain-vercel.ts
+++ b/apps/web/lib/api/domains/add-domain-vercel.ts
@@ -21,11 +21,11 @@ export const addDomainToVercel = async (
}
}
return await fetch(
- `https://api.vercel.com/v10/projects/${process.env.PROJECT_ID_VERCEL}/domains?teamId=${process.env.TEAM_ID_VERCEL}`,
+ `https://api.vercel.com/v10/projects/${process.env.VERCEL_PROJECT_ID}/domains?teamId=${process.env.TEAM_ID_VERCEL}`,
{
method: "POST",
headers: {
- Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
diff --git a/apps/web/lib/api/domains/configure-vercel-nameservers.ts b/apps/web/lib/api/domains/configure-vercel-nameservers.ts
index e856a3070c..7a6c0d8d3e 100644
--- a/apps/web/lib/api/domains/configure-vercel-nameservers.ts
+++ b/apps/web/lib/api/domains/configure-vercel-nameservers.ts
@@ -8,7 +8,7 @@ export const configureVercelNameservers = async (
{
method: "PATCH",
headers: {
- Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
diff --git a/apps/web/lib/api/domains/get-config-response.ts b/apps/web/lib/api/domains/get-config-response.ts
index e62536c45d..43979b89d3 100644
--- a/apps/web/lib/api/domains/get-config-response.ts
+++ b/apps/web/lib/api/domains/get-config-response.ts
@@ -7,7 +7,7 @@ const getVercelConfigResponse = async (domain: string) => {
{
method: "GET",
headers: {
- Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
"Content-Type": "application/json",
},
},
diff --git a/apps/web/lib/api/domains/get-domain-response.ts b/apps/web/lib/api/domains/get-domain-response.ts
index 87bad4263c..b05f8035c5 100644
--- a/apps/web/lib/api/domains/get-domain-response.ts
+++ b/apps/web/lib/api/domains/get-domain-response.ts
@@ -3,11 +3,11 @@ import { isProxiedDomain } from "./utils";
export const getVercelDomainResponse = async (domain: string) => {
return await fetch(
- `https://api.vercel.com/v9/projects/${process.env.PROJECT_ID_VERCEL}/domains/${domain.toLowerCase()}?teamId=${process.env.TEAM_ID_VERCEL}`,
+ `https://api.vercel.com/v9/projects/${process.env.VERCEL_PROJECT_ID}/domains/${domain.toLowerCase()}?teamId=${process.env.TEAM_ID_VERCEL}`,
{
method: "GET",
headers: {
- Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
"Content-Type": "application/json",
},
},
diff --git a/apps/web/lib/api/domains/remove-domain-vercel.ts b/apps/web/lib/api/domains/remove-domain-vercel.ts
index 535d6e3e45..42d9d91768 100644
--- a/apps/web/lib/api/domains/remove-domain-vercel.ts
+++ b/apps/web/lib/api/domains/remove-domain-vercel.ts
@@ -24,10 +24,10 @@ export const removeDomainFromVercel = async (domain: string) => {
// so we should only remove it from our Vercel project
if (domains.filter((d) => d.slug !== domain).length > 0) {
return await fetch(
- `https://api.vercel.com/v9/projects/${process.env.PROJECT_ID_VERCEL}/domains/${domain.toLowerCase()}?teamId=${process.env.TEAM_ID_VERCEL}`,
+ `https://api.vercel.com/v9/projects/${process.env.VERCEL_PROJECT_ID}/domains/${domain.toLowerCase()}?teamId=${process.env.TEAM_ID_VERCEL}`,
{
headers: {
- Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
},
method: "DELETE",
},
@@ -39,7 +39,7 @@ export const removeDomainFromVercel = async (domain: string) => {
`https://api.vercel.com/v6/domains/${domain.toLowerCase()}?teamId=${process.env.TEAM_ID_VERCEL}`,
{
headers: {
- Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
},
method: "DELETE",
},
diff --git a/apps/web/lib/api/domains/verify-domain.ts b/apps/web/lib/api/domains/verify-domain.ts
index 6479967dfe..c93e42d6ae 100644
--- a/apps/web/lib/api/domains/verify-domain.ts
+++ b/apps/web/lib/api/domains/verify-domain.ts
@@ -1,10 +1,10 @@
export const verifyDomain = async (domain: string) => {
return await fetch(
- `https://api.vercel.com/v9/projects/${process.env.PROJECT_ID_VERCEL}/domains/${domain.toLowerCase()}/verify?teamId=${process.env.TEAM_ID_VERCEL}`,
+ `https://api.vercel.com/v9/projects/${process.env.VERCEL_PROJECT_ID}/domains/${domain.toLowerCase()}/verify?teamId=${process.env.TEAM_ID_VERCEL}`,
{
method: "POST",
headers: {
- Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
"Content-Type": "application/json",
},
},
diff --git a/apps/web/lib/edge-config/update.ts b/apps/web/lib/edge-config/update.ts
index addce4348c..2bb6cb62aa 100644
--- a/apps/web/lib/edge-config/update.ts
+++ b/apps/web/lib/edge-config/update.ts
@@ -29,7 +29,7 @@ export const updateConfig = async ({
{
method: "PATCH",
headers: {
- Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({