Skip to content

fix(env): simplify self-host runtime defaults - #814

Open
izadoesdev wants to merge 6 commits into
stagingfrom
codex/selfhost-runtime-defaults
Open

izadoesdev wants to merge 6 commits into
stagingfrom
codex/selfhost-runtime-defaults

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Sep 16, 2026

Copy link
Copy Markdown
Member

SELFHOST=true keeps omitted service URLs local, lets queues reuse REDIS_URL, and prevents server product telemetry from starting, even with copied Databuddy keys. Explicit URL overrides still win; hosted defaults remain unchanged.

Adds explicit workspace dependencies for the existing environment helper. No new runtime settings or schema changes.

Validation: 30 focused environment, browser-config, Redis, and telemetry tests pass. The browser regression verifies both mode values, local versus hosted production URLs, and preserved pixel behavior. Root lint (22 policy checks), all 33 typecheck tasks, frozen install, and all 29 pre-push tasks pass.

Depends on #816 for exposing self-host mode to the dashboard browser bundle and #806 for SELFHOST forwarding through Turbo; both are merged. Rebased directly onto staging containing #816. Preserves the existing Docker build argument and browser-mode forwarding; complements the short environment template and Compose setup in #804.

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
databuddy-status Ready Ready Preview Sep 17, 2026 7:56am UTC
2 Skipped Deployments
Project Deployment Actions Updated
dashboard Skipped Skipped Sep 17, 2026 7:56am UTC
documentation Skipped Skipped Sep 17, 2026 7:56am UTC

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9c29cdc8-015d-4cbf-ba55-2c2b89047429

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@unkey-deploy

unkey-deploy Bot commented Sep 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Unkey Deploy

Name Status Preview Inspect Updated (UTC)
links (preview) Ready Visit Preview Inspect Sep 17, 2026 7:56am

@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge with no outstanding correctness, security, or repository-rule findings.

Summary

This PR makes self-host mode consistently select local service defaults, reuse the shared Redis connection for queues, suppress server product telemetry, and propagate canonical self-host state into the dashboard browser bundle.

  • Explicit URL overrides continue to take precedence, while hosted production defaults remain unchanged.
  • BullMQ falls back to REDIS_URL only in self-host mode.
  • Dashboard build configuration forwards a canonical browser mode value and tests URL and advertising behavior in both modes.
  • AI telemetry client creation is disabled in self-host deployments.
  • Required workspace dependencies and lockfile entries are included.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    S[SELFHOST environment value] --> P[readBooleanEnv]
    P -->|true| L[Local service URL defaults]
    P -->|false in production| H[Hosted service URL defaults]
    P --> N[Next.js canonical true/false value]
    N --> B[Browser NEXT_PUBLIC_SELFHOST]
    B --> U[Dashboard self-host behavior]
    P --> R[BullMQ fallback to REDIS_URL]
    P --> T[Disable server product telemetry]
    E[Explicit URL overrides] --> C[Runtime configuration]
    L --> C
    H --> C
Loading

Reviews (2) · Last reviewed commit: "test(dashboard): verify self-hosted brow..."

Comment thread packages/env/src/public.ts
Comment thread packages/ai/src/lib/databuddy.test.ts Outdated
@izadoesdev

Copy link
Copy Markdown
Member Author

@greptileai review this. Final head ebe714f is rebased onto staging containing merged #816 and #806. Browser mode forwarding is now present and the existing Next regression verifies self-host and hosted production URL defaults plus signup tracking. SDK mocks use exported SDK types. The external Docker commit is preserved. All 30 focused tests, lint, 33 type tasks, and 29 pre-push tasks pass.

@izadoesdev

Copy link
Copy Markdown
Member Author

@greptileai review this. Final head 218cb66 adds only --isolate to the existing Links test command, fixing the Linux CI ordering conflict where a route test replaced the shared environment module before producer tests imported readBooleanEnv. All 27 Links tests and all 29 repository test tasks pass. The previously reviewed runtime changes and merged dependency base are 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.

1 participant