feat: add palinks.app to Rails config.hosts (#51) #53
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "51-add-palinks-app-host"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add
palinks.apptoconfig.hostsin production so Rails accepts requests from the custom domain instead of returning 403 Blocked Host errors.Changes
config/environments/production.rb-- addedconfig.hosts << "palinks.app"following the same append pattern used indevelopment.rbTest Plan
curl -I https://palinks.appreturns 200 instead of 403Review Checklist
config.hosts <<pattern from development.rbRelated Notes
None.
Related
Closes #51
PR #53 Review
DOMAIN REVIEW
Stack: Ruby on Rails (production environment config)
The change adds
config.hosts << "palinks.app"toconfig/environments/production.rb, activating Rails host authorization for the production domain. This is the correct fix for the 403 Blocked Host error described in #51.Pattern consistency: The
config.hosts <<append pattern matches whatdevelopment.rbuses for its Tailscale hosts (palinks.tail5b443a.ts.net,dev-tunnel-palinks.tail5b443a.ts.net). Correct approach.Subdomain coverage: The PR adds only the bare domain
"palinks.app". Ifwww.palinks.appor other subdomains eventually route to this app, they will be blocked by host authorization. The commented-out Rails example on line 65 even demonstrates a regex pattern for this:/.*\.example\.com/. Not a blocker today if subdomains are not in use, but worth confirming.Security posture: This is a security improvement. With
config.hostspreviously having no entries (all commented out), Rails was either rejecting everything or accepting everything depending on version defaults. Explicitly allowlisting the production domain is correct.No test coverage concern: This is a one-line framework configuration change, not custom application logic. Rails host authorization is tested by the framework itself. The test plan (deploy, curl, verify 200 vs 403) is the appropriate validation method for this change.
BLOCKERS
None.
NITS
Subdomain future-proofing (optional): Consider whether
www.palinks.appor*.palinks.appsubdomains will ever route here. If so, adding a regex entry now prevents a repeat of this same issue later:Not blocking -- only relevant if subdomains are planned.
Tailscale host in production:
development.rbexplicitly allows Tailscale hostnames. If production is also accessed via Tailscale (the test plan mentions "verify existing Tailscale access still works"), you may need to add the Tailscale hostname to production hosts as well, or Tailscale-routed requests to production will start returning 403. Worth verifying during the deploy test.SOP COMPLIANCE
51-add-palinks-app-host)PROCESS OBSERVATIONS
Low-risk, single-line config change. Deployment risk is minimal -- worst case is a rollback of one line. The change unblocks the custom domain chain (issue #50 set DNS, this PR makes Rails accept the host). Validate that Tailscale access path is not broken by host authorization activation (see nit #2).
VERDICT: APPROVED
PR #53 Review
DOMAIN REVIEW
Stack: Ruby on Rails (production environment configuration)
This is a Rails
config.hostschange -- the HostAuthorization middleware in Rails 6+ blocks requests from unrecognized hosts with a 403. Adding"palinks.app"to the allowlist is the correct fix for the custom domain routing chain (DNS A record -> Hetzner edge proxy -> Rails app).Observations:
Pattern consistency: The PR body states this follows the same
config.hosts <<append pattern used indevelopment.rb. The append-style (<<) is idiomatic Rails and correct.Bare domain only: The config adds
"palinks.app"but not"www.palinks.app"or a wildcard regex like/.*\.palinks\.app/. This is fine IF the DNS/proxy setup only routes the bare domain. Ifwww.palinks.appever resolves to this app, a follow-up will be needed. Not a blocker -- just noting for awareness.No subdomain coverage: Same point -- if future subdomains (e.g.,
api.palinks.app) are needed, they would require separate entries or a regex. Acceptable for current scope.Placement: The line is inserted in the correct location -- right where the commented-out example hosts block was, before the
host_authorizationskip comment. Clean placement.No test coverage concern: This is a Rails environment config line, not application logic. There is no unit-testable behavior here -- the test plan (deploy and
curl -I) is the appropriate verification method for a host allowlist change. No blocker.BLOCKERS
None.
NITS
Consider adding a comment: A brief inline comment explaining why this host is allowed (e.g.,
# Custom domain routed via Hetzner edge proxy) would help future readers. Very minor -- the git history and PR body provide the context.Future-proofing: If
www.palinks.appwill eventually redirect or resolve here, consider adding it now or noting it as a follow-up in issue #28 (the umbrella custom domain issue).SOP COMPLIANCE
Closes #51references the parent issuePROCESS OBSERVATIONS
VERDICT: APPROVED