Skip to content

fix: custom domain resolution for self-hosted instances#2019

Open
cyphercodes wants to merge 1 commit intoopenstatusHQ:mainfrom
cyphercodes:fix-selfhosted-custom-domain
Open

fix: custom domain resolution for self-hosted instances#2019
cyphercodes wants to merge 1 commit intoopenstatusHQ:mainfrom
cyphercodes:fix-selfhosted-custom-domain

Conversation

@cyphercodes
Copy link

Description

Fixes custom domain resolution in self-hosted OpenStatus deployments.

Problem

When self-hosting via Docker Compose, custom domains configured on a status page do not resolve correctly. The middleware contains hardcoded checks for stpg.dev (the hosted SaaS platform domain) which breaks custom domain resolution in self-hosted contexts.

Solution

Check the SELF_HOST environment variable and skip the stpg.dev domain checks when running in self-hosted mode (SELF_HOST=true).

Changes

  • Added isSelfHosted constant to detect self-hosted mode via process.env.SELF_HOST
  • Modified password protection redirects to skip stpg.dev check when self-hosted
  • Modified custom domain rewrite logic to skip entirely when self-hosted
  • Updated debug log to show "(self-hosted mode)" instead of hardcoded domain

Fixes #1968

Skip stpg.dev domain checks when SELF_HOST=true environment variable is set.
This fixes custom domain resolution in self-hosted deployments where the
hardcoded stpg.dev checks were causing redirects to fail.

Fixes openstatusHQ#1968
@vercel
Copy link

vercel bot commented Mar 26, 2026

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
openstatus-dashboard Skipped Skipped Mar 26, 2026 9:37pm
openstatus-web Skipped Skipped Mar 26, 2026 9:37pm

Request Review

@vercel vercel bot temporarily deployed to Preview – openstatus-web March 26, 2026 21:37 Inactive
@vercel vercel bot temporarily deployed to Preview – openstatus-dashboard March 26, 2026 21:37 Inactive
@vercel
Copy link

vercel bot commented Mar 26, 2026

@cyphercodes is attempting to deploy a commit to the OpenStatus Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

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.

[Self-Hosted] Custom domain resolution broken on status-page — middleware hardcoded to stpg.dev

1 participant