feat(dev): add portless URLs for all apps - #514
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
|
React Doctor found 1 issue in 1 file · 1 error · score 49 / 100 (Critical) · vs Errors
|
There was a problem hiding this comment.
1 issue found across 20 files
Confidence score: 4/5
- In
apps/dashboard/src/lib/auth/server.ts, strict Turborepo tasks likebuildmay not exposePORTLESS_URL, causing auth to silently fall back toBETTER_AUTH_URLeven when a portless URL is intended; this can lead to environment-specific auth endpoint drift after deploy. AddPORTLESS_URLto the relevant task/env passthrough before merging (or fail fast when it’s missing) to remove the ambiguity.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/dashboard/src/lib/auth/server.ts">
<violation number="1" location="apps/dashboard/src/lib/auth/server.ts:146">
P2: `PORTLESS_URL` will be unavailable for strict Turborepo tasks such as `build`, so this auth config can silently fall back to `BETTER_AUTH_URL` even when a portless URL is configured. Consider adding `PORTLESS_URL` to `turbo.json` `globalEnv` alongside the other auth/app URL variables.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| [ | ||
| "http://localhost:3000", | ||
| "https://app.usenotra.com", | ||
| process.env.PORTLESS_URL, |
There was a problem hiding this comment.
P2: PORTLESS_URL will be unavailable for strict Turborepo tasks such as build, so this auth config can silently fall back to BETTER_AUTH_URL even when a portless URL is configured. Consider adding PORTLESS_URL to turbo.json globalEnv alongside the other auth/app URL variables.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/dashboard/src/lib/auth/server.ts, line 146:
<comment>`PORTLESS_URL` will be unavailable for strict Turborepo tasks such as `build`, so this auth config can silently fall back to `BETTER_AUTH_URL` even when a portless URL is configured. Consider adding `PORTLESS_URL` to `turbo.json` `globalEnv` alongside the other auth/app URL variables.</comment>
<file context>
@@ -143,6 +143,7 @@ function getTrustedOrigins() {
[
"http://localhost:3000",
"https://app.usenotra.com",
+ process.env.PORTLESS_URL,
process.env.BETTER_AUTH_URL,
process.env.NEXT_PUBLIC_APP_URL,
</file context>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Description
Give a short summary of what this PR does and why it's needed.
Screenshot/Recording (if applicable)
Attach a screenshot or recording of the change. This is optional, but can help reviewers understand the change. You can use Loom to record a video.
Checklist
Summary by cubic
Add
portlessto all apps to provide stable, HTTPS, portless local URLs in development. Updates callbacks, auth, ORPC, and emails to preferPORTLESS_URLonly in dev; production behavior is unchanged.New Features
portlesswith URLs:https://app.notra.localhost,https://notra.localhost,https://api.notra.localhost,https://docs.notra.localhost,https://email.notra.localhost.portlessconfig anddev:appscripts inapps/api,apps/dashboard,apps/web,apps/docs, andpackages/email;turbo.jsonnow passesPORT,PORTLESS,PORTLESS_*and includesPORTLESS_URL.getPortlessUrl()to preferPORTLESS_URLonly in development across dashboard integrations (GitHub, Linear, Twitter), workflow and notification emails, auth (baseURL, invite links, trusted origins), ORPC client, email links, andpackages/aiURL utils.Migration
PORTLESS=0to bypass the proxy and use fallback ports.Written for commit f03e4fd. Summary will update on new commits.