Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions npm-packages/convex/src/cli/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
logAndHandleFetchError,
ThrowingFetchError,
currentPackageHomepage,
CONVEX_SELF_HOSTED_URL_VAR_NAME,
} from "./utils/utils.js";
import { recursivelyDelete } from "./fsUtils.js";
import { NodeDependency } from "./deployApi/modules.js";
Expand Down Expand Up @@ -967,6 +968,20 @@ export async function handlePushConfigError(
setEnvVarInstructions = `Go to:\n\n ${chalkStderr.bold(
dashboardUrl,
)}\n\n to set it up. `;
} else if (process.env[CONVEX_SELF_HOSTED_URL_VAR_NAME]) {
const variableQuery =
variableName !== undefined ? `?var=${variableName}` : "";
try {
const backendUrl = new URL(
process.env[CONVEX_SELF_HOSTED_URL_VAR_NAME],
);
const dashboardUrl = `${backendUrl.protocol}//${backendUrl.hostname}:6791/settings/environment-variables${variableQuery}`;
setEnvVarInstructions = `Go to:\n\n ${chalkStderr.bold(
dashboardUrl,
)}\n\n to set it up. `;
} catch {
// If the URL is malformed, fall through to the generic message
}
}
await ctx.crash({
exitCode: 1,
Expand Down