Skip to content

fix: use self-hosted dashboard URL in auth config error message#415

Open
majiayu000 wants to merge 1 commit intoget-convex:mainfrom
majiayu000:fix/issue-56-self-hosted-dashboard-link
Open

fix: use self-hosted dashboard URL in auth config error message#415
majiayu000 wants to merge 1 commit intoget-convex:mainfrom
majiayu000:fix/issue-56-self-hosted-dashboard-link

Conversation

@majiayu000
Copy link
Copy Markdown

Fixes #56

Summary

When handlePushConfigError() encounters an AuthConfigMissingEnvironmentVariable error for self-hosted deployments, it falls through to a generic message without a dashboard link. This is because deploymentName is null for self-hosted setups (no deploymentFields).

This adds an else if branch that detects self-hosted mode via the CONVEX_SELF_HOSTED_URL env var and constructs the dashboard URL using hostname:6791 (the default self-hosted dashboard port from docker-compose.yml) with the path /settings/environment-variables?var=VAR_NAME.

Test plan

  • All existing config.test.ts tests pass (14/14)
  • Manual verification: set CONVEX_SELF_HOSTED_URL=http://localhost:3210 and trigger the AuthConfigMissingEnvironmentVariable error path — output shows http://localhost:6791/settings/environment-variables?var=VAR_NAME instead of dashboard.convex.dev

When CONVEX_SELF_HOSTED_URL is set and deploymentName is null, construct
the dashboard link from the self-hosted backend hostname instead of
showing a generic message without a link.

Fixes get-convex#56

Signed-off-by: majiayu000 <1835304752@qq.com>
@majiayu000 majiayu000 marked this pull request as ready for review March 25, 2026 04:30
@ianmacartney
Copy link
Copy Markdown
Member

Do you prefer the dashboard over npx convex env set ? Another way we could improve this would be to make the env set string include the name of the variable to set.
My only hesitation here is the hard-coding of the port, since you likely wouldn't have that port exposed for anything except when using localhost.

@majiayu000
Copy link
Copy Markdown
Author

Thanks for the feedback @ianmacartney! You're right on both points — the hard-coded port 6791 would only be valid for localhost setups and isn't reliably exposed otherwise. I've updated the fix to instead include the variable name directly in the npx convex env set suggestion (e.g. npx convex env set AUTH_SECRET <value>), which works for all deployment types including self-hosted. The dashboard link for cloud deployments (when deploymentName is set) is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

using clerk with self-hosting gives incorrect dashboard link from CLI

2 participants