[Improve] Default new self-hosted installs to flat preview hostnames - #1484
Merged
Conversation
Contributor
Author
|
No code issues found. See task
Reviewed e1131f1 |
Review follow-ups for the flat preview hostname default: - Preserve the preview *layout* (not a literal domain) on installer and deployer reruns: flat layouts follow the app domain across a domain change, dedicated preview domains are kept with a warning. - Force the reserved suffix whenever the preview domain equals the app domain, including an explicit --preview-domain restating it, and pass operator-configured suffixes through unchanged in dedicated layouts (install.sh and deploy.sh now share the same matrix). - Read .env values on reruns with the same tolerant pattern set_env_value writes (export prefix, leading whitespace, '=' in values) instead of a narrower inline awk, and read tfvars via a shared lib.sh helper that tolerates terraform fmt alignment. - Default to flat previews (not the legacy nested layout) when a partial .env has no ROOMOTE_PREVIEW_DOMAIN. - Require a 13-char base36 taskId prefix, and the configured subdomain suffix, before the Caddy on-demand TLS ask endpoint approves a hostname, so wildcard scanner probes of first-level subdomains cannot burn the Let's Encrypt per-domain rate limit under the flat default. - Map zone-apex domains to "@"/"*" DNS record names in the DigitalOcean Terraform instead of emitting doubled names like "*.example.com.example.com". - Validate PREVIEW_PROXY_SUBDOMAIN_SUFFIX through rendered `docker compose config` output per service instead of a raw YAML anchor check, and align the CI source asserts with the new code. - Update apps/docs/homelab.mdx to the flat default DNS layout and note in SELF_HOSTING.md that nested previews need the dedicated namespace.
The Caddy on-demand TLS ask endpoint now requires a 13-char base36 taskId prefix and the configured subdomain suffix, which rejected the settings probe's roomote-preview-check-<timestamp> hostname: on fresh flat deployments the certificate handshake failed and a healthy wildcard was reported unavailable. Build the probe hostname as a task-shaped label with the configured suffix instead. The fixed synthetic taskId also keeps repeated probes on one hostname so on-demand TLS does not mint a new certificate per probe. The settings example hostname now includes the suffix too, so flat deployments display the URL shape previews actually publish.
mrubens
marked this pull request as ready for review
August 20, 2026 00:58
mrubens
requested review from
brunobergher,
daniel-lxs and
mrubens
as code owners
August 20, 2026 00:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
<task>-<port>-preview.<domain>preview hostnames.--preview-domainas the dedicated namespace opt-in.Why this change was made
Flat preview hostnames fit standard one-label wildcard DNS and certificate coverage. They avoid requiring a deeper
*.preview.<domain>certificate for new self-hosted deployments, particularly behind tunnel or CDN providers.Impact
New self-hosted installations publish preview URLs under the app domain with the reserved
-previewsuffix. Existing installations keep their configured hostname layout, so upgrades and reruns do not silently migrate active preview URLs.Shell syntax, formatting, lint, type checks, Knip, and all deployment Compose shape checks passed. The sandbox could not run the validator's Caddy container adaptation or Terraform formatting because it exposes neither a Docker socket nor a Terraform binary.