Make generated URLs domain-agnostic - #5722
Open
awwaiid wants to merge 1 commit into
Open
Conversation
Human Essentials is adding humanessentialsapp.com and humanessentialsapp.org alongside humanessentials.app, because some networks block the `.app` TLD. Links rendered during a request already follow the host the visitor arrived on (the request host takes precedence over routes.default_url_options), but a number of hard-coded absolute URLs sent people back to humanessentials.app regardless, which defeats the point for anyone on a blocking network. - Replace hard-coded in-app links with route helpers, so they follow the current domain: the partner sign-in link on the account request form, and the ICS event URL in CalendarService (which also pointed at a stale /diaper_bank/... path that no longer exists). - Replace hard-coded links in mailer bodies with root_url, and fix the password reset logo to resolve against the new action_mailer.asset_host rather than an absolute humanessentials.app URL that breaks on blocking networks. - Drive the production/staging host from APP_HOST (defaults unchanged), and split the SMTP HELO domain out to SMTP_DOMAIN since it tracks where mail is sent from rather than which domain the site is browsed on. - Add SiteUrlsHelper + config.x.site_urls for the few places that deliberately link to a *different* deployment (the staging banner pointing at the live site, the demo credentials in the account request email), configurable via PRODUCTION_URL and DEMO_URL. Note that email links still use a single configured host, since a mailer has no request to derive one from. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ty2xAxuiBVRpCLoHaR62EU
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.
There have been several reports about humanessentials.app getting blocked by network-local dns filters. I haven't been able to track down what list we are on or what. But in the meantime I got humanessentialsapp.com and humanessentialsapp.org and pointed them at our domain.
This works in general, but there are several hard-coded places that refer to humanessentials.app . This PR genericizes a bunch of them.
Email is one of the places that is done async and so can't follow the user's browser, so I'm leaving that for now.